# Chest

## GetCommonChestReward

&#x20;

**URL**

```javascript
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetCommonChestReward  
```

&#x20;

**Description**

This action retrieves the reward from a common chest.<br>

**HTTP Method**

* POST<br>

**Request Body (JSON)**

```javascript
{  
    "WebAppLink": "string",  
    "UsageTime": "int",  
    "ClientSessionTicket": "string",  
    "EntityToken": "string",  
    "UserID": "string"  
}  
```

&#x20;

**Response Codes**

* `200 OK`: Returns the ID of the reward item granted.
* `400 Bad Request`: Possible error messages:
  * `INVALID_REQUEST_ARGS`
  * `INVALID_ACTION`
  * `INCORRECT_TITLE_ID_OR_STATUS_INACTIVE`
  * `INCORRECT_ACTION`
  * `INCORRECT_USER_ID`<br>

**Example Usage**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetCommonChestReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        WebAppLink: 'https://example.com/?titleID=0',    
        UsageTime: 120,    
        ClientSessionTicket: 'valid-session-ticket',    
        EntityToken: 'valid-entity-token',    
        UserID: 'user-id'    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

### &#x20;

&#x20;

## GetRareChestReward

&#x20;

**URL**

```javascript
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetRareChestReward  
```

&#x20;

**Description**

This action retrieves the reward from a rare chest.<br>

**HTTP Method**

* POST<br>

**Request Body (JSON)**

```javascript
{  
    "WebAppLink": "string",  
    "UsageTime": "int",  
    "ClientSessionTicket": "string",  
    "EntityToken": "string",  
    "UserID": "string"  
}  
```

&#x20;

**Response Codes**

* `200 OK`: Returns the ID of the reward item granted.
* `400 Bad Request`: Possible error messages:
  * `INVALID_REQUEST_ARGS`
  * `INVALID_ACTION`
  * `INCORRECT_TITLE_ID_OR_STATUS_INACTIVE`
  * `INCORRECT_ACTION`
  * `INCORRECT_USER_ID`<br>

**Example Usage**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetRareChestReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        WebAppLink: 'https://example.com/?titleID=0',    
        UsageTime: 120,    
        ClientSessionTicket: 'valid-session-ticket',    
        EntityToken: 'valid-entity-token',    
        UserID: 'user-id'    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

### &#x20;

&#x20;

## GetLegendaryChestReward

&#x20;

**URL**

```javascript
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetLegendaryChestReward  
```

&#x20;

**Description**

This action retrieves the reward from a legendary chest.<br>

**HTTP Method**

* POST<br>

**Request Body (JSON)**

```javascript
{  
    "WebAppLink": "string",  
    "UsageTime": "int",  
    "ClientSessionTicket": "string",  
    "EntityToken": "string",  
    "UserID": "string"  
}  
```

&#x20;

**Response Codes**

* `200 OK`: Returns the ID of the reward item granted.
* `400 Bad Request`: Possible error messages:
  * `INVALID_REQUEST_ARGS`
  * `INVALID_ACTION`
  * `INCORRECT_TITLE_ID_OR_STATUS_INACTIVE`
  * `INCORRECT_ACTION`
  * `INCORRECT_USER_ID`<br>

**Example Usage**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Chest/GetLegendaryChestReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        WebAppLink: 'https://example.com/?titleID=0',    
        UsageTime: 120,    
        ClientSessionTicket: 'valid-session-ticket',    
        EntityToken: 'valid-entity-token',    
        UserID: 'user-id'    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

### &#x20;


---

# 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://docs.idosgames.com/api/api-v1/chest.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.
