New user Registration

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

Adways user has to be declared before using any EndPoint.

This request needs an Auth id (unique user id from your platform, the same that will be returned by your platform when we will retrieve informations about the given token), a last_name, a first_name, and your client credentials (provided by Adways).

Upon success, you will get an Adways user id.

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

    // Server EndPoint
    $url = 'https://services.adways.com/create-profile-from-auth-id';

    $method = 'POST';

    $fields = array();
    $fields['first_name'] = $first_name;
    $fields['last_name'] = $last_name;
    $fields['client_id'] = $client_id;
    $fields['client_secret'] = $client_secret;
    $fields['auth_id'] = $auth_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);

    $adways_user_id = null;

    if($curlInfos['http_code'] == 201) {
            $adways_user_id = $response['id'];
    }

For more information: API UserManager