Advertisement
Guest User

Untitled

a guest
May 5th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. $url = 'https://www.exacttargetapis.com/contacts/v1/contacts';
  3. $json = '{
  4. "contactKey": "test@example.com",
  5. "attributeSets": [{
  6. "name": "Email Addresses",
  7. "items": [{
  8. "values": [{
  9. "name": "Email Address",
  10. "value": "test@example.com"
  11. }]
  12. }]
  13. }]
  14. }';
  15.  
  16. $options = array(
  17. 'http' => array(
  18. 'header' => "Content-Type: application/jsonrn" .
  19. "Accept: application/jsonrn" .
  20. "Authorization: Bearer " . $access_token . "rn",
  21. 'method' => 'POST',
  22. 'content' => http_build_query($json)
  23. )
  24. );
  25. $context = stream_context_create($options);
  26. $result = file_get_contents($url, false, $context);
  27.  
  28. if ($result === FALSE) { echo "Result not returned"; }
  29. print_r($result);
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement