API

Written By Valor Quest

Last updated 9 months ago

๐Ÿ“˜ Overview

With the Valor Quest API we can make sure that the user has successfully registered or has performed other verification logic operations in the application.

To check: Just get the API key through support and send the user's telegram ID and verify type to our address.

Note: Please keep the API key properly. If you forget it, please contact us to get it again.

Base URL: https://valorquest.org/api/v1

Authentication

All requests require an API access token.

๐Ÿ“ฎ API Endpoint

Endpoint: POST /task/verify

๐Ÿ“ค Request Format

{
    "api_key": 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    "tg_user_id": ['1234567'],
    "v_type": 1
}

๐Ÿ“Œ Parameters

Parameter

Type

Required

Description

api_key

String

Yes

API access token

tg_user_id

String[]

Yes

Telegram user ids

v_type

Integer

Yes

Verify type

๐Ÿ“Œ VerifyType

V_Type

Description

1

Whether the user has created a game account

2

Whether the user's battle soul level has reached level 5

...

...

๐ŸŒŸ Example Request

Using fetch (POST):

const response = await fetch('https://valorquest.org/api/v1/task/verify', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
        api_key: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        tg_user_id: ['1234567'],
        v_type:1
    }),
});

const data = await response.json();

api_key โ€“ your token received from us

tg_user_id โ€“ telegram user id

v_typeโ€“ verify type

๐Ÿ“ฅ Response

โœ…

{
    "status": 200,
    "message":"success",
    "tgIds":['12345678'] // Array of tgids verified by the task
}

โŒ

{
    "status": 401,
    "message": "Api key verification failed"
}

โš ๏ธ Error Codes

Status Code

Description

400

Missing/Invalid required parameters

401

Invalid api key

500

Business errors, such as user not found, etc.

๐Ÿ”’ Security Tips

  • Always use HTTPS

  • Keep your api secret