# Spin

Purpose: Handles client spin actions and returns appropriate rewards based on the type of spin requested.

#### URL

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/{action}  
```

#### Method

```
GET, POST  
```

#### Request Parameters

| Name            | Type   | Description                                                                                                                                            |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| titleTemplateId | string | The template ID of the title.                                                                                                                          |
| titleId         | string | The ID of the title.                                                                                                                                   |
| action          | string | The requested spin action (e.g., GetFreeSpinReward, GetStandardSpinReward, GetPremiumSpinReward, GetSecondarySpinReward, GetSecondarySpinRewardForVC). |
| req (body)      | JSON   | The request body containing spin parameters.                                                                                                           |

#### Request Body (JSON)

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

#### Responses

| Code            | Description                                                                                                     |
| --------------- | --------------------------------------------------------------------------------------------------------------- |
| 200 OK          | Returns a JSON object containing the spin reward or appropriate message.                                        |
| 400 Bad Request | Returns an error message indicating invalid input or action (e.g., "Invalid request args.", "Invalid action."). |

####

## GetFreeSpinReward

Purpose: Handle requests for free spin rewards.

Example Usage:

Request:

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/GetFreeSpinReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        "WebAppLink": "https://example.com",  
        "UsageTime": 120,  
        "UserID": "exampleUserID",  
        "ClientSessionTicket": "validSessionTicket",  
        "EntityToken": "validEntityToken"  
    })   
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));    
```

Response:

```json
{  
    "reward": "reward details"  
}  
```

## GetStandardSpinReward

Purpose: Handle requests for standard spin rewards.

Example Usage:

Request:

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/GetStandardSpinReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        "WebAppLink": "https://example.com",  
        "UsageTime": 150,  
        "UserID": "exampleUserID",  
        "ClientSessionTicket": "validSessionTicket",  
        "EntityToken": "validEntityToken"  
    })   
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));    
```

Response:

```json
{  
    "reward": "reward details"  
}  
```

## GetPremiumSpinReward

Purpose: Handle requests for premium spin rewards.

Example Usage:

Request:

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/GetPremiumSpinReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        "WebAppLink": "https://example.com",  
        "UsageTime": 200,  
        "UserID": "exampleUserID",  
        "ClientSessionTicket": "validSessionTicket",  
        "EntityToken": "validEntityToken"  
    })   
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));    
```

Response:

```json
{  
    "reward": "reward details"  
}  
```

## GetSecondarySpinReward

Purpose: Handle requests for secondary spin rewards.

Example Usage:

Request:

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/GetSecondarySpinReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        "WebAppLink": "https://example.com",  
        "UsageTime": 100,  
        "UserID": "exampleUserID",  
        "ClientSessionTicket": "validSessionTicket",  
        "EntityToken": "validEntityToken"  
    })   
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));    
```

Response:

```json
{  
    "reward": "reward details"  
}  
```

## GetSecondarySpinRewardForVC

Purpose: Handle requests for secondary spin rewards using virtual currency.

Example Usage:

Request:

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Spin/GetSecondarySpinRewardForVC', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        "WebAppLink": "https://example.com",  
        "UsageTime": 90,  
        "UserID": "exampleUserID",  
        "ClientSessionTicket": "validSessionTicket",  
        "EntityToken": "validEntityToken"  
    })   
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));    
```

Response:

```json
{  
    "reward": "reward details"  
}  
```


---

# 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/spin.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.
