Closed Kirecom closed 11 months ago
Same issue for me... The call work on API console but didn't on a local php script
Glad I'm not the only one having the same issue!
Even the example call is on api.ovh.com under the method fails.... :(
Hello !
Have you tested using this syntax ?
$result = $ovh->post('/domain/xxxx.xxxx/nameServers/update', array(
nameServers => array(
array(
host => "ns1",
),
array(
host => "ns2",
)
)
));
Hello Romain,
I tried this syntax and seems it worked.
$result = $ovh->post('/domain/xxxx.xxxx/nameServers/update', array( "nameServers" => array( array( "host" => "ns1", ), array( "host" => "ns2", ) ) ));
It spawned an operation and DNS update was as i wrote in the array :)))
Thanks!
Awesome, closing this issue then !
Romain
Hi,
I'm not an expert dev, but using this wrapper i got some good results, but i'm unable to send json-formatted data to POST methods, for example:
POST /domain/{serviceName}/nameServers/update
asks json formatted data.
So i try to send hostnames as requested:
$result = $ovh->post('/domain/xxxx.xxxx/nameServers/update', array( '' => '{"nameServers":[{"host":"ns1.xxx.xxx"},{"host":"ns2.xxx.xxx"}]}', // Request Body (type: domain.nameServer.UpdatePayload) ));
But i have this error:
Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error:
POST https://eu.api.ovh.com/1.0/domain/xxxx.xxxx/nameServers/update
resulted in a500 Internal Server Error
response: {"class":"Server::InternalServerError","message":"Internal server error"} inI tried following the official Guzzle guide with no luck...
https://docs.guzzlephp.org/en/latest/request-options.html#json
Is this a bug of the wrapper? Is it fixable, or do you have any hint to workaround this issue with PHP?
I looked around the web but no one seems like trying to update nameservers of their domain with PHP :(
Thank you!