API Requests

Requests to the SO API include a few important components.

Base URL

The SO API base URL is includes the API URL and version number of the API.

https://api.subscriptionsonly.com/{VERSION}

Ensure that the version number is formatted correctly, the below example is not correctly formatted and could result in errors.

https://api.subscriptionsonly.com/100

A correctly formatted base URL will look like the following.

https://api.subscriptionsonly.com/1.0.0

Endpoints and URL Query parameters

The next piece of the URL is the endpoint. The SO API is a RESTful API so these endpoints will stay consistent with each request type and are built to clearly convey meaning to the developer.

https://api.subscriptionsonly.com/{VERSION}/{ENDPOINT}

An example URL with the endpoint included will look like the following.

https://api.subscriptionsonly.com/1.0.0/add-ons

Additionally, some GET requests can make use of URL Query Parameters, more information can be found in the Endpoints section of this documentation. The query parameters should be added to the URL as key value pairs.

https://api.subscriptionsonly.com/1.0.0/add-ons?sort_by=id&sort=DESC

Required Headers

All requests require the correctly formatted HTTP Basic Authorization header. Likewise, all requests must include the Accept header set to application/json. POST and PUT requests also are required to have the Content-Type header set to application/json. Optionally, you may set the SO-Ver header to the version of the API you intend to use, this helps ensure the correct version is targeted.

JSON data

POST and PUT requests require data to be sent as JSON. Currently, JSON is the only supported data type for these requests.