🧩 Webhook integration

Accessing Viewst API

To use Viewst API you need 2 public URLs on your side. Authentication one (Auth URL) and another for getting export results (Result Handler URL)

Auth URL

  1. Auth URL should receive request with a pair - login and password and send back an authentication JSON WEB token.

An example of incoming request:

{ 
  "login" : "viewstauthlogin", 
  "password": "viewstauthpassword" 
}

An example of a token:

{ 
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJoaSI6ImZyb20gVmlld3N0LmNvbSIsImlhdCI6MTY1NjkzNzkwOX0.Gq3omKmWCmr3YP_0iG_ADr0dZL5XtZGBFtiTgD_Vlx4" 
}

Important notes:

  • Indicate an origin as viewst.com to allow CORS

  • The access token should be valid forever

Result Handler URL

When the export is successful Viewst sends a POST request for Result Handler URL.

The authorization title contains a token in the form of Bearer ${token} :

Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJoaSI6ImZyb20gVmlld3N0LmNvbSIsImlhdCI6MTY1NjkzNzkwOX0.Gq3omKmWCmr3YP_0iG_ADr0dZL5XtZGBFtiTgD_Vlx4'

The request body contains the export type (exportType)

Export Types:
"banner" - HTML banner 
"png" - PNG banner image 
"jpeg" - JPEG banner image 
"video" - MP4 banner video 
"gif" - GIF banner format 
"collection" - a banner set in case of a bulk export 
"VAST" - VAST banner 
"floatingBanner" 
"floadtingVAST"

The response body also contains a link to the export results ****(resultURL)

A request example:

{ 
  "exportType": "png", 
    "resultURL": "<https://storage.viewst-st.com/4c9f4119-a24b-4c5c-a68a-7ff4ff0a754f/Dog%20Food_6_21_2021_18-53_6_20_2022_12-26.png>" 
}