Skip to content

Instantly share code, notes, and snippets.

@deependersingla
Created July 19, 2016 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deependersingla/fd63f2afeda26f350f473dc249903ea5 to your computer and use it in GitHub Desktop.
Save deependersingla/fd63f2afeda26f350f473dc249903ea5 to your computer and use it in GitHub Desktop.
PHP CODE
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.accredible.com/v1/credentials");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{
\"credential\": {
\"recipient\": {
\"name\": \"John Doe\",
\"email\": \"person@example.com\"
},
\"name\": \"Credential Name\",
\"cohort_name\": \"PM- Participation\",
\"description\": \"A detailed description of what the credential is for\",
\"issued_on\": \"2014-06-14\"
}
}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Token token=XYZ"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment