Connatix API

General

Connatix API is an interface that allows clients to connect, login and download predefined reports. 

The following tables lists the formats and conventions used when exchanging data with the API:

Request
Method POST / GET
Target https://console.connatix.com/api/<connatix_api_endpoint>
Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body JSON object (property for each mandatory parameter)

Server responds with HTTP status code and JSON object with extra information in response body.

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body Empty or JSON object

You may encounter the following status codes as a response:

HTTP Status Codes
200 OK Request valid
400 Bad Request

Incomplete or invalid request, required parameters not supplied

401 Unauthorized Invalid credentials or request is missing authorization headers
404 Not Found Server could not find the requested resource

Login

Request
Method POST
Target https://console.connatix.com/api/account/login
Headers  content-type: application/json
Body

JSON object

{  
Username: string, // required  
Password: string, // required  
RememberMe: boolean // optional, default is false
}

In case of success, server's Response has status code 200 OK. ConnatixAuth authorization cookie is supplied in the response headers.

Important: All subsequent requests must include ConnatixAuth in Cookie request header .

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body Empty


EXAMPLE & OUTPUT

curl 'https://console.connatix.com/api/account/Login' -H 'content-type: application/json' --data-binary '{"Username":"demo","Password":"MyAw3550meP@55w0rd"}'

 

HTTP/1.1 200 OK
Set-Cookie: ConnatixAuth=s_Gnr-L7Cv8uUP0nWreE83nVx2ZPmUGiuhhSN3B7VfCFQyBKmIaj-2c9DiLyesLMWTdpoP2sLJOBRgsafdF6TAAOSHAzdddjyhuTLPWqpdAGLIWgvEMN2E5E5HbyN1-DM_MbM4z104x99bJ8T1ttLPqQKqSL5iQoY9nOxaY7wVH94MU6_WjffL8800naQR0_o5aWGAUhYRr41q5LyvJNxRa1L3E71dxykD-TloxMhDtYbkmeXlZMFBSOGhb_UWURe5pYKu3enYsbcE9cc0B4Jruxoy4nvO3i99-oEQ5uqfuqRgUjVihF_cPzHJiiChX430T_pP6Rk4akJ_H0lykBcTMiKgLY14Gw1oT1LhIGufJA_Dfam5JH1I12wnOPxGrX0uMqW7ZWABB3PD9BARIL9ZFbSOz_GT2wUhy6IbY-fflkugdFaSJK42VIwqc0UYc5aPNMGgdudIzHtc5sX3AsO8914-TbNRC79zw00nrz68LNM2bzUervlibFmf5r4ZxO3PfE1A; domain=.connatix.com; path=/; HttpOnly

Report Download

Request
Method GET
Target

https://console.connatix.com/api/reports/download/<id>

<id>: report identifier (required)

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body Empty

In case of success, server's response has status code 200 OK and include in the body a JSON object with last refresh timestamp (formatted as yyyy-MM-ddTHH:mm:ssZ) and an URL for downloading the report as a CSV file.

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body { Timestamp: date string, Url: string}


EXAMPLE & OUTPUT

curl -X GET 'https://console.connatix.com/api/reports/download/12356' -H 'content-type: application/json' -H 'Cookie: ConnatixAuth=s_Gnr-L7Cv8uUP0nWreE83nVx2ZPmUGiuhhSN3B7VfCFQyBKmIaj-2c9DiLyesLMWTdpoP2sLJOBRgsafdF6TAAOSHAzdddjyhuTLPWqpdAGLIWgvEMN2E5E5HbyN1-DM_MbM4z104x99bJ8T1ttLPqQKqSL5iQoY9nOxaY7wVH94MU6_WjffL8800naQR0_o5aWGAUhYRr41q5LyvJNxRa1L3E71dxykD-TloxMhDtYbkmeXlZMFBSOGhb_UWURe5pYKu3enYsbcE9cc0B4Jruxoy4nvO3i99-oEQ5uqfuqRgUjVihF_cPzHJiiChX430T_pP6Rk4akJ_H0lykBcTMiKgLY14Gw1oT1LhIGufJA_Dfam5JH1I12wnOPxGrX0uMqW7ZWABB3PD9BARIL9ZFbSOz_GT2wUhy6IbY-fflkugdFaSJK42VIwqc0UYc5aPNMGgdudIzHtc5sX3AsO8914-TbNRC79zw00nrz68LNM2bzUervlibFmf5r4ZxO3PfE1A'

 

HTTP/1.1 200 OK
{"Url":"https://connatix-reports.s3.amazonaws.com/81F3AB97-745E-48B5-B7A1-556933115B8E.csv?AWSAccessKeyId=ZKIAJ1PM2UCPBTR5Y8RQ\u0026Expires=1495032166\u0026Signature=QGgkWLRLXMXIxIp54LSORGjih60%3D"}

Sites Get

Request
Method GET
Target

https://console.connatix.com/api/ad/getsites

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

Array of site objects

id number
url string
title string

Video Save

Request
Method POST
Target

https://console.connatix.com/api/videos/savevideo

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number required Video identifier. 0 (default)
title string required Video title
description string required Video description
imageURL string required Thumbnail image URL
videoURL string required Video URL
categories [number] optional Array of category identifiers - reference

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Video identifier. 0 (default)
title string Video title
description string Video description
imageURL string Thumbnail image URL
videoURL string Video URL
categories [number] Array of category identifiers - reference
status number Video status
0 Active
1 Inactive
2 Deleted
3 Rejected
encoderJobID string Video encoder job identifier
encoderJobProgress number Video encoder job status
0 waiting
1 pending
2 assigning
3 processing
4 finished
5 failed
6 canceled

Video Get

Request
Method GET
Target

