Download OpenAPI specification:Download
Official API Reference for Easypromos REST API version 2.0. It follows standard openapi 3.1.0
The Easypromos API allows you to perform some of the operations that you do with our web client. The API is built using REST principles which ensures predictable URLs that make writing applications easy. The API follows HTTP rules, enable a wide range of HTTP clients can be used to interact with the API.
(*)API REST is only available with White Label and Corporate plans.
A list of promotions
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "organizing_brand": {
- "id": 1,
- "name": "My organizing brand"
}, - "promotion_type": 0,
- "title": "string",
- "internal_ref": "string",
- "description": "string",
- "status": "draft",
- "timezone": "America/Chicago",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "default_language": "amh",
- "created": "2019-08-24T14:15:22Z",
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
A single promotions
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "id": 1,
- "organizing_brand": {
- "id": 1,
- "name": "My organizing brand"
}, - "promotion_type": 0,
- "title": "string",
- "internal_ref": "string",
- "description": "string",
- "status": "draft",
- "timezone": "America/Chicago",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "default_language": "amh",
- "created": "2019-08-24T14:15:22Z",
}
Access to the list of the organizing brands of an Easypromos account. All promotions belong to an Organizing Brand.
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of organizing brands
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "name": "My organizing brand"
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
A single Organizing Brand
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "id": 1,
- "name": "My organizing brand"
}
status | string Default: "all" Status of the promotion
| ||||||||||
order | string Default: "created_desc" Order results based on the creation date
| ||||||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of promotions
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "organizing_brand": {
- "id": 1,
- "name": "My organizing brand"
}, - "promotion_type": 0,
- "title": "string",
- "internal_ref": "string",
- "description": "string",
- "status": "draft",
- "timezone": "America/Chicago",
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "default_language": "amh",
- "created": "2019-08-24T14:15:22Z",
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
segments | string Returns the stages that require the specified segment. Use the segment reference. You can filter by multiple segments by separating their references with a comma. | ||||||
active | boolean Default: false Returns stages that are currently active based on their dates. |
A list of stages
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "name": "string",
- "description": "string",
- "type": 1,
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "visible": true,
- "meta_data": "{'latitude':'41.98311','longitude':'2.82493'}"
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
A single participation stage in a promotion
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "id": 1,
- "name": "string",
- "description": "string",
- "type": 1,
- "start_date": "2019-08-24T14:15:22Z",
- "end_date": "2019-08-24T14:15:22Z",
- "visible": true,
- "meta_data": "{'latitude':'41.98311','longitude':'2.82493'}"
}
status | string Default: "all" Filter results based on the status of the user
| ||||||||
order | string Default: "created_desc" Order results based on the creation date
| ||||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of users
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
A single registered in a promotion
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}
A login token of a user registered in a promotion
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB"
}
Use this API call to assign one or multiple segments to a user.
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint |
segments required | Array of strings List of segments to assign to the user. The segments must be already created in the promotion, organizing brand or the account. Insert the Reference field of the segment. Use them to create participation rules based on user segments. More information about segments. |
Valid assignation.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "segments": [
- "premium",
- "new_account"
]
}
{- "status": 1
}
Use this API call to remove one or multiple segments from a user.
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint |
segments required | Array of strings List of segments to remove from the user. The segments must be already created in the promotion, organizing brand or the account. Insert the Reference field of the segment. More information about segments. |
Remove action successful.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "segments": [
- "premium",
- "new_account"
]
}
{- "status": 1
}
The autologin path allows sending and registering users in a promotion directly from an external system like a mobile app or website. This path describes the autologin api call from the server side. Autologin api calls from client side (browswer) are also supported from an alternative method; refer to to the documentation. Autologin full documentation.
external_id required | string [ 1 .. 255 ] characters The External ID is the unique identifier of a user. The value can be a string or a number. Easypromos always treats it as a string and converts any numeric value into a string. An External ID should be static. If possible, this should be the same value you use to identify the user in your own system. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
first_name | string [ 2 .. 255 ] characters Optional. User's first name. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
last_name | string [ 2 .. 255 ] characters Optional. User's last name. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nickname | string [ 2 .. 200 ] characters Optional. User's nickname. It is recommended if you don't want to pass the real first and last name. It must be unique among all participants. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string <email> Optional. User's email address. Add the user's email if you want to send automatic emails from the promotion (example - to say thank you, to send a coupon, etc). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
phone | string [ 2 .. 30 ] characters Optional. User's phone number. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
country | string = 2 characters ^[A-Z]{2}$ Optional. User's country code. Format ISO 3166 Alpha-2 (See list of country codes) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
segments | Array of strings Optional. List of segments that the user belongs to. It can belong to one or many (Do not send this field, if you don't use segments or the user belongs to none). The segments must be already created in the promotion, organizing brand or the account. Insert the Reference field of the segment. Use them to create participation rules based on user segments. More information about segments. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
language | string Specifies the language of the user. This value must correspond to one of the languages defined in the promotion. If the provided language does not exist within the promotion, the system will automatically set the user's language to the default language of the promotion.
|
The user logged in to the promotion successfully. It returns a user Login Token
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "external_id": "4ed790c6-17eb-4ec3-a3b9-d8834bc74501",
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith79",
- "email": "john.smith@example.com",
- "phone": "1-345-897-345",
- "country": "UK",
- "segments": [
- "premium",
- "new_account"
], - "language": "amh"
}
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "registered": "true",
- "user_id": 1
}
Webhook triggered when registering a new user: the information of a new user who registers in the promotion will be sent in a HTTP POST Request to the URL of the webhook. In case the user has to confirm the email address to register, the webhook will be sent as soon as the users have validated their email. This webhook is ideal for receiving information from registered users in real time and inserting them into a CRM or user management system.
You can configure the URL of the webhook from the integrations menu of the promotions management page. Tutorial to enable a webhook in a promotion.
required | object (UserFull) Full entity of the user. It includes all the registration data of the participant of a promotion, including the additional properties and metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
webhook_key | string or null Returns the webhook key that was inserted when creating the webhook. Use it for security to verify that the request comes from Easypromos. |
Your server returns this code if it accepts the callback
Unauthorized access
Resource not found
{- "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}, - "webhook_key": "string"
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. | ||||||
format | string Default: null Format of the response.
|
A list of participations
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "promotion_id": 1,
- "stage_id": 1,
- "user_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/201.0.429950705 Mobile/15E148 Safari/604.1",
- "points": 786.43,
- "data": [
- {
- "ref": "Question1",
- "title": "Pick your favorite city",
- "values": [
- "Barcelona"
]
}
]
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of participations
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "promotion_id": 1,
- "stage_id": 1,
- "user_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/201.0.429950705 Mobile/15E148 Safari/604.1",
- "points": 786.43,
- "data": [
- {
- "ref": "Question1",
- "title": "Pick your favorite city",
- "values": [
- "Barcelona"
]
}
]
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
A single participation
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "id": 1,
- "promotion_id": 1,
- "stage_id": 1,
- "user_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/201.0.429950705 Mobile/15E148 Safari/604.1",
- "points": 786.43,
- "data": [
- {
- "ref": "Question1",
- "title": "Pick your favorite city",
- "values": [
- "Barcelona"
]
}
], - "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}, - "prize": {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
}
}
Use this API call to send a code to validate for a chance to enter a participation stage. The participation stage must have the code validation requirement enabled. If the code is valid, you will get a URL to participate.
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint |
code required | string [ 1 .. 255 ] The code that the participant is submitting to participate |
Valid code. The response includes the URL to participate.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "code": "string"
}
Use this API call to create a participation for a registered user in a participation stage. One user's available participation will be used, and the response may include a prize. This call is recommended to participate in promotions based on Instant Win via API. This call is available for the following types of participation stages:
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint | ||||||||
object or null If the participation stage has a requirement, you must post a requirement object. Currently, only the "validate a code" requirement is supported. Do not include this field if the stage does not have a requirement. | |||||||||
|
Participation created successfully. The response can include a prize.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "requirement": {
- "type": "code",
- "data": "XDBAACODE"
}
}
{- "participation_id": 0,
- "available_participations": 0,
- "prize": {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
}
}
Webhook triggered when registering a new participation from a user: the specific information of a user 's participation will be sent in a HTTP POST Request to the URL of the webhook. For example, the information of the prize won by a user when spinning a prize wheel, or discovering a prize in the Reveal and Win, or the points obtained by a user in a game will be sent. You can configure the URL of the webhook from the integrations menu of the promotions management page. Tutorial to enable a webhook in a promotion.
required | object (Participation) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | object (UserFull) Full entity of the user. It includes all the registration data of the participant of a promotion, including the additional properties and metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object (Prize) Prize entity. It represents a unit of a prize assigned to a user. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
webhook_key | string or null It returns the webhook key that was inserted when creating the webhook subscription. Use it as a security measure to verify that the request comes from Easypromos. If the user has won a prize in this participation, a Prize object will be included. |
Your server returns this code if it accepts the callback
Unauthorized access
Resource not found
{- "participation": {
- "id": 1,
- "promotion_id": 1,
- "stage_id": 1,
- "user_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/201.0.429950705 Mobile/15E148 Safari/604.1",
- "points": 786.43,
- "data": [
- {
- "ref": "Question1",
- "title": "Pick your favorite city",
- "values": [
- "Barcelona"
]
}
]
}, - "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}, - "prize": {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
}, - "webhook_key": "string"
}
prize_type_id | integer <int32> List of promotion prizes filtered by prize type ID | ||||||
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of prizes with the information of the user who won
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
- "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of prizes
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
Webhook triggered when a user wins a prize: When a user wins a prize, a webhook will be triggered. The prize details and specific winner information will be sent via an HTTP POST request to the webhook URL. This occurs in various scenarios, such as spinning a prize wheel, discovering a prize in Reveal and Win, or redeeming virtual coins for prizes. You can configure the URL of the webhook from the integrations menu of the promotions management page. Tutorial to enable a webhook in a promotion.
required | object (Prize) Prize entity. It represents a unit of a prize assigned to a user. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | object (UserFull) Full entity of the user. It includes all the registration data of the participant of a promotion, including the additional properties and metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
webhook_key | string or null It returns the webhook key that was inserted when creating the webhook subscription. Use it as a security measure to verify that the request comes from Easypromos. |
Your server returns this code if it accepts the callback
Unauthorized access
Resource not found
{- "prize": {
- "id": 1,
- "prize_type": {
- "id": 1,
- "name": "An awesome prize name 1",
- "ref": "prize1",
- "description": "string",
- "assignation_type": 1,
- "qty": 1,
- "instructions": "string"
}, - "user_id": 1,
- "stage_id": 1,
- "participation_id": 1,
- "created": "2019-08-24T14:15:22Z",
- "code": "DISCOUNT-CODE-XX334ZM87",
}, - "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}, - "webhook_key": "string"
}
It returns the current balances of the user for each coin. It returns an array because promotions can be multicurrency.
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "coins": [
- {
- "id": 1,
- "name": "Points",
- "balance": 560,
- "user_id": 1
}
]
}
Use this API call to update the virtual coin balance of a user in a promotion.
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint |
balance required | integer <int32> [ -99999 .. 99999 ] Balance of the virtual coin to be set for the user. |
reason required | string or null The reason or purpose for the coin balance update. |
If the transaction is successful, it returns the current balances of the user for each coin. It returns an array because promotions can be multicurrency.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "balance": 5,
- "reason": "Update balance to sync with loyalty program"
}
{- "coins": [
- {
- "id": 1,
- "name": "Points",
- "balance": 560,
- "user_id": 1
}
]
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of virtual coin transactions
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "id": 1,
- "user_id": 1,
- "promotion_id": 1,
- "coin_id": 1,
- "coin_name": "Points",
- "amount": 5,
- "balance": 5,
- "created": "2019-08-24T14:15:22Z",
- "transaction_type": 1,
- "reason": "Earned for participating in a stage",
- "extra": "string"
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
order | string Default: "created_desc" Order results based on the creation date
| ||||||
next_cursor | integer or null <int32> Default: null Pagination cursor to go to the next page. The Paging object of the response includes the total number of items in the current page, and the next cursor if available. |
A list of virtual coin transactions
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Rate limit. Too many requests.
Unexpected error
{- "items": [
- {
- "transaction": {
- "id": 1,
- "user_id": 1,
- "promotion_id": 1,
- "coin_id": 1,
- "coin_name": "Points",
- "amount": 5,
- "balance": 5,
- "created": "2019-08-24T14:15:22Z",
- "transaction_type": 1,
- "reason": "Earned for participating in a stage",
- "extra": "string"
}, - "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}
}
], - "paging": {
- "next_cursor": null,
- "items_page": 100
}
}
Use this API call to add or remove virtual coins to a user in a promotion.
lt required | string <= 255 characters The participant's User Login Token that identifies the participant's open session. You can open a participant session and get the User Login Token by sending a request to the /users/autologin endpoint |
amount required | integer <int32> [ -99999 .. 99999 ] Amount of the transaction: an integer. Positive if the user earns virtual coins, negative if the user spends or uses them. |
reason required | string or null The reason or purpose for the coin transaction. |
If transaction is successful, it returns the registered transaction.
The operation could not be completed
Unauthorized. Authentication token not valid.
Forbidden.
The specific resource was not found.
Unsupported Media Type. Content-type HTTP Header missing or is not application/json.
Rate limit. Too many requests.
Unexpected error
{- "lt": "$5$dGF3emr9XUTj6FtE$63PmeiKorJpSEGsd5vN2Lrlxguvo1cE7KTXB",
- "amount": 5,
- "reason": "External event - Purchase"
}
{- "transaction": {
- "id": 1,
- "user_id": 1,
- "promotion_id": 1,
- "coin_id": 1,
- "coin_name": "Points",
- "amount": 5,
- "balance": 5,
- "created": "2019-08-24T14:15:22Z",
- "transaction_type": 1,
- "reason": "Earned for participating in a stage",
- "extra": "string"
}
}
Webhook for virtual coin transactions: This webhook triggers whenever a user earns or spends virtual coins. The transaction data, including details of the amount earned or spent and the user's information, will be sent via an HTTP POST request to the specified webhook URL. You can configure the URL of the webhook from the integrations menu of the promotions management page. Tutorial to enable a webhook in a promotion.
required | object (VirtualCoinTransaction) Virtual Coin Transaction entity. It represents a transaction with virtual coins in a promotion related to a user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required | object (UserFull) Full entity of the user. It includes all the registration data of the participant of a promotion, including the additional properties and metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
webhook_key | string or null It returns the webhook key that was inserted when creating the webhook subscription. Use it as a security measure to verify that the request comes from Easypromos. |
Your server returns this code if it accepts the callback
Unauthorized access
Resource not found
{- "transaction": {
- "id": 1,
- "user_id": 1,
- "promotion_id": 1,
- "coin_id": 1,
- "coin_name": "Points",
- "amount": 5,
- "balance": 5,
- "created": "2019-08-24T14:15:22Z",
- "transaction_type": 1,
- "reason": "Earned for participating in a stage",
- "extra": "string"
}, - "user": {
- "id": 1,
- "promotion_id": 1,
- "first_name": "John",
- "last_name": "Smith",
- "nickname": "jsmith",
- "login_type": "email",
- "social_id": "string",
- "external_id": "string",
- "status": 0,
- "email": "user@example.com",
- "phone": "string",
- "birthday": "2019-08-24",
- "created": "2019-08-24T14:15:22Z",
- "language": "ara",
- "country": "FR",
- "custom_properties": [
- {
- "id": 1,
- "title": "Postal code",
- "ref": "postalcode",
- "value": "PC98776"
}
], - "meta_data": {
- "utm_source": "instagram",
- "utm_medium": "ads",
- "utm_campaign": "campaign-week1",
- "ip": "192.168.0.1",
- "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
- "legals": {
- "accepted_cookies": 1
}
}
}, - "webhook_key": "string"
}