Quick reference

Activation

Endpoint

POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>pygration<span class="token punctuation">.</span>leaddesk<span class="token punctuation">.</span>com<span class="token operator">/</span>leadapps_proxy<span class="token operator">/</span>api<span class="token regex">/activate/</span>

Request Body

Config Object: Page

{
    "height":700,
    "location":
    "dashboard",
    "name":
    "My Lead App Name",
    "sandbox":
    "allow-forms allow-popups",
    "url":
    "https://www.example.com/my/lead/app"
}
  • height: the height of the iframe that loads the app in pixels.
  • name: the lead app name. This is mandatory.
  • location: where the lead app will be loaded, which differs depending on the activation type. Location must be one of the following values: dashboard, statistics, campaigns, agents_mng, calling_list_management, product, b2b_mng, qatab, inbound, general_settings. This is mandatory.
  • url: the app URL. This is mandatory.
  • sandbox: the iframe sandbox attributes. Multiple values could be sent separated by space. Values: allow-forms, allow-pointer-lock, allow-popups, allow-same-origin, allow-scripts, allow-top-navigation.
Config Object: Page Block
<span class="token punctuation">{</span>
    <span class="token string">"height"</span><span class="token punctuation">:</span> <span class="token number">300</span><span class="token punctuation">,</span>
    <span class="token string">"location"</span><span class="token punctuation">:</span> <span class="token string">"campaign-editor"</span><span class="token punctuation">,</span>
    <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My Lead App Name"</span><span class="token punctuation">,</span>
    <span class="token string">"sandbox"</span><span class="token punctuation">:</span> <span class="token string">"allow-forms allow-popups"</span><span class="token punctuation">,</span>
    <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"https://www.example.com/my/lead/app"</span>
<span class="token punctuation">}</span>
  • height: the height of the iframe that loads the app in pixels.
  • name: the lead app name. This is mandatory.
  • location: where the lead app will be loaded, which differs depending on the activation type. Location must be one of the following values: campaign-editor. This is mandatory.
  • url: the app URL. This is mandatory.
  • sandbox: the iframe sandbox attributes. Multiple values could be sent separated by space. Values: allow-forms, allow-pointer-lock, allow-popups, allow-same-origin, allow-scripts, allow-top-navigation.
Config Object: App Function
<span class="token punctuation">{</span>
    <span class="token string">"height"</span><span class="token punctuation">:</span> <span class="token number">700</span><span class="token punctuation">,</span>
    <span class="token string">"width"</span><span class="token punctuation">:</span> <span class="token number">700</span><span class="token punctuation">,</span>
    <span class="token string">"icon"</span><span class="token punctuation">:</span> <span class="token string">"https://www.example.com/my/lead/app/icon.png"</span><span class="token punctuation">,</span>
    <span class="token string">"location"</span><span class="token punctuation">:</span> <span class="token string">"admin.contact-lists.toolbar"</span><span class="token punctuation">,</span>
    <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My Lead App Name"</span><span class="token punctuation">,</span>
    <span class="token string">"sandbox"</span><span class="token punctuation">:</span> <span class="token string">"allow-forms allow-popups"</span><span class="token punctuation">,</span>
    <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"https://www.example.com/my/lead/app"</span>
<span class="token punctuation">}</span>
  • height: the height of the iframe that loads the app in pixels.
  • width: the width of the iframe that loads the app in pixels.
  • name: the lead app name. This is mandatory.
  • location: where the lead app will be loaded, which differs depending on the activation type. Location must be one of the following values: admin.contact-lists.toolbar, admin.campaign-list.toolbar. This is mandatory.
  • url: the app URL. This is mandatory.
  • sandbox: the iframe sandbox attributes. Multiple values could be sent separated by space. Values: allow-forms, allow-pointer-lock, allow-popups, allow-same-origin, allow-scripts, allow-top-navigation.
  • icon: this value can point directly to an URL holding the icon image, or the other option is to create JSON object like so:
<span class="token punctuation">{</span>
    <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">""</span><span class="token punctuation">,</span>
    <span class="token string">"icon"</span><span class="token punctuation">:</span> <span class="token string">"glyphicon"</span><span class="token punctuation">,</span>
    <span class="token string">"iconColor"</span><span class="token punctuation">:</span> <span class="token string">""</span>
<span class="token punctuation">}</span>

API Responses

Successful Operation (Code: 200)
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token string">"entity_id"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"..."</span>
<span class="token punctuation">}</span>
Bad Request (Code: 400) – Not valid API key or missing values
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"..."</span>
<span class="token punctuation">}</span>
API Unreachable (Code: 503)
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token string">"error"</span><span class="token punctuation">:</span> <span class="token string">"api_call_fail"</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"..."</span>
<span class="token punctuation">}</span>

Return

Your activation script must return:

On Success
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"Custom message to be displayed to customer"</span>
<span class="token punctuation">}</span>
On Failure
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"Custom message to be displayed to customer"</span>
<span class="token punctuation">}</span>
Optionally On Success – Redirect URL
<span class="token punctuation">{</span>
    <span class="token string">"success"</span><span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    <span class="token string">"message"</span><span class="token punctuation">:</span> <span class="token string">"Custom message to be displayed to customer"</span><span class="token punctuation">,</span>
    <span class="token string">"redirect"</span><span class="token punctuation">:</span> <span class="token string">"https://www.example.com"</span>
<span class="token punctuation">}</span>