# Time Limited Event

This endpoint is used to handle various time-limited event actions such as adding weekly event points and starting new weekly events for players.

#### URL

`https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/TimeLimitedEvent/[action]`

#### Common Request Parameters (JSON body)

* `args` (IGSRequest): The request arguments containing required data for processing.

#### Common Responses

* `200 OK`: Operation successful. Returns a JSON object with the result.
* `400 Bad Request`: Improper request parameters. Returns an error message, e.g., "Invalid request args.".

## AddWeeklyEventPoints

Purpose: Adds points to the player's weekly event.

**URL**

`https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/TimeLimitedEvent/AddWeeklyEventPoints`

**Request Parameters (JSON body)**

* `args.FunctionParameter` (FunctionParameters): The parameters to add points to the weekly event.
  * `Points` (int): The points to add to the user's weekly event.

**Responses**

* `200 OK`: Points successfully added. Returns a success message.
* `400 Bad Request`: Incorrect parameters or player data issues. Possible messages: "args is null", "playerEventData is null".

**Example Usage**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/TimeLimitedEvent/AddWeeklyEventPoints', {  
    method: 'POST',  
    headers: {  
        'Content-Type': 'application/json'  
    },  
    body: JSON.stringify({  
        args: {  
            FunctionParameter: {  
                Points: 100  
            }  
        }  
    })  
})  
.then(response => response.json())  
.then(data => console.log(data))  
.catch(error => console.error('Error:', error))  
```

**Response:**

```json
{  
    "Message": "SUCCESS"  
}  
```

## StartNewWeeklyEventForPlayer

Purpose: Starts a new weekly event for the player.

**URL**

`https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/TimeLimitedEvent/StartNewWeeklyEventForPlayer`

**Request Parameters (JSON body)**

* `args` (IGSRequest): The request arguments containing the necessary data.

**Responses**

* `200 OK`: Successfully started a new weekly event. Returns a success message or rewards granted message.
* `400 Bad Request`: Incorrect parameters or server errors. Possible messages: "Title public config is null", "Failed to update custom user data".

**Example Usage**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/TimeLimitedEvent/StartNewWeeklyEventForPlayer', {  
    method: 'POST',  
    headers: {  
        'Content-Type': 'application/json'  
    },  
    body: JSON.stringify({  
        args: {  
            UserID: 'user-id'  
        }  
    })  
})  
.then(response => response.json())  
.then(data => console.log(data))  
.catch(error => console.error('Error:', error))  
```

**Response:**

```json
{  
    "Message": "SUCCESS"  
}  
```


---

# 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/time-limited-event.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.
