Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createZone error #25

Open
DAThosting opened this issue May 10, 2022 · 1 comment
Open

createZone error #25

DAThosting opened this issue May 10, 2022 · 1 comment

Comments

@DAThosting
Copy link

DAThosting commented May 10, 2022

Trying to create a zone, but the api gives me 400 Bad Request response:\n{"desc":"Invalid request","code":80}

My code looks like:

$createZone = array(
	'domain' => array(
		'extension' => $tld,
		'name' => $domain
	),
	'type' => 'master',
	'records' => $records_array,
);

$model = $client->getDnsModule()->getZoneServiceApi()->createZone($createZone);

$records_array is:

Array
(
    [domain] => Array
        (
            [extension] => de
            [name] => domain
        )

    [type] => master
    [records] => Array
        (
            [0] => Array
                (
                    [name] => www
                    [ttl] => 86400
                    [type] => CNAME
                    [value] => domain.de
                    [prio] => 
                )
        )
)

I also tried it with json instead of a php array, which also doesn't work.

@antoineveldhoven
Copy link

You probably should omit the key 'prio' in your records array.
'prio' should not be supplied with the 'type' === 'CNAME'; since this is out of context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants