Send Notification
curl --request POST \
--url https://api.eka.care/notification/v1/notify \
--header 'Content-Type: application/json' \
--header 'auth: <api-key>' \
--data '
{
"partner_payload": {
"partner_doctor_id": "test-p1",
"message": {
"title": "test title",
"body": "test body",
"img": "img url"
},
"landing_page": "q",
"params": {
"action": "move",
"aid": "12345",
"status": "confirmed"
}
}
}
'import requests
url = "https://api.eka.care/notification/v1/notify"
payload = { "partner_payload": {
"partner_doctor_id": "test-p1",
"message": {
"title": "test title",
"body": "test body",
"img": "img url"
},
"landing_page": "q",
"params": {
"action": "move",
"aid": "12345",
"status": "confirmed"
}
} }
headers = {
"auth": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_payload: {
partner_doctor_id: 'test-p1',
message: {title: 'test title', body: JSON.stringify('test body'), img: 'img url'},
landing_page: 'q',
params: {action: 'move', aid: '12345', status: 'confirmed'}
}
})
};
fetch('https://api.eka.care/notification/v1/notify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/notification/v1/notify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_payload' => [
'partner_doctor_id' => 'test-p1',
'message' => [
'title' => 'test title',
'body' => 'test body',
'img' => 'img url'
],
'landing_page' => 'q',
'params' => [
'action' => 'move',
'aid' => '12345',
'status' => 'confirmed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/notification/v1/notify"
payload := strings.NewReader("{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eka.care/notification/v1/notify")
.header("auth", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/notification/v1/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Notification sent successfully."
}{
"status": "error",
"message": "Bad request."
}{
"status": "error",
"message": "Internal server error."
}Notify
Send Notification
This API allows partners to send notifications to users. The notifications can include a title, body, image URL, link, and a param if provided. The API supports different platform flavors such as Android, iOS, iPad and Web.
POST
/
notification
/
v1
/
notify
Send Notification
curl --request POST \
--url https://api.eka.care/notification/v1/notify \
--header 'Content-Type: application/json' \
--header 'auth: <api-key>' \
--data '
{
"partner_payload": {
"partner_doctor_id": "test-p1",
"message": {
"title": "test title",
"body": "test body",
"img": "img url"
},
"landing_page": "q",
"params": {
"action": "move",
"aid": "12345",
"status": "confirmed"
}
}
}
'import requests
url = "https://api.eka.care/notification/v1/notify"
payload = { "partner_payload": {
"partner_doctor_id": "test-p1",
"message": {
"title": "test title",
"body": "test body",
"img": "img url"
},
"landing_page": "q",
"params": {
"action": "move",
"aid": "12345",
"status": "confirmed"
}
} }
headers = {
"auth": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_payload: {
partner_doctor_id: 'test-p1',
message: {title: 'test title', body: JSON.stringify('test body'), img: 'img url'},
landing_page: 'q',
params: {action: 'move', aid: '12345', status: 'confirmed'}
}
})
};
fetch('https://api.eka.care/notification/v1/notify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/notification/v1/notify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_payload' => [
'partner_doctor_id' => 'test-p1',
'message' => [
'title' => 'test title',
'body' => 'test body',
'img' => 'img url'
],
'landing_page' => 'q',
'params' => [
'action' => 'move',
'aid' => '12345',
'status' => 'confirmed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/notification/v1/notify"
payload := strings.NewReader("{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eka.care/notification/v1/notify")
.header("auth", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/notification/v1/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_payload\": {\n \"partner_doctor_id\": \"test-p1\",\n \"message\": {\n \"title\": \"test title\",\n \"body\": \"test body\",\n \"img\": \"img url\"\n },\n \"landing_page\": \"q\",\n \"params\": {\n \"action\": \"move\",\n \"aid\": \"12345\",\n \"status\": \"confirmed\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Notification sent successfully."
}{
"status": "error",
"message": "Bad request."
}{
"status": "error",
"message": "Internal server error."
}Authorizations
The API requires the following auth in headers for authentication.
Body
application/json
Notification payload
Show child attributes
Show child attributes
Was this page helpful?
⌘I

