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

# 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"  
}  
```
