# Quest evidence overview

> How each quest format collects proof, and the shared request helper the examples use.

Source: https://dashboard.adquest.batriders.ir/docs/quest-evidence · Audience: Developers · Section: Quest evidence

## Prerequisites

- A working integration: participant sessions and a widget or client.
- A quest in the format you want, created in the dashboard and active.
- The public API key, API URL and the user’s participant token.

## How completion works

Every quest ends with a completion request that AdQuest checks on its servers. What you send before it depends on the format.

| Format (API type) | You send | Then |
| --- | --- | --- |
| Video (video) | start, then watch progress, then the answer to the question | complete |
| Time-link (banner) | start, the timer, an optional click, then the answer | complete |
| Survey (survey) | start without a timer, then the answers | complete |
| Quiz (quiz) | start without a timer, then one answer per question; a first miss is asked again at the end | The last right answer completes it. A second miss rejects it. |
| Visit destination (visit) | start, then the visit | complete |
| Verified event (event) | start, then the named event | complete |
| Profile (profile) | the saved profile in a new participant session | complete |
| Referral (referral) | the inviter’s code from the invited friend | complete |
| Streak (streak) | one callback per day from your backend | No complete. The last day settles the quest. |
| Custom (custom) | an event, a callback, a host flag or a review request | complete |
| Multi-step (multi_step) | evidence for each step, sent with its step key | complete, after every required step is verified |

> **Completion is decided on the server.** A callback in your widget is not proof. Grant anything permanent only after the completion result or a signed webhook confirms it.

## The request helper

**Authenticated public API helper**

```typescript
type ApiConfig = { baseUrl: string; apiKey: string; participantToken: string; externalUserId: string; deliveryToken?: string };
export async function questRequest(config: ApiConfig, questId: number, action: string, body: Record<string, unknown> = {}) {
  const response = await fetch(config.baseUrl.replace(/[/]$/, "") + "/platform/quests/" + questId + "/" + action, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-AdQuest-Platform-Key": config.apiKey,
      "X-AdQuest-Participant-Token": config.participantToken,
    },
    body: JSON.stringify({ delivery_token: config.deliveryToken, ...body, external_user_id: config.externalUserId }),
  });
  const result = await response.json();
  if (!response.ok || !result.status) throw new Error(result.message || "Quest request failed");
  return result.data;
}
```

> **Read the settlement.** Use the same platform key, external user id, and participant token as the SDK client. Keep a delivery token from start as config.deliveryToken. Read status, data.completed and the format fields. An accepted request can mean pending review (completed: false). The API does not send a settlement status. Streak days use the generated callback URL, not this helper.

## One page per format

- [Video evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/video): Progress evidence and the question.
- [Time-link / banner evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/time-link): Timer, click and question.
- [Survey evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/survey): Several questions, no timer.
- [Quiz evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/quiz): Graded questions, one at a time.
- [Visit evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/visit): Attribute a visit.
- [Event evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/event): SDK and server events, with signatures.
- [Profile evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/profile): Send the saved profile.
- [Referral evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/referral): Attribute an invited friend.
- [Streak evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/streak): Daily callbacks from your backend.
- [Custom evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/custom): Events, callbacks, host flags and review.
- [Multi-step evidence](https://dashboard.adquest.batriders.ir/docs/quest-evidence/multi-step): Evidence per step, one reward.
- [Multi-step quests guide](https://dashboard.adquest.batriders.ir/docs/multi-step-quests): Start here if multi-step feels complicated.
