# 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                                |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://everyday-digital.gitbook.io/falkor-dev-docs/stories/certificates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
