> For the complete documentation index, see [llms.txt](https://everyday-digital.gitbook.io/falkor-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://everyday-digital.gitbook.io/falkor-dev-docs/stories/certificates.md).

# Certificates

The `logs/story-certificates` endpoint retrieves certificates awarded to users on stories.

## &#x20;Parameters

All parameters are optional and if none are provided all stories, users and groups will be called.

|            |                                |
| ---------- | ------------------------------ |
| **Key**    | **Type**                       |
| **app**    | String (ID or name of app)     |
| **story**  | String (ID or name of stories) |
| **groups** | Array String (name of group)   |
| **users**  | Array String (name or email)   |

&#x20;

## Example

The example below fetches user certificates for stories listed in the `stories` parameter.

```
curl -X POST \
  v1/logs/story-certificates \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
    "story" : "Story A"
  }'
```

## Success Response

A successful response will return an array of `story` + `certificates` items.

```
{
    "status": "success",
    "data": [
        {
            "story": {
                "name": "Story A",
                "type": "Story",
                "ID": "EV72-RQZY-80AH"
            },
            "certificates": [
                {
                    "firstname": "User",
                    "lastname": "One",
                    "email": "user.one@example.com",
                    "telephone": "",
                    "country": "United Kingdom",
                    "city": "London",
                    "certificate": {
                        "timestamp": "2021-09-28T11:14:23+02:00",
                        "state": "delivered",
                        "url": "<certificate URL>"
                    }
                },
                ...etc
            ]
        },
        {
            "story": {
                "name": "Story B",
                "type": "Story",
                "ID": "EV72-RQZY-80AH"
            },
            "certificates": [
                {
                    "firstname": "User",
                    "lastname": "One",
                    "email": "user.one@example.com",
                    "telephone": "",
                    "country": "United Kingdom",
                    "city": "London",
                    "certificate": {
                        "timestamp": "2021-09-28T11:14:23+02:00",
                        "state": "delivered",
                        "url": "<certificate URL>"
                    }
                },
                ...etc
            ]
        },
        ..etc
    ],
    "hash": "5cd3375ed2d332ca1f3cc840242c4419",
    "response_time": 0.3598060607910156
}
```

### Story + Certificates item

|                  |                                         |
| ---------------- | --------------------------------------- |
| **Key**          | Type                                    |
| **story**        | Object                                  |
| **story.ID**     | String                                  |
| **story.name**   | String                                  |
| **story.type**   | Enum (story, assessment, survey, scorm) |
| **certificates** | Array of certificate items              |

### Certificate Item

The certificate item will contain user information and a certificate object.

|                           |                                       |
| ------------------------- | ------------------------------------- |
| Key                       | Type                                  |
| **firstname**             | String                                |
| **lastname**              | String                                |
| **email**                 | String                                |
| **telephone**             | String                                |
| **country**               | String                                |
| **city**                  | String                                |
| **certificate**           | Object                                |
| **certificate.url**       | String (Permalink of the certificate) |
| **certificate.state**     | Enum (pending, delivered)             |
| **certificate.timestamp** | String                                |