https://console.connatix.com/api/videos/getvideo/<id>

<id>: video identifier (required)

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Video identifier. 0 (default)
title string Video title
description string Video description
imageURL string Thumbnail image URL
videoURL string Video URL
categories [number] Array of category identifiers - reference
state number Video status
0 Active
1 Inactive
2 Deleted
3 Rejected
encoderJobID string Video encoder job identifier
encoderJobProgress number Video encoder job status
0 waiting
1 pending
2 assigning
3 processing
4 finished
5 failed
6 canceled

Videos Get Status

Request
Method POST
Target

https://console.connatix.com/api/videos/getvideostatus

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

Array of objects

id number Video identifier
jobID string Video encoder job identifier

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Video identifier
status number Video status
0 Active
1 Inactive
2 Deleted
3 Rejected
statusReason string Video status messages in case is rejected. Messages separated by column (;)
jobID string Video encoder job identifier
jobProgress number Video encoder job status
0 waiting
1 pending
2 assigning
3 processing
4 finished
5 failed
6 canceled

Playlist Save

Request
Method POST
Target

https://console.connatix.com/api/videos/savelist

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number required Playlist identifier. 0 (default)
name string required Video title
videos [number] required Array of video identifiers

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Playlist identifier
name string Playlist name
videos [number] Array of video identifiers

Add to Playlist

Request
Method POST
Target

https://console.connatix.com/api/videos/addtolist

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number optional, in case name is supplied Playlist identifier.
name string optional, in case id is supplied Playlist name
videos [number] required Array of video identifiers

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Playlist identifier
name string Playlist name
videos [number] Array of video identifiers

Playlist Get

Request
Method GET
Target

https://console.connatix.com/api/videos/getlist/<id>

<id>: Playlist identifier (required)

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Playlist identifier
name string Playlist name
videos [number] Array of video identifiers

Ad Save

Request
Method POST
Target

https://console.connatix.com/api/ad/save

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number required, default 0 Ad identifier, when 0 a new item is created
name string required Ad name
siteId number optional Site identifier
videoContentMode number optional Videos content source
0 My Videos by Category (default)
2 Specific Playlist
playlistId number required Playlist identifier
categories [number] optional Array of category identifiers  - reference
insertPath string required CSS selector
insertPosition number optional DOM position relative to insertPath
0 First (default). Content is rendered on the first position in container specified by insertPath.
-1 Before. Content is rendered before the container specified by insertPath.
-2 After. Content is rendered after the container specified by insertPath.
-3 Replace Contents. Content replaces container's inner contents.
-4 Replace Container. Content fully replaces the container.
videoMode number optional Video Display Mode
0 LightBox (default).
1 Instead of Ad
2 Instead of Ad Image
3 Below Ad
4 Ad In Place
html string required HTML contents
autoplayMode number optional Autoplay Mode
0 No Autoplay (default)
1 Accept Autoplay
2 Only Autoplay
mute boolean optional Mute video, default true
unmuteOnHover boolean optional Play sound when hovering over video, default false

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Ad identifier
token string Ad token

Ad Get

Request
Method GET
Target

https://console.connatix.com/api/ad/get/<id>

<id>: ad identifier (required)

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object with properties

id number Ad identifier
name string Ad name
siteId number Site identifier
videoContentMode number Videos content source
playlistId number Playlist identifier
categories [number] Array of category identifiers  - reference
insertPath string CSS selector
insertPosition number DOM position relative to insertPath
videoMode number Video Display Mode
html string HTML contents
autoplayMode number Autoplay Mode
mute boolean Mute video, default true
unmuteOnHover boolean Play sound when hovering over video, default false

Ad Clone

Request
Method POST
Target

https://console.connatix.com/api/ad/clonead

Headers  content-type: application/json
cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body

JSON object

{  
id: number, // required, ad unit identifier  
name: string, // required, name for the new ad unit  
siteId: number // optional, default is 0, site identifier
}

 

Response
Status  HTTP Status Code
Headers  set-cookie: ConnatixAuth=<connatix_auth_cookie_value>
Body { Success: boolean , Item: string /* GUID token */}


EXAMPLE & OUTPUT

curl -X POST 'https://console.connatix.com/api/ad/clonead' -H 'content-type: application/json' -H 'Cookie: ConnatixAuth=s_Gnr-L7Cv8uUP0nWreE83nVx2ZPmUGiuhhSN3B7VfCFQyBKmIaj-2c9DiLyesLMWTdpoP2sLJOBRgsafdF6TAAOSHAzdddjyhuTLPWqpdAGLIWgvEMN2E5E5HbyN1-DM_MbM4z104x99bJ8T1ttLPqQKqSL5iQoY9nOxaY7wVH94MU6_WjffL8800naQR0_o5aWGAUhYRr41q5LyvJNxRa1L3E71dxykD-TloxMhDtYbkmeXlZMFBSOGhb_UWURe5pYKu3enYsbcE9cc0B4Jruxoy4nvO3i99-oEQ5uqfuqRgUjVihF_cPzHJiiChX430T_pP6Rk4akJ_H0lykBcTMiKgLY14Gw1oT1LhIGufJA_Dfam5JH1I12wnOPxGrX0uMqW7ZWABB3PD9BARIL9ZFbSOz_GT2wUhy6IbY-fflkugdFaSJK42VIwqc0UYc5aPNMGgdudIzHtc5sX3AsO8914-TbNRC79zw00nrz68LNM2bzUervlibFmf5r4ZxO3PfE1A' --data-binary '{"id":"9876", "name": "Clone Example", "siteId":"123"}'

 

HTTP/1.1 200 OK
{ "Success": "true" , "Item": "d41323e2-279d-4450-9cb8-cebb67ce8d88"}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.