Publicly download a diploma file using GET with a token. Does not require API authentication.
Use the token from the diploma list endpoint to download without API credentials.
For every API request you make, you'll need to present the API access key in the HTTP Header as X-API-Key to be authenticated.
| Name | Required | Value | Description |
|---|---|---|---|
| token | required | string | Public access token (obtained from the diplomas list endpoint) |
$request_url = 'https://api.frontcore.com/v2/public/course-users/:id/diplomas/:diplomaId/download';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-API-Key: {your-api-key}',
'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
If the method is successful it responds with an JSON structure, as it is shown below.
{
"error": "Missing token."
}
Unsuccessful response sample:
{
"error": "Missing token."
}