Authorization and Authentication
To use the DailyStory REST API you will first need an API token. To create an API token login to DailyStory and then go to Account Settings > API Tokens
:

From here you can click the "+ Create new" to generate a new token or revoke existing tokens.
RecommendedAs a best practice, we recommend creating separate tokens for each application integrated with DailyStory.
Using the API Token in a Request
All requests made to the DailyStory API require 2 pieces of information:
- API end point - the end point of the API and it is unique to the instance of DailyStory your app is running on.
- Request Authorization - request authorization is achieved by including the API token with the request.
API End Point
Use of the API requires you to use a specific data center identifier (or instance identifier) when making an API request. When logged in to DailyStory this can be determined by examining the URL.
For example, https://us-1.dailystory.com uses the us-1
data center. Whereas https://uk-3.dailystory.com uses the uk-3
data center.
All API requests are made using the URL that includes your data center, e.g. https://us-1.dailystory.com/api/v1/about. In this example, us-1 is the data center. DailyStory's application centers are provided regionally.
Request Authorization
The DailyStory API requires that all API requests are made over HTTPS and is authenticated using either a bearer token (preferred) basic authentication (supported) in the Authorization HTTP header.
Bearer Token
Using API token as a bearer token is this recommended and simplest way to work with the DailyStory API. Simply set your Authorization header to "Bearer [your api token]".
For example, if your API token is: sp2r7s6zvq2pkvgwosgu92xuw-us-1
The Authorization header for bearer authentication would look as follows:
GET request example
POST request example
Basic Authentication
ImportantBasic Authentication is supported, but Bearer authentication is recommended.
If you are using Basic authentication there are additional steps required.
Basic Authentication requires:
- A username and a password. Use
api
as the username. - The username and password to be concatenated with a colon separating them, e.g.
api:sp2r7s6zvq2pkvgwosgu92xuw-us-1
. - The concatenated string of username and password must be base 64 encoded.
Below is the base 65 encoded string for api:sp2r7s6zvq2pkvgwosgu92xuw-us-1
YXBpOnNwMnI3czZ6dnEycGt2Z3dvc2d1OTJ4dXctdXMtMQ==
The Authorization header for basic authentication would then look as follows:
In the examples below the username and password are base 64 encoded automatically when using curl.
GET request example
POST request example
API Response
The API will always respond with a JSON response. Even in the case of errors. Typically the API response will be wrapped in a Response object. For example, a request to list all campaigns end-point returns and array of campaign objects:
The Status, along with the HTTP status code, indicates if the request was processed successfully. If an error occurred, the Message will contain details about the error.
The Response may contain multiple values.