Created
July 19, 2016 12:00
-
-
Save deependersingla/fd63f2afeda26f350f473dc249903ea5 to your computer and use it in GitHub Desktop.
PHP CODE
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 | |
<?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\": \"[email protected]\" | |
}, | |
\"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