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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/notification/v1/notify");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<api-key>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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."
}Eka EMR API
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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/notification/v1/notify");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<api-key>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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
Was this page helpful?

