General Chat - Problem api post renew domain
Answers to your questions / General Chat / Problem api post renew domain
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.
Frage

Problem api post renew domain

Von
ClaudioS
Erstellungsdatum 2020-11-04 12:52:12 (edited on 2024-09-04 14:22:53) in General Chat

Hello, I have a problem with the ovh api, I would like to integrate in our CRM the possibility of renewing domains directly using the API, following the guides I am trying this script to renew the service linked to a domain but I receive an error.

{"message":"[services] ServiceId Data is not an array for an array type"}

require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

$ovh = new Api( $applicationKey,
$applicationSecret,
$endpoint,
$consumer_key);

//$result = $ovh->get('/service/14991863/renew', array(
// 'includeOptions' => false, // Include service's option(s) (type: boolean)
//));

try {
$result = $ovh->post('/service/14991863/renew', array(
'dryRun' => false, // Indicates if renew order is generated (type: boolean)
'duration' => 'P1Y', // Renew duration (type: string)
'services' => '[14991863]', // List of services to renew (type: long[])
));
} catch (GuzzleHttp\Exception\ClientException $e) {
$response = $e->getResponse();
$responseBodyAsString = $response->getBody()->getContents();
echo $responseBodyAsString;
}


Antworten sind derzeit für diese Frage deaktiviert.