Whitelabel Embed

Whitelabel Embed

Whitelabel Embed

The following explains the creation of an embed.

URL : embed/view/{view}?options={options}&auth={auth}&hmac={hmac}

Method : GET

Auth required : YES (HMAC)

Mandatory Params :

KeyTypeValue
viewURL Paramsame as on the UI
optionsURL Paramstringified JSON object (fields see below) without spaces
authURL Paramstringified JSON object (fields see below) without spaces
hmacURL Paramhmac hash of stringified {auth} object
entities{options} fieldlist (array) of entities (only the first one is supported so far)
timezone{options} fieldstring
userId{auth} fieldlist (array) of entities (only the first one is supported so far)
entities{auth} fieldlist (array) of entities (only the first one is supported so far)
validUntil{auth} fieldmillisecond timestamp or ISO Format like "2019-12-31T00:00:00.000Z"

Optional Params

KeyTypeValue
timeGranularityURL ParamOne of: by_minute, by_10_minutes, by_hour, by_day, by_week, by_month. You can use up to 150 divisions, for example, you can query 150 days by day. Default: by_day.

HMAC : For the generation of a HMAC Hash please see: Examples of creating base64 hashes using HMAC SHA256 in different languages or user_hash.md

NodeJS Example :

import crypto from "crypto";

let options = {
    entities: ["k4nkHC4MwMa3NqC7o"],
    timezone: "UTC",
};
let auth = {
    userId: "6SQYokfDH3X8g5pFc",
    entities: ["k4nkHC4MwMa3NqC7o"],
    validUntil: validUntil ? validUntil : +new Date() + 1000 * 60 * 60 * 24 * 7,
};

options = JSON.stringify(options);
auth = JSON.stringify(auth);

const hmac = crypto.createHmac("sha256", "mySuperAwesomeHMACSecret").update(auth).digest("hex");
const params = "options=" + encodeURIComponent(options) + "&auth=" + encodeURIComponent(auth) + "&hmac=" + hmac;

const url = "https://suite.assertiveyield.com/" + "embed/view/ad-units?" + params;
This website uses cookies.   Learn more