Create Push task

Create Push task

POST https://api.ocamba.com/v1/hood/push-tasks/push-tasks

Creates a new Push task object


Name
Description
adexpush-task-adexrequired
Adex object.
Adex
Name
Description
account_idarray
Array of account ids created on Ocamba platform.


Example: 123456,654321

campaign_idarray
Array of campaign ids created on Ocamba platform.


Example: 1367890,1098763

default_campaign_idinteger
Campaign id created on Ocamba platform.


Example: 1036975

group_idarray
Array of group ids created on Ocamba platform.


Example: 113,22,374

number_of_messagesinteger
Minimal value is 1, maximal value is 10.


Example: 4

Default: 1

repeat_on_clickinteger
Repeats action on click


Example: 1

Possible values: 0 | 1

zone_idinteger
Push zone id created on Ocamba platform.


Example: 1000321

cronstringrequired
Cron expression containing 5 fields, separated by a single whitespace, that represents a set of times as a schedule to execute task. The first field in cron expression (minute) must be set to a single value, multi values and special characters are not allowed. The same applies to the second field (hours) if task is optimized by user timezone. For any other appliance the cron expressions are valid. The other three fields respresent the day, the month, and the day of a week.


Example: 0 0 * * *

custom_datastring
Maximal length is 4000. Key-Value pairs.

end_timedateTime
Timezone: GMT. Describes the ending time of the push task.


Example: 2021-12-28 11:00:00

frequencyintegerrequired
Time when task will be repeated, exposed in seconds. Minimum value is 3600, maximum value is 94608000, must be a number divisible by 60.


Example: 3600

messagepush-task-messagerequired
Message object.
Message
Name
Description
An array of action objects.
Action
Name
Description
actionstring
This field is deprecated, you should pass null as value and the field will be omitted.


Example: null

iconstring
Visual attribute presented to the user. Must be a valid url.


Example: https://www.iconexample.com

titleobject
The main textual aspect as pairs of keys and values, where key represents language and value title in that language.


Example: { "en": "en_title" "de": "de_title" }

urlstring
The landing url of the action.


Example: https://www.urlexample.com

badgestring
Monochromatic mini-icon which portrays to profile source where he subscribed in the first place.


Example: https://www.badgeexample.com

bodyobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 200 characters.


Example: Hello world

iconstring
Secondary visual attribute presented to the profile. Must be a valid url.


Example: https://www.iconexample.com

imageobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 200 characters.


Example: https://www.exampleimage.com/

landing_urlstring
The url of the site the profile is redirected to when clicking on the notification.


Example: https://www.landingurl.com/

renotifystring
Replacing old notification with the new one using the silent method. Applicable only with tag option.


Example: 0

require_interactionstring
Demand action execution from the profile. Applicable only for desktop devices. Acts like a boolean.


Example: 1

Possible values: 0 | 1

silentstring
Serving notification without sound and vibration. Applicable only to mobile devices.


Example: 0

tagstring
This option enables the removal of notifications with the same tag which were delivered earlier.


Example: tag

titleobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 200 characters.


Example: Title example

vibrationstring
Two vibration pulses with customizable length and pause between them, described in milliseconds (200,100,200 formats), will start when a notification is displayed. Applicable only for Android devices.


Example: 100,100

namestringrequired
Task name, maximum length 60 characters.


Example: Example task name

Quiet time object.
Quiet Time
Name
Description
fromnumber (integer)
An integer between 0 and 23 including those numbers. Describes the starting of quiet time.


Example: 2

tonumber (integer)
An integer between 0 and 23 including those numbers. Describes the ending of quiet time.


Example: 12

start_timedateTime
Timezone: GMT. Describes the starting time of the push task. In case you want the task to be executed right away, you should pass the value 'immediately'.


Example: 2021-12-28 09:16:33

statusintegerrequired
Task status, accepted values are 0 (inactive), 1 (active), 2 (finished).

Possible values: 0 | 1 | 2

