Skip to content

Instantly share code, notes, and snippets.

@ryanquinlan
Last active February 13, 2019 18:40
Show Gist options
  • Save ryanquinlan/b38ae5d01ea1aa009cf6c393ac64df6d to your computer and use it in GitHub Desktop.
Save ryanquinlan/b38ae5d01ea1aa009cf6c393ac64df6d to your computer and use it in GitHub Desktop.
cms api getting started
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://*SERVER_ADDRESS*/api/v1/userProfiles");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$pass = base64_encode("*apiuser@domain*:*password*");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Basic ".$pass
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
HTTP/1.1 200 OK
Date: Wed, 13 Feb 2019 18:21:15 GMT
Server: Apache
X-Frame-Options: DENY
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: text/xml
Content-Length: 76
Vary: Accept-Encoding
Connection: close
HTTP/1.1 404 Not Found
Content-Length: 0
Content-Security-Policy: script-src 'self'
Content-Type: application/json; charset=utf-8
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Xss-Protection: 1; mode=block
Date: Wed, 13 Feb 2019 12:20:19 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment