Skip to content

Commit

Permalink
Document new campaigns endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbmaier committed Dec 24, 2024
1 parent cdab797 commit 9ca2ef4
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
89 changes: 89 additions & 0 deletions docs/live/campaigns/campaigns-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
name: Get seasonal campaigns (v2)

url: https://live-services.trackmania.nadeo.live
method: GET
route: /api/campaign/official?length={length}&offset={offset}

audience: NadeoLiveServices

parameters:
query:
- name: length
type: integer
description: The number of campaigns to retrieve
required: true
- name: offset
type: integer
description: The number of campaigns to skip (looking backwards from the current campaign)
required: true
---

Gets official seasonal campaigns.

---

**Remarks**:

- This endpoint serves the same purpose as the [Get seasonal campaigns](/live/campaigns/campaigns) endpoint, but the response data model is slightly different.

---

**Example request**:

```plain
GET https://live-services.trackmania.nadeo.live/api/campaign/official?offset=0&length=1
```

**Example response**:

```json
{
"itemCount": 18,
"campaignList": [
{
"id": 77963,
"seasonUid": "402f721f-65ca-4975-9eb0-afa753561a8a",
"name": "Fall 2024",
"useCase": 0,
"clubId": 0,
"startTimestamp": 1727794800,
"endTimestamp": 1735747200,
"rankingSentTimestamp": null,
"year": -1,
"week": -1,
"day": -1,
"monthYear": -1,
"month": -1,
"monthDay": -1,
"playlist": [
{
"id": 926443,
"position": 0,
"mapUid": "rw7jr8WlTrYor0vN0A0PiKzgg78"
},
...
{
"id": 926467,
"position": 24,
"mapUid": "End5ikYJa8pgN8RI347E6l4i7lg"
}
],
"editionTimestamp": 1727082440
}
],
"nextRequestTimestamp": 1735747200,
"relativeNextRequest": 704811
}
```

If the campaign does not exist, the response will show an empty list:

```json
{
"itemCount": 18,
"campaignList": [],
"nextRequestTimestamp": 1735747200,
"relativeNextRequest": 704825
}
```
8 changes: 8 additions & 0 deletions docs/live/campaigns/campaigns.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ parameters:
required: true
---

<div class="notification is-warning">

This endpoint is deprecated and may be removed in the future. It's recommended to use the [v2 route](/live/campaigns/campaigns-v2) instead.

</div>

Gets official campaigns.

---

**Example request**:

```plain
GET https://live-services.trackmania.nadeo.live/api/token/campaign/official?offset=7&length=1
```

**Example response**:

```json
{
"itemCount": 9,
Expand Down

0 comments on commit 9ca2ef4

Please sign in to comment.