> For the complete documentation index, see [llms.txt](https://docs.idosgames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idosgames.com/api/api-v1/chest.md).

# 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;
