Create Widgets

Create Widgets

POST https://api.ocamba.com/v2/adex/widgets

Creates a new Widget object

Request schema

body
POST https://api.ocamba.com/v2/adex/widgets HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
  "name": "My first widget",
  "content": "",
  "macros": [
    {}
  ]
}
curl -X POST "https://api.ocamba.com/v2/adex/widgets" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My first widget","content":"","macros":[{}]}'
fetch("https://api.ocamba.com/v2/adex/widgets", {
  method: "POST",
  headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify(
    {
      "name": "My first widget",
      "content": "",
      "macros": [
        {}
      ]
    }
  )
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v2/adex/widgets");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer $token",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "My first widget",
    "content" => "",
    "macros" => [
      []
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

HTTP/1.1 201 Created
Content-Type: application/json
Responses
Note
1
There is a limited number of macros you can add to the content. These macros are - LANDING_URL, IMPRESSION_URL, TITLE, IMAGE, ICON, DESCRIPTION, DESCRIPTION2, SPONSORED, RATING, PHONE, ADDRESS, DOWNLOADS, PRICE, SALE_PRICE, LIKES, ADVERTISER_DOMAIN, DISPLAY_URL, CALL_TO_ACTION, IMPRESSION_PIXEL.
2
The macros can be repeated inside the content field.
3
Content field may save up to 20000 characters.
4
All macros that are located in the content field should also be inserted in the macros array.