state-reader/GET

Used to return only the opted-in/saved offers from a list of submitted offers.
GET /offers/state-reader/v1/get

Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.

Used to return only the opted-in/saved offers from a list of submitted offers. This is used to label which offers a Collector has opted-into/saved when displaying a full page of offers (which would includes both opted-in and non opted-in offers).

Sample request

curl -X GET 
  https://uat.airmilesapis.ca/offers/state-reader/v1/get?offerId=951d9a70-4cf8-41b1-a01e-7953f069f527&offerId=e32f35ad-3d32-439d-94db-8c36a40ddbd1&offerId=ebaa71b8-40d4-48dc-95e6-824dfffa1c4c \
  --header 'Content-Type: application/json' \
  --header 'x-correlation-id: bcf529ae-0de0-4ded-90f5-e050ce2df0e3' \
  --header 'x-origin-client: external:partner:web' \
  --header 'x-local-time: 2020-05-30T23:59:59' \
  --header 'Authorization: Bearer LQoD0gWJK7l9znrmsGksWxbvIEx9a8zXkw...' \
  --data-raw ''

Request headers

Header Description
Content-Type Indicates the media type of the resource.
x-correlation-id The unique ID for tracing the request across the system.
x-origin-client Name of the Client and Channel.
x-local-time Local time of the client, excluding the timezone.

Query parameters

Parameter Description
offerId The unique offer ID’s for all offers submitted.

Sample response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 29 Oct 2018 15:27:34 GMT
{
    "offers": [
        {
            "offerId": "951d9a70-4cf8-41b1-a01e-7953f069f527",
            "collectorId": "80000000110",
            "states": [
                {
                    "name": "OPT_IN",
                    "value": "OPTED_IN",
                    "properties": {},
                    "updatedAt": "2021-07-07T20:55:26.276917Z"
                },
                {
                    "name": "SAVE",
                    "value": "SAVED",
                    "properties": {},
                    "updatedAt": "2021-07-07T20:55:26.276825Z"
                }
            ]
        },
        {
            "offerId": "e32f35ad-3d32-439d-94db-8c36a40ddbd1",
            "collectorId": "80000000110",
            "states": [
                {
                    "name": "OPT_IN",
                    "value": "OPTED_IN",
                    "properties": {},
                    "updatedAt": "2021-05-31T16:33:26.201783Z"
                },
                {
                    "name": "SAVE",
                    "value": "SAVED",
                    "properties": {},
                    "updatedAt": "2021-05-31T16:33:26.201759Z"
                }
            ]
        }
    ],
    "requestedCount": 3,
    "returnedCount": 2
}

Response properties

Parameter Description
offerId The unique ID for the offers returned by the find call.
collectorId The Collector’s AIR MILES account number. (Must be 11 digits in length and must start with an 8)
states The opt-in/saved status of the offers found for an individual Collector.

Response codes

Code Description
200 Request Successful
400 Bad Request
401 Unauthorized
404 Record Not Found
500 Internal Server Error