API documentation for working with gifts
Table with field descriptions:
| Field | Type | Required? | Description |
|---|---|---|---|
| id | int | No | Unique gift identifier (required when updating). |
| icon (all languages)_* | string | No | URL to the gift icon, localized for each language (for example, icon_ro, icon_ru, etc.). |
| image (all languages)_* | string | No | URL to the gift image, localized for each language. |
| name (all languages)_* | string | Yes | The name of the gift, localized for each language (for example, name_ro, name_ru, etc.). |
| link (all languages)_* | string | Yes | Information/partner link localized for each language. |
| description (all languages)_* | string | No | Description of the gift, localized for each language. |
| start_time | datetime | Yes | The start date and time of the gift. |
| removal_time | datetime | Yes | The date and time the gift expires. |
| active | boolean | Yes | Whether the gift is active (true/false). |
1. Receiving all gifts
Method: GET
URL: {domain}/external/gift/
Description:
Returns a list of all gifts on the site.
Query example:
GET {domain}/external/gift/
Example answer:
[
{
"id": 1,
"icon_ro": "http://{domain}/media/gift_images/b88e0864-3e94-405c-b23f-5481f009152d.png",
"icon_ru": null,
"icon_en": null,
"icon_uk": null,
"image_ro": "http://{domain}/media/gift_images/52f85402-231b-40ec-b520-a9d5384a3503.png",
"image_ru": null,
"image_en": null,
"image_uk": null,
"name_ro": "Cadou test",
"name_ru": "Test gift",
"name_en": "Test gift",
"name_uk": "Test gift",
"link_ro": "https://www.google.com/",
"link_ru": "https://www.google.com/",
"link_en": "https://www.google.com/",
"link_uk": "https://www.google.com/",
"description_ro": "Descriere test",
"description_ru": "Test description",
"description_en": "Test description",
"description_uk": "Test description",
"start_time": "2025-08-25T09:50:00",
"removal_time": "2025-08-30T10:50:00",
"active": true
}
]
2. Receive one gift
Method: GET
URL: {domain}/external/gift/{id}/
Description:
Returns data for one gift by its unique identifier.
Query example:
GET {domain}/external/gift/1/
Example answer:
{
"id": 1,
"icon_ro": "http://{domain}/media/gift_images/b88e0864-3e94-405c-b23f-5481f009152d.png",
"icon_ru": null,
"icon_en": null,
"icon_uk": null,
"image_ro": "http://{domain}/media/gift_images/52f85402-231b-40ec-b520-a9d5384a3503.png",
"image_ru": null,
"image_en": null,
"image_uk": null,
"name_ro": "Cadou test",
"name_ru": "Test gift",
"name_en": "Test gift",
"name_uk": "Test gift",
"link_ro": "https://www.google.com/",
"link_ru": "https://www.google.com/",
"link_en": "https://www.google.com/",
"link_uk": "https://www.google.com/",
"description_ro": "Descriere test",
"description_ru": "Test description",
"description_en": "Test description",
"description_uk": "Test description",
"start_time": "2025-08-25T09:50:00",
"removal_time": "2025-08-30T10:50:00",
"active": true
}
3. One Gift Update
Method: PUT
URL: {domain}/external/gift/{id}/
Description:
Updates the data of one gift by its unique identifier.
Query example:
PUT {domain}/external/gift/1/
Content-Type: application/json
Request body:
{
"name_ro": "Cadou actualizat",
"description_ro": "Descriere actualizată",
"start_time": "2025-08-26T10:00:00",
"removal_time": "2025-09-01T18:00:00",
"active": false
}
Example answer:
{
"id": 1,
"name_ro": "Cadou actualizat",
"description_ro": "Descriere actualizată",
"start_time": "2025-08-26T10:00:00",
"removal_time": "2025-09-01T18:00:00",
"active": false
}
4. Creating multiple gifts
Method: POST
URL: {domain}/external/gift/bulk-create/
Description:
Creates several gifts at the same time.
Query example:
POST {domain}/external/gift/bulk-create/
Content-Type: application/json
Request body:
[
{
"name_ro": "Cadou nou 1",
"description_ro": "Descriere cadou nou 1",
"start_time": "2025-08-27T10:00:00",
"removal_time": "2025-09-02T18:00:00",
"active": true
},
{
"name_ro": "Cadou nou 2",
"description_ro": "Descriere cadou nou 2",
"start_time": "2025-08-28T09:30:00",
"removal_time": "2025-09-03T19:00:00",
"active": true
}
]
Example answer:
[
{
"id": 2,
"name_ro": "Cadou nou 1",
"description_ro": "Descriere cadou nou 1",
"start_time": "2025-08-27T10:00:00",
"removal_time": "2025-09-02T18:00:00",
"active": true
},
{
"id": 3,
"name_ro": "Cadou nou 2",
"description_ro": "Descriere cadou nou 2",
"start_time": "2025-08-28T09:30:00",
"removal_time": "2025-09-03T19:00:00",
"active": true
}
]
5. Update multiple gifts
Method: PUT
URL: {domain}/external/gift/bulk-update/
Description:
Updates data for multiple gifts at once.
Query example:
PUT {domain}/external/gift/bulk-update/
Content-Type: application/json
Request body:
[
{
"id": 1,
"active": false,
"start_time": "2025-08-25T11:00:00",
"removal_time": "2025-09-01T20:00:00"
},
{
"id": 2,
"active": true,
"start_time": "2025-08-28T08:00:00",
"removal_time": "2025-09-04T21:00:00"
}
]
Example answer:
[
{
"id": 1,
"active": false,
"start_time": "2025-08-25T11:00:00",
"removal_time": "2025-09-01T20:00:00"
},
{
"id": 2,
"active": true,
"start_time": "2025-08-28T08:00:00",
"removal_time": "2025-09-04T21:00:00"
}
]
Was the article helpful?
Yes, thank you! Unfortunately no