Deem Offers API Documentation

Subscriptions

List all user’s subscriptions

Returns an array of subscription representations.

GET /users/:user_id/subscriptions
GET /users/:user_email/subscriptions

Parameters

count (optional)
Boolean Returns the count instead of the list. If present, per_page and page will be ignored.
per_page (optional)
Integer Limits the size of the list. Default is 100. Max is 1000.
page (optional)
Integer Returns the list corresponding to the page number if the result cannot be displayed in a single page. Default is 1.

Response

Status: 200 OK
{
  "status": "success",
  "subscriptions": [
    {
      "id": "8170788d7e",
      "user_id": "995ce579",
      "status": "active",
      "confirmed": false,
      "region_id": "san-francisco",
      "region_name": "San Francisco",
      "zip": "94111",
      "created_at": "Fri Dec 16 18:42:37 UTC 2011",
      "source": null
    }
  ]
}

Get a subscription

Returns a serialized representation of the subscription.

GET /subscriptions/:subscription_id

Response

Status: 200 OK
{
  "status": "success",
  "subscription": {
    "id": "8170788d7e",
    "user_id": "995ce579",
    "status": "active",
    "confirmed": false,
    "region_id": "san-francisco",
    "region_name": "San Francisco",
    "zip": "94111",
    "created_at": "Fri Dec 16 18:42:37 UTC 2011",
    "source": null
  }
}

Create a subscription

POST /users/:user_id/subscriptions

Parameters

zip
Integer
Status: 200 OK
{
  "status": "success",
  "subscription": {
    "id": "8170788d7e",
    "user_id": "995ce579",
    "status": "active",
    "confirmed": false,
    "region_id": "san-francisco",
    "region_name": "San Francisco",
    "zip": "94111",
    "created_at": "Fri Dec 16 18:42:37 UTC 2011",
    "source": null
  }
}

Update a subscription

PUT /subscriptions/:subscription_id

Parameters

status
String Can be “active” or “inactive”.

Response

Status: 200 OK
{
  "status": "success",
  "subscription": {
    "id": "8170788d7e",
    "user_id": "995ce579",
    "status": "active",
    "confirmed": false,
    "region_id": "san-francisco",
    "region_name": "San Francisco",
    "zip": "94111",
    "created_at": "Fri Dec 16 18:42:37 UTC 2011",
    "source": null
  }
}