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 :
Key | Type | Value |
---|---|---|
view | URL Param | same as on the UI |
options | URL Param | stringified JSON object (fields see below) without spaces |
auth | URL Param | stringified JSON object (fields see below) without spaces |
hmac | URL Param | hmac hash of stringified {auth} object |
entities | {options} field | list (array) of entities (only the first one is supported so far) |
timezone | {options} field | string |
userId | {auth} field | list (array) of entities (only the first one is supported so far) |
entities | {auth} field | list (array) of entities (only the first one is supported so far) |
validUntil | {auth} field | millisecond timestamp or ISO Format like "2019-12-31T00:00:00.000Z" |
Optional Params
Key | Type | Value |
---|---|---|
timeGranularity | URL Param | One 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;
Discover helpful resources for deep-dive industry knowledge
Experience faster and more effective assistance with our exclusive AY support
With comprehensive courses and recognizable certificates, take your next steps with us.
Browse an extensive list of industry-related buzzwords and find answers to your questions.
What's new on AY? This collection is an overview of new products and features release in AY tools.