I am trying to do a request to get a consumer key. I already have my API key and API secret.
Here is a link to the company’s documentation on their API. This is the page to request the consumer key.
Here is their script to do the request for the consumer key. It is not in PHP and I need it to be in PHP. If I have to I may need to use their JSON example but using PHP encoding I think.
I have started on the PHP script to do the request for the consumer key. I am not sure about how I code the request for the consumer key. Do I do this with JSON or with the post fields. Here is my script.
<?php // PHP CURL TO GET CONSUMER KEY error_reporting(E_ALL); ini_set('display_errors',1); ini_set('error_reporting', E_ALL); ini_set('display_startup_errors',1); error_reporting(-1); // Variables $url = "https://eu.api.ovh.com/auth/?credentialToken=iQ1joJE0OmSPlUAoSw1IvAPWDeaD87ZM64HEDvYq77IKIxr4bIu6fU8OtrPQEeRh"; $apiKey = "sIbir3gYt75JPUnI"; $ch = curl_init($url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authentication: ' . $apiKey )); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS); $response = curl_exec($ch); $result = json_decode($response); print_r($result); ?>