Targeting object.
Push Task Targeting
Name
Description
accountsobject

Name
Description
items[ string ]
List of account ids with unique items and minimum length of 1.

opstring
Operator.


Example: include

Possible values: include | exclude

application_groupsobject

Name
Description
items[ string ]
Array of application group ids created on Ocamba platform.

opstring
Operator.


Example: include

Possible values: include | exclude

applicationsobject

Name
Description
items[ string ]
List of applications with unique items and minimum length of 1. Every item should be valid full qualified domain name and can contain star (*).

opstring
Operator.


Example: include

Possible values: include | exclude

appsobject

Name
Description
items[ string ]
Array of container id's located on the Hood app.

opstring
Operator.


Example: include

Possible values: include | exclude

browsersobject

Name
Description
items[ string ]
Array of browser ids supported by Ocamba.

opstring
Operator.


Example: include

Possible values: include | exclude

countriesobject

Name
Description
items[ string ]
Array of country codes supported by Ocamba (ISO 3166-1, 2 letter country codes).

opstring
Operator.


Example: include

Possible values: include | exclude

groupsobject

Name
Description
items[ string ]
Array of hood tag group ids created on Ocamba platform.

opstring
Operator.


Example: include

Possible values: include | exclude

languagesobject

Name
Description
items[ string ]
Array of language codes supported by Ocamba (ISO 639-2, 2 letter language codes).

opstring
Operator.


Example: include

Possible values: include | exclude

osobject

Name
Description
items[ string ]
Array of os ids supported by Ocamba.

opstring
Operator.


Example: include

Possible values: include | exclude

regionsobject

Name
Description
items[ string ]
Array of region id's located on the Ocamba platform.

opstring
Operator.


Example: include

Possible values: include | exclude

remote_usersobject

Name
Description
items[ string ]
Array of remote user id's.

opstring
Operator.


Example: include

Possible values: include | exclude

segment_listsobject

Name
Description
items[ string ]
Array of Hood Segment List ids.

opstring
The only supported operator at this time is 'include'.


Example: include

segmentsobject

Name
Description
items[ string ]
Array of segment id's located on the Hood app.

opstring
Operator.


Example: include

Possible values: include | exclude

subscribed_ageobject

Name
Description
frominteger
Minimal value is 0, maximal 3500.

tointeger
Minimal value is 1, maximal 3500.

user_dataobject

Name
Description
keystring
Key can be any string which represents user specific data.


Example: clicker

valueobject

Name
Description
itemsarray
Array of values, maximum 10 items.

opstring
Accepted values are include and exclude, default is include.

Possible values: include | exclude

usersobject

Name
Description
items[ string ]
Array of user id's.

opstring
Operator.


Example: include

Possible values: include | exclude

utm_sourcesobject

Name
Description
items[ string ]
Array of UTM sources with unique items and minimum length of 1. Each item up to 250 characters long

opstring



Example: include

Possible values: include | exclude

ttlintegerrequired
The lifetime of the messaage. Minimum value is 0, maximum value is 2419200.


Example: 2400

Default: 3600

user_time_zoneinteger
Optimized to work according to the user's time zone.


Example: 1

Possible values: 0 | 1

Response examples

