Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

Unexplained error modifyZoneDnsRequest #10

Open
rpieneman opened this issue Jan 26, 2022 · 3 comments
Open

Unexplained error modifyZoneDnsRequest #10

rpieneman opened this issue Jan 26, 2022 · 3 comments

Comments

@rpieneman
Copy link

rpieneman commented Jan 26, 2022

First of all thanks for this great package!

I encountered a strange error while using modifyZoneDnsRequest.

An existing DNS record can be changed without any problems, but the moment you want to add a DNS record, Open Provider returns an error ("An unknown error has occurred!").

When I run the same params in Postman, the new DNS record is created without any problems.

Below my params for changing a DNS record:
{ "id": "12345678", "name": "domain.cloud", "records": { "replace": [ { "name": "test01", "ttl": 3600, "type": "A", "value": "123.456.789.123" } ] } }

Below my params for adding a DNS record:
{ "id": "12345678", "name": "domain.cloud", "records": { "add": [ { "name": "test02", "ttl": 3600, "type": "A", "value": "123.456.789.123" } ] } }

The error message I get back from Open Provider:
array:1 [ "reply" => array:3 [ "code" => "199" "desc" => "An unknown error has occurred!" "data" => [] ] ]

@nickurt
Copy link
Owner

nickurt commented Jan 26, 2022

It's strange it works with the exact same params in Postman, are you sure the $body here

public function request($body, $method)
{
$response = $this->getClient()->request(
$method,
$this->getOptions()['base_url'],
[
'headers' => $this->getHeaders(),
'body' => $body
]
);
return json_decode(json_encode(simplexml_load_string($response->getBody())), true);
}
is exactly the same as the one from Postman?

@rpieneman
Copy link
Author

Yes, exactly the same!
Ofcours, it's XML in stead of JSON, but all the same.

A dump of $body:
<?xml version="1.0"?> <openXML> <credentials> <username>XXX</username> <password>XXX</password> </credentials> <modifyZoneDnsRequest> <id>12345678</id> <name>domain.cloud</name> <records> <add> <name>test02</name> <ttl>3600</ttl> <type>A</type> <value>123.456.789.123</value> </add> </records> </modifyZoneDnsRequest> </openXML>

@nickurt
Copy link
Owner

nickurt commented Jan 26, 2022

Odd, I don't think I can help you much more, did you tried contacting OpenProvider, it's the 'resolution' on their api-error-codes page

199 | An unknown error has occurred! | No immidiate resolution, contact [email protected] please.

Thanks!

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

No branches or pull requests

2 participants