curl --request PUT \
--url https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"all_employees": {
"chronic_disease": []
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload = { "all_employees": { "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({all_employees: {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([
'all_employees' => [
'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 \"all_employees\": {\n \"chronic_disease\": []\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 \"all_employees\": {\n \"chronic_disease\": []\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 \"all_employees\": {\n \"chronic_disease\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"health_declarations": {}
}{
"code": "40022",
"message": "No employee of this company matches: 9999999999."
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "<string>",
"message": "<string>"
}Fill the company declarations
A company admin answers the health declaration on the employees’ behalf, before the company is priced. all_employees is the default set of answers; ids_or_emails overrides them for the employees whose history differs. Each call replaces the company’s declarations. They are kept by employee id, apart from the employee list, so editing the list leaves them alone; 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 '
{
"all_employees": {
"chronic_disease": []
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/companies/{companyId}/declarations"
payload = { "all_employees": { "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({all_employees: {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([
'all_employees' => [
'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 \"all_employees\": {\n \"chronic_disease\": []\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 \"all_employees\": {\n \"chronic_disease\": []\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 \"all_employees\": {\n \"chronic_disease\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"health_declarations": {}
}{
"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
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 Employees whose answers differ from all_employees, named by nationality_id, iqama_id or border_number.
Hide child attributes
Hide child attributes
"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
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 all_employees, employee