>
201 - Created
201 - Created response
application/json
>
400 - Bad Request
400 - Bad Request response
application/json
Run task immediately Arrow
{
  "name" : "Demo",
  "status" : 1, // 1 - active, 0 - inactive
  "start_time" : "immediately", //start now
  "message" : {
    "title" : {
      "en" : "Hello from Del Systems"
    },
    "body" : {
    "en" : "We are glad to introduce you to ocamba platform" 
    },
    "image" : {
      "en" : "https://www.ocamba.com/images/logo.png"
    },
    "landing_url" : "https://www.ocamba.com/",
    "actions": [
      {
          "action": null,
          "icon": null,
          "title": {
              "en": "Yes"
          },
          "url": "https://www.youtube.com/watch?v=123"
      },
      {
          "action": null,
          "icon": null,
          "title": {
              "en": "No"
          },
          "url": "https://www.youtube.com/watch?v=NO"
      }
    ],
  },
  "targeting": {
    "accounts": {
        "items": [
            "6197120"
        ],
        "op": "include"
    },
    "application_groups": {
        "items": [
            "1383"
        ],
        "op": "include"
    },
    "applications": {
        "items": [
            "www.ocamba.com"
        ],
        "op": "include"
    },
    "apps": {
        "items": [
            "21050"
        ],
        "op": "include"
    },
    "browsers": {
        "items": [
            "12"
        ],
        "op": "include"
    },
    "countries": {
        "items": [
            "CA"
        ],
        "op": "include"
    },
    "groups": {
        "items": [
            "481"
        ],
        "op": "include"
    },
    "languages": {
        "items": [
            "es"
        ],
        "op": "include"
    },
    "os": {
        "items": [
            "12"
        ],
        "op": "include"
    },
    "regions": {
        "items": [
            "2593109",
            "2525468"
        ],
        "op": "include"
    },
    "remote_users": {
        "items": [
            "Nesto Bilo Sta"
        ],
        "op": "include"
    },
    "segments": {
        "items": [
            "2817"
        ],
        "op": "include"
    },
    "subscribed_age": {
        "from": 1,
        "to": 2
    },
    "user_data": {
        "example1": {
            "items": [
                "AZ BZ"
            ],
            "op": "include"
        },
        "example2": {
            "items": [
                "Test"
            ],
            "op": "include"
        },
        "example3": {
            "items": [
                "Test"
            ],
            "op": "include"
        }
    },
    "users": {
        "items": [
            "123123121312312"
        ],
        "op": "include"
    }
  }
}
{
  "name" : "Demo",
  "status" : 1, // 1 - active, 0 - inactive
  "start_time" : "2022-01-01 12:00:00", //start at
  "frequency": "3600", //repeat every 3600 sec (1 hour)
  "message" : {
    "title" : {
      "en" : "Hello from Del Systems"
    },
    "body" : {
    "en" : "We are glad to introduce you to ocamba platform" 
    },
    "image" : {
      "en" : "https://www.ocamba.com/images/logo.png"
    },
    "landing_url" : "https://www.ocamba.com/" 
  }
}
{
  "name" : "Demo",
  "status" : 1, // 1 - active, 0 - inactive
  "start_time" : "immediately", //start now
  "cron": "0 12 * * 1,5", //at 12:00 on Monday and Friday.
  "message" : {
    "title" : {
      "en" : "Hello from Del Systems"
    },
    "body" : {
    "en" : "We are glad to introduce you to ocamba platform" 
    },
    "image" : {
      "en" : "https://www.ocamba.com/images/logo.png"
    },
    "landing_url" : "https://www.ocamba.com/" 
  },
  "quiet_time": {
  "from": "0",
  "to": "4"
  }
}
{
  "name" : "Demo",
  "status" : 1, // 1 - active, 0 - inactive
  "start_time" : "immediately", //start nows
  "targeting": {
  "users": {
      "items": [
          "16601317995517219702"
      ],
      "op": "include"
    }
  },
  "adex": {
    "account_id": 123456,
    "campaign_id": [
        "1011086"
    ],
    "default_campaign_id": 1011086,
    "group_id": ["1723"],
    "number_of_messages": 1,
    "repeat_on_click": 0,
    "zone_id": 3002371
  },
  "ttl": "3600",
  "user_time_zone": "0",
  "total_user": "0",
  "frequency": "86400"
}
201 Arrow
{
  "id": "1057"
}
{
  "code": 400,
  "detail": "The name is required.",
  "title": "Bad Request"
}

Warning
1
1 Push task without start_time can not be active.
2
Note
1
1 Push task start_time can not be in the past.
push task end_time can not be set to date before start_time.
To repeat task on equal time intervals you can use frequency field. In order to have more control over repeating intervals you can use cron field. Check request examples for more info.
2