Fetch User Notifications

​

Returns the details of notifications received by a user

For more information about push notifications and payload based on different types of notifications, including platform configurations required to enable push notifications, see Push Notifications. Also, see Notifications and Badges Count for information about various use cases and best practices.

Headers

  • The signature for the API call

  • Advertises which content types the client is able to understand

  • Preferred language

  • Used to authorize the request with access_token. It should be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

  • Set this header to application/json.

  • Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

Body

application/json
  • OAuth client ID provided by the business

  • Number of notifications for which the details are required. By default, a maximum of 10 notifications are returned at once in order of recency.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/api2/mobile/notifications
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/notifications \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "qty": "3"
}'
[
  {
    "id": 22240773,
    "kind": "system",
    "message": "Something to cheer you up!!",
    "created_at": "2016-03-30T01:50:13-05:00",
    "read_at": null,
    "user_survey_id": null
  },
  {
    "id": 22240649,
    "kind": "campaign",
    "message": "Thanks for signing up for the Club. Enjoy your first 25 points on us!",
    "created_at": "2016-03-29T01:38:28-05:00",
    "read_at": null,
    "user_survey_id": null
  },
  {
    "id": 22240545,
    "kind": "system",
    "message": "Thank you for signing up for the Wing Bar. You will receive 25 free points in 24 hours.",
    "created_at": "2016-03-28T01:38:34-05:00",
    "read_at": null,
    "user_survey_id": null
  }
]