Why do I get this response on OVH API?
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Why do I get this response on OVH API?

by
FazooA
Created on 2021-08-28 11:01:30 (edited on 2024-09-04 14:23:27) in General Chat

I'm trying to use the OVH API to allow me to create a new domain. So I got the Application Key (AK) the Application Secret (AS) and the Consumer Key (CK) for "GET/" "PUT/" "POST/" and "DELETE/".

Here is the code that I'm trying to use:

$client = new Api($this->applicationKey, $this->applicationSecret, $this->apiEndpoint, $this->consumerKey);

$result = $client->post('/domain/zone/' . $this->zoneName . '/record', [
'fieldType' => 'A',
'subDomain' => $subdomain,
'target' => $elementIp,
'ttl' => 0,
]);

$client->post('/domain/zone/' . $this->zoneName . '/refresh');
In this code $subdomain and $elementIp are strings. jbbatteryportugal.com/
Now the problem is that when I try this I receive this response: {"message":"This call has not been granted","httpCode":"403 Forbidden","errorCode":"NOT_GRANTED_CALL"}

Can someone let me know what I do wrong please ?

EDIT: I finaly found my problem. I use docker and when I changed the AK, AS and CK I didn't restart the container. Now it works very well.


Replies are currently disabled for this question.