Update Push task
Update Push task
PATCH
https://api.ocamba.com/v1/hood/push-tasks/{id}
Updates the specific Push task by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Rate limits:
Burst: 10/s
Steady: 150/m
Path parameters
parametersRequest schema
bodyPATCH https://api.ocamba.com/v1/hood/push-tasks/{id} HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"start_time": "2021-12-28 09:16:33",
"end_time": "2021-12-28 11:00:00",
"frequency": 3600,
"cron": "0 0 * * *",
"user_time_zone": 1,
"quiet_time": {},
"custom_data": null,
"targeting": {},
"message": {},
"adex": {}
}
curl -X PATCH "https://api.ocamba.com/v1/hood/push-tasks/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"start_time":"2021-12-28 09:16:33","end_time":"2021-12-28 11:00:00","frequency":3600,"cron":"0 0 * * *","user_time_zone":1,"quiet_time":{},"custom_data":null,"targeting":{},"message":{},"adex":{}}'
fetch("https://api.ocamba.com/v1/hood/push-tasks/{id}", {
method: "PATCH",
headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify(
{
"start_time": "2021-12-28 09:16:33",
"end_time": "2021-12-28 11:00:00",
"frequency": 3600,
"cron": "0 0 * * *",
"user_time_zone": 1,
"quiet_time": {},
"custom_data": null,
"targeting": {},
"message": {},
"adex": {}
}
)
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/push-tasks/{id}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $token",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"start_time" => "2021-12-28 09:16:33",
"end_time" => "2021-12-28 11:00:00",
"frequency" => 3600,
"cron" => "0 0 * * *",
"user_time_zone" => 1,
"quiet_time" => [],
"custom_data" => null,
"targeting" => [],
"message" => [],
"adex" => []
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Responses
204 No Content
HTTP/1.1 204 No Content
Content-Type: application/json
400 Bad Request
HTTP/1.1 400 Bad Request
Content-Type: application/json
Responses
Warning
1
At least one of the updatable fields should be sent via HTTP body in order to change the current state of the push task.
Push task without start_time can not be active.
Push task with status “2” (finished) can not be edited.
Push task without start_time can not be active.
Push task with status “2” (finished) can not be edited.
Note
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.
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.