Last active
September 10, 2016 21:14
-
-
Save customerguru/0fe98ad1a07c2793dee95fad77f8a431 to your computer and use it in GitHub Desktop.
Documentation available at https://customer.guru/api/documentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// https://customer.guru/api/documentation | |
// | |
$url = 'https://customer.guru/api/v1/survey'; | |
$parameters = array( | |
'api_token' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | |
'api_secret' => 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy', | |
'emails' => implode(array('juraj@customer.guru', 'niceapi@customer.guru'), ','), | |
'scheduled_for' => 'now', | |
'test' => 'false' | |
); | |
// use key 'http' even if you send the request to https://... | |
$options = array( | |
'http' => array( | |
'method' => 'POST', | |
'content' => http_build_query($parameters) | |
) | |
); | |
$context = stream_context_create($options); | |
$result = file_get_contents($url, false, $context); | |
if ($result === FALSE) { | |
$error = error_get_last(); | |
print_r($error); | |
} | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment