GET /offers/{id}
GET /offers/{id}
API to get all details for displaying a specific offer to collectors and the general public. This API has limited query paramenter as this is accessing a specific offer resource.
Path Parameter
Name | Rquired | Type | Discription |
---|---|---|---|
id | ✔️ | UUID (single value) | Returns the offer detail associated with this id |
Query Parameter
Name | Rquired | Type | Discription |
---|---|---|---|
region | ✔️ | String (single value) | Will only show offers from a single region |
Headers
Name | Rquired | Type | Discription |
---|---|---|---|
X-Correlation-Id | UUID | This is used to track the request through the logs, if not provided it will be auto generated by API and returned in the header response | |
X-Origin-Client | ✔️ | String | This field is to let us know where the request is coming from. ie: internal:amrp:postman , external:web:bmo |
Accept-Language | String - Locale | This is let API know if you want the response back in some supported language. Allowed value: en-US , fr-CA |
Authenticated
To make authenticated request you need an additional header. The tokens that are supported are member
tokens, these tokens have an associated collecter specification.
Name | Rquired | Type | Discription |
---|---|---|---|
Authorization | Bearer {token} | Specifies a collector when making call to this api. This will give the ability to see the offers states for the collector |
Response
The response has two main section offers
and warning
.
The warning object has two states depending on region query parameter, authentication header and offer id passed:
"warning":null
OR
"warning": {
"errorCode": "String - errCodes",
"message": "String"
}
Error Code
name | Offer Returned | description |
---|---|---|
err-login-required | YES | When viewing a targetted offer without any authorization header |
err-region | YES | When viewing an offer that does not match the region query parameter in the request |
err-not-found | NO | Offer Id does not exist, Offer Id not valid |
err-expired | NO | Offer is expired |
err-not-live | NO | Future offer, Not live yet (current date < display start date) |
err-exclusive | NO | Targeted Offer - Collector is not eligible for the Offer |
lets talk about some key information thats returned to us in the offer objects (for full list of values retuned, check out Sample Response) :
Name | Type | Discription |
---|---|---|
id | UUID | Offer object ID |
partnerId | UUID | Associated partner id |
categoryId | UUID | Associated category id |
awardShort | String | description of the award associated with offer |
qualifierShort | String | Short description of what is needed to qualify for offer award |
displayDate | LocalDateTime | When can this offer show up for collectors |
startDate | LocalDateTime | When can this offer be avalilable for use by collectors. Usually same as displayDate |
endDate | LocalDateTime | When can this offer be marked as expired so that no more collectors are able to see/use it |
massOffer | Boolean | true = Offer is publicly avaliable, false = Offer is targeted to specific collectors. |
tiers | List<tier> | Offers can have multiple qualifers and each can have a different award |
mechanisms | List | How to qualify for the offer |
states | List<States> | Authenticated Request Only, Will give a list of states which are object showing the name, value and when it was updated |
legalText | String | Legal copy for offer |
Sample
Request
GET /offers/4a80ad4a-de28-4c77-8180-0a89a71f4a55?region=ON HTTP/1.1
Host: cdn.airmilesapis.ca
X-Origin-Client: internal:amrp:postman
Authorization: Bearer `TOKEN`
Response Body
{
"offer": {
"id": "4a80ad4a-de28-4c77-8180-0a89a71f4a55",
"partnerId": "3267588b-791d-49bc-a321-d85d5f818480",
"partnerLabel": "AIR MILES",
"partnerLogo": {
"url": "https://dev.cdn.airmilesapis.ca/partner-logo/7m10wxejlkq7/69ZErUapt6c8WQioe6iYSS/5107f862d6a2b238ff6f7739c5a90992/AIRMILES_PLANE_ELECTRIC_BLUE_RGB_E.png"
},
"partnerProfileURL": "https://www.airmiles.ca/en/offers/partners/air-miles-reward-program-bonus-offers.html",
"categoryId": "121fa2dd-1fab-4492-8c5d-fb34624f4dda",
"categoryLabel": "Travel",
"awardShort": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierShort": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*",
"image": {
"url": "https://s3.amazonaws.com/prod-l1-amrpwl-post-images/processed-images/4008e08c-cd46-4429-bdc6-ce763cf4731a"
},
"displayDate": "2024-05-07T00:00:00",
"startDate": "2024-05-07T00:00:00",
"endDate": "2024-05-26T23:59:59",
"description": "Contest ends May 26, 2024. Must be 18 years or older to enter. No purchase necessary. Contest Rules apply. ",
"programType": "traditionalcore",
"massOffer": true,
"eventBasedOffer": false,
"displayPriority": 1000,
"tiers": [
{
"awardLong": "You could win a Walt Disney World vacation from AIR MILES®",
"qualifierLong": "Enter with your Collector info. Plus, earn 4 extra entries when you book any trip with AIR MILES® Travel.*"
}
],
"mechanisms": [
{
"mechanismType": "button",
"mechanismLabel": "Enter now",
"mechanismValue": "https://www.airmiles.ca/arrow/Splash?splashId=26100080&changeLocale=en_CA"
}
],
"states": [
{
"name": "OPT_IN",
"value": "OPTED_IN",
"updatedAt": "2024-04-29T13:56:09.083363Z"
},
{
"name": "SAVE",
"value": "SAVED",
"updatedAt": "2024-04-29T13:56:09.082147Z"
}
],
"legalText": "The Contest runs from May 6, 2024 to May 26, 2024 and is open to Canadian resident AIR MILES® collectors who have reached the age of 18. *NO PURCHASE NECESSARY Collectors can visit https://airmiles.ca/magicalmemories\nto complete and submit the form and get 1x entry. To get 4 additional entries collectors must book any trip on AIR MILES Travel during the contest period and complete their trip by July 31, 2024 (or complete the alternative bonus entry method outlined in the full contest rules). Limit one (1) base entry and four (4) bonus entries per collector number. One (1) prize is available to be won consisting of a vacation for four (4) to the Walt Disney World Resort in Florida. Approximate Prize value is $10,219.00 USD ($13,285.00 CDN). Correctly answered math skill-testing question required upon selection as a potential winner. Odds of winning depend on the number of eligible entries received. For full contest rules and details, visit https://airmiles.ca/magicalmemories\n\n®™ Trademarks of AM Royalties Limited Partnership used under license by AIR MILES Loyalty Inc.\n"
},
"warning": null
}
Response Header
X-Correlation-Id | a7b3b6a8-f033-4e78-804e-f1990f317515 |
For support its best to keep track of the X-Correlation-Id
value, as that can be used to track down logs for this request.