# Make verify request

{% hint style="info" %}
**Requirement** You are required to show empowered by RE:DREAMER if you used our protocol in any part of your product.
{% endhint %}

![empowered white](https://404850448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdDk4AHKGlMLAZPnf2hJ6%2Fuploads%2Fgit-blob-a3abbbcf5d962d5d3e023b94ddb4605b9d5f8ab9%2Fempowered_white.png?alt=media) ![empowered black](https://404850448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdDk4AHKGlMLAZPnf2hJ6%2Fuploads%2Fgit-blob-62d97745c570b2d5b1e2b8a045587597af1e9b3d%2Fempowered_black.png?alt=media)

## Domain

* Mainnet: `mainnet-api.redreamer.io`
* Testnet: `testnet-api.redreamer.io`

## POST /api/v1/passport/:network/campaigns/:uuid/validate

Validate a QR code content.

### QR Code Content

There is a prefix `REDREAMER:` at the beginning of content for quickly identification and then follow by a base64 encoded JSON object.

```
REDREAMER:{base64(JSON object)}
```

JSON object format example:

```json
{
    "campaign_id": "a55df1fe-6bfe-40f6-9977-79d22970cbb7",
    "campaign_uuid": "a55df1fe-6bfe-40f6-9977-79d22970cbb7",
    "contract_address": "0xc5056d906640f89f31ba6eff5e893a1c1e7b0b32",
    "hash": "b677e329-68de-4adb-8c62-8592e1bbf233",
    "network": "polygon",
    "requester_address": "0x85b7ca161c311d9a5f0077d5048cadface89a267",
    "token_id": 2
}
```

### Request Parameters

* \[Required] `network`: the network of campaign (now only support `eth` and `polygon`)
* \[Required] `uuid`: campaign's uuid.

### Reqeust Body

```json
{
	"requester_address": "0x85b7ca161c311d9a5f0077d5048cadface89a267",
	"contract_address": "0xc5056d906640f89f31ba6eff5e893a1c1e7b0b32",
	"token_id": 2,
	"hash": "b677e329-68de-4adb-8c62-8592e1bbf233",
	"validator": "Optional"
}
```

### Request Headers

```json
{
	"X-API-Key": "8AetTdcKwtrOvZJcPLI5VP2qxL70_kQ9Pkn6SNECrwo="
}
```

> We provide an api key - `8AetTdcKwtrOvZJcPLI5VP2qxL70_kQ9Pkn6SNECrwo=` in testnet.

### Response

#### 200

```json
{
    "id": "a55df1fe-6bfe-40f6-9977-79d22970cbb7",
    "uuid": "a55df1fe-6bfe-40f6-9977-79d22970cbb7",
    "network": "polygon",
    "name": "RE:DREAMER TESTING EVENT",
    "description": "WELCOME TO TEST.",
    "validated_description": "Redeemed Description will displayed on PASSPORT QR code page.",
    "redeemed_description": "Validated Description can be displayed after validated.",
    "image_url": "https://passport-testnet.redreamer.io/static/media/logo.9f58bcc2.svg",
    "contract_addresses": [
        "0xc5056d906640f89f31ba6eff5e893a1c1e7b0b32"
    ],
    "start_time": "2022-10-02T16:00:00Z",
    "end_time": "2024-11-30T15:59:59Z",
    "created_at": "2022-10-03T07:33:37.703613Z",
    "updated_at": "2022-10-03T07:33:37.703613Z",
    "deleted_at": "0001-01-01T00:00:00Z"
}
```

#### 400, 500

```json
{
	"code": "ERROR_CODE"
}
```

### Error Code

* `PASSPORT_CAMPAIGN_NOT_FOUND`: campaign not found.
* `PASSPORT_NETWORK_MISMATCH`: network mismatch.
* `EXCEED_MAXIMUM_PASSPORT_REDEMPTION`: out of redemption's limit.
* `NOT_TOKEN_OWNER`: user is not token owner.
* `INVALID_PASSPORT_CAMPAIGN`: invalid campaign.
* `QR_CODE_EXPIRED`: QR code is expired.
* `INVALID_QR_CODE`: QR code is invalid.

### Test information

This QR code created in testnet and it can be verified unlimited times.

![Testnet QR code](https://404850448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdDk4AHKGlMLAZPnf2hJ6%2Fuploads%2Fgit-blob-70488d86b00b2de44cb56b01d391842896abe84c%2Ftestnet-qr-code.png?alt=media)

####
