Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Subscriptions to activities

MaurICT edited this page May 22, 2020 · 7 revisions

Get subscriptions

GET /api/subscriptions

Parameters

Query string withActivity (bool) (optional): If true, return subscriptions with activity. If false, only return the subscription and leave activity null

Query string withFactured (bool) (optional): Include factured (or paid) subscriptions.

Query string after (optional): Get all activities after this date/time. Format: yyyy-MM-dd or yyyy-MM-dd'T'HH:mm:ss

Example response:

{
    "status": "success",
    "count": 1,
    "subscriptions": [
        {
            "activity": null,
            "eventID": 24,
            "factured": false,
            "drinksCost": 1.50,
            "friendCount": 0
        }
    ]
}

Add subscription to an activity

POST /api/subscriptions/add

Parameters

Form data eventId (required): The activity you want to subscribe to

Form data friendCount (optional): The amount of friends. Default is 0

Example request:

POST /api/subscription/add HTTP/1.1
Host: https://stoverstag.nl
Content-Type: application/x-www-form-urlencoded (You can also use multipart/form-data)
Content-Length: 24

eventId=25&friendCount=1

Example response:

{
   "status": "success",
   "subscription" : {
      ...
   }
}

Remove subscription from an activity

POST /api/subscriptions/remove

Parameters

Form data eventId (required): The activity you want to unsubscribe from

Example request:

POST /api/subscription/remove HTTP/1.1
Host: https://stoverstag.nl
Content-Type: application/x-www-form-urlencoded (You can also use multipart/form-data)
Content-Length: 10

eventId=25

Example response:

{
   "status": "success"
}