Update a container Prompt

Update a container Prompt

PATCH https://api.ocamba.com/v1/hood/containers/{id}/prompts/{pid}
Update push prompt. Updateable fields: triggers, filters, target, name, settings and status.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Path parameters

parameters

Request schema

body

Response schemas

204
No Content
curl -X PATCH \
 "https://api.ocamba.com/v1/hood/containers/{id}/prompts/{pid}" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '"{\n  \"name\": \"updated prompt name\",\n  \"status\": \"active\",\n  \"settings\": {\n      \"onscroll\": true,\n      \"onclick\": false\n  },\n  \"filters\": [\n  {\n    \"variable\": \"5869\",\n    \"op\": \"eq\",\n    \"value\": \"keyword\"\n    }\n  ],\n  \"settings\": {\n    \"position\": \"center-center\",\n    \"background_color\": \"blue\",\n    \"height\": 700,\n    \"width\": 500,\n    \"close_cta\": false,\n    \"close_esc\": true,\n    \"close_click\": true,\n    \"close_auto\": 0,\n    \"delay\": 0,\n    \"animation\": \"fade-in\"\n  }            \n  \"triggers\": {\n      \"form_submission\": true,\n      \"exit_intent\": false,\n      \"visibility\": true,\n      \"page_view\": false,\n      \"scroll_depth\": {\n          \"horizontal\": {\n              \"percentage\": 100\n          },\n          \"enable_on\": \"window-load\"\n      },\n      \"timer\": 60000,\n      \"custom_event\": \"onload\"\n  },\n}"'
const url = 'https://api.ocamba.com/v1/hood/containers/{id}/prompts/{pid}';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    "{\n  \"name\": \"updated prompt name\",\n  \"status\": \"active\",\n  \"settings\": {\n      \"onscroll\": true,\n      \"onclick\": false\n  },\n  \"filters\": [\n  {\n    \"variable\": \"5869\",\n    \"op\": \"eq\",\n    \"value\": \"keyword\"\n    }\n  ],\n  \"settings\": {\n    \"position\": \"center-center\",\n    \"background_color\": \"blue\",\n    \"height\": 700,\n    \"width\": 500,\n    \"close_cta\": false,\n    \"close_esc\": true,\n    \"close_click\": true,\n    \"close_auto\": 0,\n    \"delay\": 0,\n    \"animation\": \"fade-in\"\n  }            \n  \"triggers\": {\n      \"form_submission\": true,\n      \"exit_intent\": false,\n      \"visibility\": true,\n      \"page_view\": false,\n      \"scroll_depth\": {\n          \"horizontal\": {\n              \"percentage\": 100\n          },\n          \"enable_on\": \"window-load\"\n      },\n      \"timer\": 60000,\n      \"custom_event\": \"onload\"\n  },\n}"
  )
};

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/v1/hood/containers/{id}/prompts/{pid}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  "[\n  \"name\" => \"updated prompt name\",\n  \"status\" => \"active\",\n  \"settings\" => [\n      \"onscroll\" => true,\n      \"onclick\" => false\n  ],\n  \"filters\" => [\n  [\n    \"variable\" => \"5869\",\n    \"op\" => \"eq\",\n    \"value\" => \"keyword\"\n    ]\n  ],\n  \"settings\" => [\n    \"position\" => \"center-center\",\n    \"background_color\" => \"blue\",\n    \"height\" => 700,\n    \"width\" => 500,\n    \"close_cta\" => false,\n    \"close_esc\" => true,\n    \"close_click\" => true,\n    \"close_auto\" => 0,\n    \"delay\" => 0,\n    \"animation\" => \"fade-in\"\n  ]            \n  \"triggers\" => [\n      \"form_submission\" => true,\n      \"exit_intent\" => false,\n      \"visibility\" => true,\n      \"page_view\" => false,\n      \"scroll_depth\" => [\n          \"horizontal\" => [\n              \"percentage\" => 100\n          ],\n          \"enable_on\" => \"window-load\"\n      ],\n      \"timer\" => 60000,\n      \"custom_event\" => \"onload\"\n  ],\n]"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

204 No Content

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses