Méthodes disponibles
Permet de gérer les consentements des customers.
...
Si POST ok alors
Code Block | ||||
---|---|---|---|---|
| ||||
"consent": { "id": 9876, "techName": "NewsEmail", "customer": { "id": "123456", "trackId": "1000", "customerConsentCreatedAt": "2O18-06-30", "customerConsentStatus": "accepted" } } |
...
Exemple d'appel PHP :
Code Block | ||||
---|---|---|---|---|
| ||||
$curl_post_data = array( 'consent' => array( "id" => 21925, "createdAt" => "2O18-06-30", "ip" => "1.1.1.1" # pas obligatoire ) ); $curl_post_data = json_encode($curl_post_data); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://social-sb.com/api/v2/customers-consents/123456"); curl_setopt($curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); //// Auth avec la clé publique et la clé privée (voir dans Paramétrage > Tracker) curl_setopt($curl, CURLOPT_USERPWD, "clef_public:clef_privee"); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data ); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_return = curl_exec($curl); var_dump($curl_return); curl_close($curl); |
...