Get edition link

Headers are set up according to Authentification pre-requisite specifications.

In order to edit a project, you need to access the Adways Studio. This example allows you to get a link via a HVProject id.

The generated link has a durability and a maximum connection count. The aim of this link is to authentificate the user on our platform before redirecting him to the Adways Studio.

You have to pass a HVProject id to the EndPoint, in post parameter.

On success, this request returns an edit link (an access to the Adways Studio).

    // Get cURL resource
    $curl = curl_init();

    // Server EndPoint
    $url = 'https://services.adways.com/hv-create-edit-link';

    $method = 'POST';

    $fields = array();
    $fields['id'] = $hvProject_id;

    $options = array();
    $options[CURLOPT_RETURNTRANSFER] = 1;
    $options[CURLOPT_URL] = $url;
    $options[CURLOPT_SSL_VERIFYPEER] = false;
    $options[CURLOPT_POST] = 1;

    if(!empty($fields)) $options[CURLOPT_POSTFIELDS] = json_encode($fields);

    curl_setopt_array($curl, $options);

    // $access_token: your access token, from your platform
    // X-Token-Provider: to identify the source of the given token
    $headers = array();
    $headers[] = 'Authorization: Bearer ' . $access_token;
    $headers[] = 'X-Token-Provider: '. $tokenProviderConstant;

    curl_setopt($curl,CURLOPT_HTTPHEADER, $headers);


    // Send the request & save response to $response
    $response = json_decode(curl_exec($curl), true);

    // Save Curl Info request
    $curlInfos = curl_getinfo($curl);

    // Close request to clear up some resources
    curl_close($curl);

    $editRedirect = null;

    if($curlInfos['http_code'] == 200 && isset($response['link']) && $response['link']!=null ) {
            $editRedirect = $response['link'];
    }

For more information: API HVProject