Create Message
Create Message
POST
https://api.ocamba.com/v1/hood/messages
Creates a new Message
Rate limits:
Burst: 10/s
Steady: 150/m
Request schema
bodyPOST https://api.ocamba.com/v1/hood/messages HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"name": "msg_example",
"title": "{\n \"en\": \"en_title\"\n \"de\": \"de_title\"\n}",
"body": "{\n \"en\": \"en_body\"\n \"de\": \"de_body\"\n}",
"image": "{\n \"en\": \"https://example.com\"\n}",
"icon": "https://www.iconexample.com",
"landing_url": "https://www.landingurlexample.com",
"tag": "tag",
"require_interaction": 1,
"renotify": 0,
"silent": 1,
"vibration": "100,100",
"badge": "https://www.badgeexample.com",
"actions": [
null
]
}
curl -X POST "https://api.ocamba.com/v1/hood/messages" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"msg_example","title":"{\n \"en\": \"en_title\"\n \"de\": \"de_title\"\n}","body":"{\n \"en\": \"en_body\"\n \"de\": \"de_body\"\n}","image":"{\n \"en\": \"https://example.com\"\n}","icon":"https://www.iconexample.com","landing_url":"https://www.landingurlexample.com","tag":"tag","require_interaction":1,"renotify":0,"silent":1,"vibration":"100,100","badge":"https://www.badgeexample.com","actions":[null]}'
fetch("https://api.ocamba.com/v1/hood/messages", {
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify(
{
"name": "msg_example",
"title": "{\n \"en\": \"en_title\"\n \"de\": \"de_title\"\n}",
"body": "{\n \"en\": \"en_body\"\n \"de\": \"de_body\"\n}",
"image": "{\n \"en\": \"https://example.com\"\n}",
"icon": "https://www.iconexample.com",
"landing_url": "https://www.landingurlexample.com",
"tag": "tag",
"require_interaction": 1,
"renotify": 0,
"silent": 1,
"vibration": "100,100",
"badge": "https://www.badgeexample.com",
"actions": [
null
]
}
)
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $token",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"name" => "msg_example",
"title" => "[\n \"en\" => \"en_title\"\n \"de\" => \"de_title\"\n]",
"body" => "[\n \"en\" => \"en_body\"\n \"de\" => \"de_body\"\n]",
"image" => "[\n \"en\" => \"https://example.com\"\n]",
"icon" => "https://www.iconexample.com",
"landing_url" => "https://www.landingurlexample.com",
"tag" => "tag",
"require_interaction" => 1,
"renotify" => 0,
"silent" => 1,
"vibration" => "100,100",
"badge" => "https://www.badgeexample.com",
"actions" => [
null
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Responses
201 Created
HTTP/1.1 201 Created
Content-Type: application/json
Responses