curl --request PUT \
--url https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": true,
"employees": [
{
"employee_id": "1111111111",
"answers": {
"chronic_disease": []
}
}
]
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload = {
"consent": True,
"employees": [
{
"employee_id": "1111111111",
"answers": { "chronic_disease": [] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
consent: true,
employees: [{employee_id: '1111111111', answers: {chronic_disease: []}}]
})
};
fetch('https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations', 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://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'consent' => true,
'employees' => [
[
'employee_id' => '1111111111',
'answers' => [
'chronic_disease' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload := strings.NewReader("{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"health_declarations": {},
"pending_declarations": [
"<string>"
]
}{
"code": "40022",
"message": "No employee of this company matches: 9999999999."
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "<string>",
"message": "<string>"
}Submit the declarations
Every employee’s own health declaration in one call, under one consent. Each entry names an employee by employee_id and carries their answers to the questions. consent must be true: by sending it, you confirm the employees have stated that their answers are true and complete and agreed to share them with the insurance provider. The declarations are kept by employee id, apart from the employee list, so editing the list leaves them alone; each call replaces them. Every employee on the list has to have declared before the company can be priced.
curl --request PUT \
--url https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent": true,
"employees": [
{
"employee_id": "1111111111",
"answers": {
"chronic_disease": []
}
}
]
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload = {
"consent": True,
"employees": [
{
"employee_id": "1111111111",
"answers": { "chronic_disease": [] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
consent: true,
employees: [{employee_id: '1111111111', answers: {chronic_disease: []}}]
})
};
fetch('https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations', 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://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'consent' => true,
'employees' => [
[
'employee_id' => '1111111111',
'answers' => [
'chronic_disease' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload := strings.NewReader("{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consent\": true,\n \"employees\": [\n {\n \"employee_id\": \"1111111111\",\n \"answers\": {\n \"chronic_disease\": []\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"health_declarations": {},
"pending_declarations": [
"<string>"
]
}{
"code": "40022",
"message": "No employee of this company matches: 9999999999."
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Consent for the whole submission. Must be true.
true 1Hide child attributes
Hide child attributes
The employee's nationality_id, iqama_id or border_number. Each employee once.
"1111111111"
Yes or No for each question, and the list of chronic diseases.
Hide child attributes
Hide child attributes
Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above Response
The company's declarations, keyed by employee id, and who is still to declare
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Yes or No for each question, and the list of chronic diseases.
Hide child attributes
Hide child attributes
Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above true Employees who still have to declare. Empty once everyone has, and the company can be priced.