> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/queries/assessments/display-assessments.md).

# Display Assessments

Assessments are hosted on the domain 'suggestic.assessments.com.' To access them, you must pass the assessment's ID in base64 format as a URL parameter and include a user's [JWT bearer token](/graphql/graphql/authentication.md) in the header.

Optionally, you may send a primary color hex value in the color key like this: `https://assessments.suggestic.com/?assessmentId={{assessment.id}}&color={{hexcolor}}`

### Swift Header Example

```swift
let token = MSession.sharedInstance.session?.token {
headers["Authorization"] = "Bearer \(token)"

```

### Anonymous User Scenario

For an anonymous user, you can include the 'onboarding' parameter in the URL as follows: `https://assessments.suggestic.com/?assessmentId={{assessment.id}}&onboarding=true`

In this scenario, the user's responses won't be stored on the website but will be returned to the container (browser, webview, etc) for management.

### Styling and Customization

| Style                              | Parameter               | Description                                                          |
| ---------------------------------- | ----------------------- | -------------------------------------------------------------------- |
| Primary Color                      | `color={{hexcolor}}`    | Hex color                                                            |
| Back Button                        | `back_button=true`      | Enables display of the back button                                   |
| Supplement Recommendatios Redirect | `results_path={{path}}` | Enables a redirect to a specific path for supplement recommendations |

For additional styling, please reach out to <support@suggestic.com>

### IFrame Use Case and Window Messages

If you're loading an assessment as an iFrame, the page will message the container when the assessment status changes.&#x20;

| Status     | Description                                                                 |
| ---------- | --------------------------------------------------------------------------- |
| `complete` | The user completed the assessment.                                          |
| `close`    | The user clicked on the close button.                                       |
| `exit`     | The user selected an answer that finishes the assessment before completion. |

Please see a code example below.

```
  window.addEventListener('message', (event) => {
      if (event.origin.includes('assessments')) {
        const stringifiedResponse = event.data;
        const response = JSON.parse(stringifiedResponse);
        const { data } = response;
        const { status } = data;
        if (status === 'complete') {
          // quiz is finished
        }

        if (status === 'close') {
          // quiz was closed by the user
        }
      }
    });
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.suggestic.com/graphql/query/queries/assessments/display-assessments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
