Update Widget

Update Widget

PATCH https://api.ocamba.com/v2/ocamba/widgets/{id}
Updates the specific Widget by setting the values of the parameters passed. Any parameters not provided will be left unchanged

Path parameters

parameters

Request schema

body

Response schemas

204
No Content
curl -X PATCH \
 "https://api.ocamba.com/v2/ocamba/widgets/{id}" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Top 10",
  "description": "Displays top 10 users with most activities",
  "conf": {
    "metric": {
      "sparkline": true
    }
  },
  "ds": {
    "fields": "cir,click,conversion,cpc",
    "filter": null,
    "resolution": null,
    "source": "adex.advertiser",
    "timeshift": null
  }
}'
const url = 'https://api.ocamba.com/v2/ocamba/widgets/{id}';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "Top 10",
      "description": "Displays top 10 users with most activities",
      "conf": {
        "metric": {
          "sparkline": true
        }
      },
      "ds": {
        "fields": "cir,click,conversion,cpc",
        "filter": null,
        "resolution": null,
        "source": "adex.advertiser",
        "timeshift": null
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v2/ocamba/widgets/{id}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "Top 10",
    "description" => "Displays top 10 users with most activities",
    "conf" => [
      "metric" => [
        "sparkline" => true
      ]
    ],
    "ds" => [
      "fields" => "cir,click,conversion,cpc",
      "filter" => null,
      "resolution" => null,
      "source" => "adex.advertiser",
      "timeshift" => null
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

204 No Content

Responses

Warning
Changes will be applied on all dashboards associated with this widget.
Note
System widget can’t be modified.
Tip
If you don’t know the widget id, list the widgets to find it.