Create Prompt on a specific Container


                https://api.ocamba.com/v1/hood/containers/{id}/push-prompts
            

Creates a new Push Prompt


Name
Description
idstringrequired
Unique resource identifier.


Example: 12345

Name
Description
filters[ object ]
Array of prompt filter objects.

namestringrequired
Name of the Prompt.


Example: New Native Prompt

optionsobjectrequired

Name
Description
actionmessage_colorstring
Action message color in RGB hexadecimal code.


Example: d94552

background_colorstring
Background color in RGB hexadecimal code.


Example: 4a88d9

category[ object ]
Array of category objects. Each object consists of two keys, one is 'name' and second is 'label'. Label represents text displayed to end user, and 'name' represents programmatic variable name.


Example: [ {"name":"key1","label":"sport"}, {"name":"key2","label":"politics"}, {"name":"key3","label":"business"} ]

delaynumber
Trigger window prompt after N seconds.


Example: 4

iconstring
Icon URL.


Example: https://icon.com/favicon.ico

label_colorstring
Label color in RGB hexadecimal code.


Example: 4a88d9

onclickboolean
Trigger window prompt in event of any user click on page.


Example: true

oncustomstring
Trigger window prompt on custom event with specific string with name of event, document.dispatchEvent(new Event("bilosta"));


Example: event

onscrollboolean
Trigger window prompt in event of any user scroll.


Example: true

state_button_negative_promptstring
Negative button name.


Example: Don't Allow

state_button_positive_promptstring
Positive button name.


Example: Allow

state_text_promptstring
Text which will be shown on window prompt.


Example: Allow notifications on your device to get latest news.

subscribe_backgroundstring
Subscribe background color in RGB hexadecimal code.


Example: 9479d9

subscribe_colorstring
Subscribe color in RGB hexadecimal code.


Example: 9479d9

unsubscribe_colorstring
Unsubscribe color in RGB hexadecimal code.


Example: e6543e

typestring
Type of the Prompt


Example: native

Possible values: slide | bell | link | native | html
note
1 The id parameter is a valid Container id to which the Push Prompt will be added.

2 The type can not be changed.

3 The options field isn't required for native prompts only in web type of container.
200 Arrow
{
  "type": "slide",
  "name": "Custom prompt with labels and filters",
  "options": {
    "onscroll": true,
    "onclick": true,
    "oncustom": "event",
    "delay": null,
    "state_text_prompt": "Allow notifications on your device to get latest news.",
    "state_button_positive_prompt": "Allow",
    "state_button_negative_prompt": "Don't Allow",
    "icon": null,
    "background_color": "4a88d9",
    "actionmessage_color": "d94552",
    "unsubscribe_color": "e6543e",
    "subscribe_color": "9479d9",
    "subscribe_background": "9479d9",
    "label_color": "e6543e",
    "category": [
      {
        "name": "key1",
        "label": "sport"
      },
      {
        "name": "key2",
        "label": "politics"
      },
      {
        "name": "key3",
        "label": "business"
      }
    ]
  },
  "filters": [
    {
      "key": "chain",
      "match": "oap"
    }
  ]           
}
201 Arrow
{
  "id": "31ddddfe-d96e-4523-882d-3ee523ec23a2",
  "name": "Example Prompt",
  "type": "bell",
  "options": {
    "delay": 5,
    "onclick": true,
    "onscroll": false
    },
  "filters": [
    {
      "key": "chain",
      "match": "oap"
    }
  ],
  "create_time": "2023-12-26 09:39:48",
  "update_time": "2023-12-26 09:39:48"
  }