Add Device
curl --request POST \
--url https://api.eka.care/notification/add-device \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"devicePayload": {
"app-id": "123",
"app-platform": "android",
"app-version": "1571",
"did": "aa8650d03",
"fcm-id": "fr3Ybq-2QHW_Jp:CivqQlS6tZZZ",
"fid": "frbq-2Qkh",
"lang": "en",
"os-version": 20,
"user-hash": "user123"
}
}
'import requests
url = "https://api.eka.care/notification/add-device"
payload = { "devicePayload": {
"app-id": "123",
"app-platform": "android",
"app-version": "1571",
"did": "aa8650d03",
"fcm-id": "fr3Ybq-2QHW_Jp:CivqQlS6tZZZ",
"fid": "frbq-2Qkh",
"lang": "en",
"os-version": 20,
"user-hash": "user123"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
devicePayload: {
'app-id': '123',
'app-platform': 'android',
'app-version': '1571',
did: 'aa8650d03',
'fcm-id': 'fr3Ybq-2QHW_Jp:CivqQlS6tZZZ',
fid: 'frbq-2Qkh',
lang: 'en',
'os-version': 20,
'user-hash': 'user123'
}
})
};
fetch('https://api.eka.care/notification/add-device', 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/add-device")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/notification/add-device");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\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/add-device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "Unauthorized access.",
"error_code": 401
}{
"message": "Internal server error.",
"error_code": 500
}User App
Add Device
Call to add or register a device for notifications. This endpoint allows clients to register a device by providing its details such as device ID, FCM ID, app version, and other relevant information. The registered device will be used to send notifications. The request body must contain the device payload information.
POST
/
notification
/
add-device
Add Device
curl --request POST \
--url https://api.eka.care/notification/add-device \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"devicePayload": {
"app-id": "123",
"app-platform": "android",
"app-version": "1571",
"did": "aa8650d03",
"fcm-id": "fr3Ybq-2QHW_Jp:CivqQlS6tZZZ",
"fid": "frbq-2Qkh",
"lang": "en",
"os-version": 20,
"user-hash": "user123"
}
}
'import requests
url = "https://api.eka.care/notification/add-device"
payload = { "devicePayload": {
"app-id": "123",
"app-platform": "android",
"app-version": "1571",
"did": "aa8650d03",
"fcm-id": "fr3Ybq-2QHW_Jp:CivqQlS6tZZZ",
"fid": "frbq-2Qkh",
"lang": "en",
"os-version": 20,
"user-hash": "user123"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
devicePayload: {
'app-id': '123',
'app-platform': 'android',
'app-version': '1571',
did: 'aa8650d03',
'fcm-id': 'fr3Ybq-2QHW_Jp:CivqQlS6tZZZ',
fid: 'frbq-2Qkh',
lang: 'en',
'os-version': 20,
'user-hash': 'user123'
}
})
};
fetch('https://api.eka.care/notification/add-device', 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/add-device")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/notification/add-device");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\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/add-device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"devicePayload\": {\n \"app-id\": \"123\",\n \"app-platform\": \"android\",\n \"app-version\": \"1571\",\n \"did\": \"aa8650d03\",\n \"fcm-id\": \"fr3Ybq-2QHW_Jp:CivqQlS6tZZZ\",\n \"fid\": \"frbq-2Qkh\",\n \"lang\": \"en\",\n \"os-version\": 20,\n \"user-hash\": \"user123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "Unauthorized access.",
"error_code": 401
}{
"message": "Internal server error.",
"error_code": 500
}Authorizations
Body
application/json
The request body must contain the device payload information. The format should be:
"devicePayload": {
"app-id": "string",
"app-platform": "string",
"app-version": "string",
"did": "string",
"fcm-id": "string",
"fid": "string",
"lang": "string",
"os-version": "integer",
"user-hash": "string"
}
} ```
Response
Successful response
The response is of type object.
Was this page helpful?

