API Publisher Help
Documentation for the public Publisher API
Gunnar Militz
Last Update 3 years ago
✔️ Auth
Requests to this API requires a JWT Authentication Token. You need to have a Publisher account on mcanism and it's credentials to generate a token. Your token will have access to all and only the resources your account on mcanism has access to. Please follow the following flow to obtain a token.
Make a POST https://api.skynet.mcanism.com/rest-auth/login/ request with the following JSON payload (with the appropriate Content-Type header)
✔️ The shape of expected response to the request should look like:
You can find your JWT token in the token property of the response JSON. To authenticate your API requests from here on out, you will have to add a header to the request with the key Authorization and it's value set to JWT [YOU TOKEN].
✔️ AdSpaces
To get a list of all the AdSpaces you have in your account, make a GET request to
✔️ Campaigns
To get a list of all the available campaigns and your adspace approvals for them, make a GET
request to https://api.skynet.mcanism.com/api/v1/publisher/campaigns/ . To apply to a campaign,
you can make a POST request to https://api.skynet.mcanism.com/api/v1/publisher/campaigns/apply/
with the following JSON body:
Some fields to note in the response of the campaign list API are:
- default_target_url_display : The display link for the campaign.
- default_tracking_url : The tracking url for the default ad in campaign. This field can be null, it can happen in situations for example, if don't have access to this feature or if you don't have at least one accepted AdSpace for the Campaign.
- currency : The currency for the campaign. It is always EUR at the moment.
- targeted_countries : The list of countries this campaign is targeted towareds. It returns an array of ISO ALPHA-2 country codes.
- category_info : The category that the campaign falls under/targets.
✔️ Advertisements
To get a list of all the available advertisements for a campaign, you can make a GET request to
https://api.skynet.mcanism.com/api/v1/publisher/advertisements/?offer={CampaignID} . This endpoint
also supports getting a list of all the advertisements if you omit the offer query parameter.
✔️ Creating Tracking Link
To create a tracking link for a specific advertisement, you can make a POST request to
https://api.skynet.mcanism.com/api/v1/publisher/advertisements/links/ with the following body:
✔️ Tracking Link Parameters
You can add custom parameters and deeplink parameter to a tracking link and save that
preference using the parameters endpoint. To get a list of all your parameters for a given
campaign and media combination, you can make a GET request to
https://api.skynet.mcanism.com/api/v1/publisher/advertisements/links/parameters/?offer={CampaignID}&media={AdSpaceID}
. To add a new parameter to the combination, you can make a POST request to the
https://api.skynet.mcanism.com/api/v1/publisher/advertisements/links/parameters/ endpoint with
the following body:
The valid parameter names are:
✔️ Reports
Click Report: Make a GET request to https://api.skynet.mcanism.com/api/v1/publisher/clicks/
.
Performance Report: Make a GET request to
https://api.skynet.mcanism.com/api/v1/publisher/performance/ .
Transaction Report: Make a GET request to
https://api.skynet.mcanism.com/api/v1/publisher/transactions/ .
The following parameters can be used to apply date ranges:
💬 transaction_saved_after : Include only transactions which are saved after a specified date-time
💬 transaction_saved_before : Include only transactions which are saved before a specified date-time
These parameters accepts timestamps in the following format:
💬 YYYY-MM-DDTHH:MM:SS.ssssssZ
For example, 13:45 on the 2nd June 2020 will look like: 2020-06-02T13:45:00.000000Z