Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = 'http://snd.dev/app_dev.php/api/rest/email-list/contacts-batch/update';
- $accessToken = 'MzUxMTNhN2E5YjRhN2E1NWM5NTU4ZDRhZDc5M2YzNTE=';
- $data = json_encode([
- 'emailListId' => '5853a843f015272a0442c1b1',
- 'contacts' => [
- [
- 'email' => "aion.planet.com@gmail.com",
- 'parameters' => [
- 'name' => "test1",
- 'email' => "eve.planet.com@gmail.com",
- 'variables' => [
- [
- 'name' => "var1",
- 'value' => "aion.planet.com@gmail.com",
- ],
- ],
- ],
- ],
- [
- 'email' => "eve.planet.com@gmail.com",
- 'parameters' => [
- 'name' => "test2",
- 'variables' => [
- [
- 'name' => "var2",
- 'value' => "eve.planet.com@gmail.com",
- ],
- ],
- ],
- ],
- ],
- ]);
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, [
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data),
- sprintf('access-token: %s', $accessToken),
- ]);
- var_dump(curl_exec($ch));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement