POST /medical_histories
curl --request POST \
--url https://api.example.test/medical_histories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"medical_history": {
"person_id": "<string>",
"work_history": {
"past_employment": {
"active": true,
"text": "<string>"
},
"accident_caused_disabilities": {
"active": true,
"text": null
},
"sickness_caused_disabilities": {
"active": true,
"text": "<string>"
},
"contact_with_dust_particles": {
"text": null
},
"exposure_to_loud_noises": {
"text": null
},
"exposure_to_chemicals": {
"text": null
},
"fractures_or_injuries": {
"text": null
},
"accidents_or_illnesses": {
"text": null
},
"fit_to_work": {
"text": null
},
"others": {
"text": null
}
},
"allergies": "<string>",
"pathological_records": {
"prior_hospitalization": {
"active": true,
"text": "<string>"
},
"prior_surgeries": {
"active": true,
"text": null
},
"diabetes": {
"text": null
},
"thyroid_diseases": {
"text": null
},
"hypertension": {
"text": null
},
"heart_diseases": {
"text": null
},
"injuries": {
"text": null
},
"cancer": {
"text": null
},
"tuberculosis": {
"text": null
},
"transfusions": {
"text": null
},
"respiratory": {
"text": null
},
"gastrointestinal": {
"text": null
},
"stds": {
"text": null
},
"other": {
"text": null
}
},
"nonpathological_records": {
"physical_activity": {
"active": true,
"text": "<string>"
},
"smoking": {
"active": true,
"text": null
},
"alcoholism": {
"text": null
},
"drugs_abuse": {
"text": null
},
"recent_immunization": {
"text": null
},
"other": {
"text": null
}
},
"heredofamilial_records": {
"diabetes": {
"active": true,
"text": "<string>"
},
"heart_diseases": {
"active": true,
"text": null
},
"hypertension": {
"text": null
},
"thyroid_diseases": {
"text": null
},
"other": {
"text": null
}
}
}
}
'import requests
url = "https://api.example.test/medical_histories"
payload = { "medical_history": {
"person_id": "<string>",
"work_history": {
"past_employment": {
"active": True,
"text": "<string>"
},
"accident_caused_disabilities": {
"active": True,
"text": None
},
"sickness_caused_disabilities": {
"active": True,
"text": "<string>"
},
"contact_with_dust_particles": { "text": None },
"exposure_to_loud_noises": { "text": None },
"exposure_to_chemicals": { "text": None },
"fractures_or_injuries": { "text": None },
"accidents_or_illnesses": { "text": None },
"fit_to_work": { "text": None },
"others": { "text": None }
},
"allergies": "<string>",
"pathological_records": {
"prior_hospitalization": {
"active": True,
"text": "<string>"
},
"prior_surgeries": {
"active": True,
"text": None
},
"diabetes": { "text": None },
"thyroid_diseases": { "text": None },
"hypertension": { "text": None },
"heart_diseases": { "text": None },
"injuries": { "text": None },
"cancer": { "text": None },
"tuberculosis": { "text": None },
"transfusions": { "text": None },
"respiratory": { "text": None },
"gastrointestinal": { "text": None },
"stds": { "text": None },
"other": { "text": None }
},
"nonpathological_records": {
"physical_activity": {
"active": True,
"text": "<string>"
},
"smoking": {
"active": True,
"text": None
},
"alcoholism": { "text": None },
"drugs_abuse": { "text": None },
"recent_immunization": { "text": None },
"other": { "text": None }
},
"heredofamilial_records": {
"diabetes": {
"active": True,
"text": "<string>"
},
"heart_diseases": {
"active": True,
"text": None
},
"hypertension": { "text": None },
"thyroid_diseases": { "text": None },
"other": { "text": None }
}
} }
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({
medical_history: {
person_id: '<string>',
work_history: {
past_employment: {active: true, text: '<string>'},
accident_caused_disabilities: {active: true, text: null},
sickness_caused_disabilities: {active: true, text: '<string>'},
contact_with_dust_particles: {text: null},
exposure_to_loud_noises: {text: null},
exposure_to_chemicals: {text: null},
fractures_or_injuries: {text: null},
accidents_or_illnesses: {text: null},
fit_to_work: {text: null},
others: {text: null}
},
allergies: '<string>',
pathological_records: {
prior_hospitalization: {active: true, text: '<string>'},
prior_surgeries: {active: true, text: null},
diabetes: {text: null},
thyroid_diseases: {text: null},
hypertension: {text: null},
heart_diseases: {text: null},
injuries: {text: null},
cancer: {text: null},
tuberculosis: {text: null},
transfusions: {text: null},
respiratory: {text: null},
gastrointestinal: {text: null},
stds: {text: null},
other: {text: null}
},
nonpathological_records: {
physical_activity: {active: true, text: '<string>'},
smoking: {active: true, text: null},
alcoholism: {text: null},
drugs_abuse: {text: null},
recent_immunization: {text: null},
other: {text: null}
},
heredofamilial_records: {
diabetes: {active: true, text: '<string>'},
heart_diseases: {active: true, text: null},
hypertension: {text: null},
thyroid_diseases: {text: null},
other: {text: null}
}
}
})
};
fetch('https://api.example.test/medical_histories', 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.example.test/medical_histories",
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([
'medical_history' => [
'person_id' => '<string>',
'work_history' => [
'past_employment' => [
'active' => true,
'text' => '<string>'
],
'accident_caused_disabilities' => [
'active' => true,
'text' => null
],
'sickness_caused_disabilities' => [
'active' => true,
'text' => '<string>'
],
'contact_with_dust_particles' => [
'text' => null
],
'exposure_to_loud_noises' => [
'text' => null
],
'exposure_to_chemicals' => [
'text' => null
],
'fractures_or_injuries' => [
'text' => null
],
'accidents_or_illnesses' => [
'text' => null
],
'fit_to_work' => [
'text' => null
],
'others' => [
'text' => null
]
],
'allergies' => '<string>',
'pathological_records' => [
'prior_hospitalization' => [
'active' => true,
'text' => '<string>'
],
'prior_surgeries' => [
'active' => true,
'text' => null
],
'diabetes' => [
'text' => null
],
'thyroid_diseases' => [
'text' => null
],
'hypertension' => [
'text' => null
],
'heart_diseases' => [
'text' => null
],
'injuries' => [
'text' => null
],
'cancer' => [
'text' => null
],
'tuberculosis' => [
'text' => null
],
'transfusions' => [
'text' => null
],
'respiratory' => [
'text' => null
],
'gastrointestinal' => [
'text' => null
],
'stds' => [
'text' => null
],
'other' => [
'text' => null
]
],
'nonpathological_records' => [
'physical_activity' => [
'active' => true,
'text' => '<string>'
],
'smoking' => [
'active' => true,
'text' => null
],
'alcoholism' => [
'text' => null
],
'drugs_abuse' => [
'text' => null
],
'recent_immunization' => [
'text' => null
],
'other' => [
'text' => null
]
],
'heredofamilial_records' => [
'diabetes' => [
'active' => true,
'text' => '<string>'
],
'heart_diseases' => [
'active' => true,
'text' => null
],
'hypertension' => [
'text' => null
],
'thyroid_diseases' => [
'text' => null
],
'other' => [
'text' => null
]
]
]
]),
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://api.example.test/medical_histories"
payload := strings.NewReader("{\n \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.test/medical_histories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.test/medical_histories")
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 \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}"
response = http.request(request)
puts response.read_bodyMedical history
POST /medical_histories
POST
/
medical_histories
POST /medical_histories
curl --request POST \
--url https://api.example.test/medical_histories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"medical_history": {
"person_id": "<string>",
"work_history": {
"past_employment": {
"active": true,
"text": "<string>"
},
"accident_caused_disabilities": {
"active": true,
"text": null
},
"sickness_caused_disabilities": {
"active": true,
"text": "<string>"
},
"contact_with_dust_particles": {
"text": null
},
"exposure_to_loud_noises": {
"text": null
},
"exposure_to_chemicals": {
"text": null
},
"fractures_or_injuries": {
"text": null
},
"accidents_or_illnesses": {
"text": null
},
"fit_to_work": {
"text": null
},
"others": {
"text": null
}
},
"allergies": "<string>",
"pathological_records": {
"prior_hospitalization": {
"active": true,
"text": "<string>"
},
"prior_surgeries": {
"active": true,
"text": null
},
"diabetes": {
"text": null
},
"thyroid_diseases": {
"text": null
},
"hypertension": {
"text": null
},
"heart_diseases": {
"text": null
},
"injuries": {
"text": null
},
"cancer": {
"text": null
},
"tuberculosis": {
"text": null
},
"transfusions": {
"text": null
},
"respiratory": {
"text": null
},
"gastrointestinal": {
"text": null
},
"stds": {
"text": null
},
"other": {
"text": null
}
},
"nonpathological_records": {
"physical_activity": {
"active": true,
"text": "<string>"
},
"smoking": {
"active": true,
"text": null
},
"alcoholism": {
"text": null
},
"drugs_abuse": {
"text": null
},
"recent_immunization": {
"text": null
},
"other": {
"text": null
}
},
"heredofamilial_records": {
"diabetes": {
"active": true,
"text": "<string>"
},
"heart_diseases": {
"active": true,
"text": null
},
"hypertension": {
"text": null
},
"thyroid_diseases": {
"text": null
},
"other": {
"text": null
}
}
}
}
'import requests
url = "https://api.example.test/medical_histories"
payload = { "medical_history": {
"person_id": "<string>",
"work_history": {
"past_employment": {
"active": True,
"text": "<string>"
},
"accident_caused_disabilities": {
"active": True,
"text": None
},
"sickness_caused_disabilities": {
"active": True,
"text": "<string>"
},
"contact_with_dust_particles": { "text": None },
"exposure_to_loud_noises": { "text": None },
"exposure_to_chemicals": { "text": None },
"fractures_or_injuries": { "text": None },
"accidents_or_illnesses": { "text": None },
"fit_to_work": { "text": None },
"others": { "text": None }
},
"allergies": "<string>",
"pathological_records": {
"prior_hospitalization": {
"active": True,
"text": "<string>"
},
"prior_surgeries": {
"active": True,
"text": None
},
"diabetes": { "text": None },
"thyroid_diseases": { "text": None },
"hypertension": { "text": None },
"heart_diseases": { "text": None },
"injuries": { "text": None },
"cancer": { "text": None },
"tuberculosis": { "text": None },
"transfusions": { "text": None },
"respiratory": { "text": None },
"gastrointestinal": { "text": None },
"stds": { "text": None },
"other": { "text": None }
},
"nonpathological_records": {
"physical_activity": {
"active": True,
"text": "<string>"
},
"smoking": {
"active": True,
"text": None
},
"alcoholism": { "text": None },
"drugs_abuse": { "text": None },
"recent_immunization": { "text": None },
"other": { "text": None }
},
"heredofamilial_records": {
"diabetes": {
"active": True,
"text": "<string>"
},
"heart_diseases": {
"active": True,
"text": None
},
"hypertension": { "text": None },
"thyroid_diseases": { "text": None },
"other": { "text": None }
}
} }
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({
medical_history: {
person_id: '<string>',
work_history: {
past_employment: {active: true, text: '<string>'},
accident_caused_disabilities: {active: true, text: null},
sickness_caused_disabilities: {active: true, text: '<string>'},
contact_with_dust_particles: {text: null},
exposure_to_loud_noises: {text: null},
exposure_to_chemicals: {text: null},
fractures_or_injuries: {text: null},
accidents_or_illnesses: {text: null},
fit_to_work: {text: null},
others: {text: null}
},
allergies: '<string>',
pathological_records: {
prior_hospitalization: {active: true, text: '<string>'},
prior_surgeries: {active: true, text: null},
diabetes: {text: null},
thyroid_diseases: {text: null},
hypertension: {text: null},
heart_diseases: {text: null},
injuries: {text: null},
cancer: {text: null},
tuberculosis: {text: null},
transfusions: {text: null},
respiratory: {text: null},
gastrointestinal: {text: null},
stds: {text: null},
other: {text: null}
},
nonpathological_records: {
physical_activity: {active: true, text: '<string>'},
smoking: {active: true, text: null},
alcoholism: {text: null},
drugs_abuse: {text: null},
recent_immunization: {text: null},
other: {text: null}
},
heredofamilial_records: {
diabetes: {active: true, text: '<string>'},
heart_diseases: {active: true, text: null},
hypertension: {text: null},
thyroid_diseases: {text: null},
other: {text: null}
}
}
})
};
fetch('https://api.example.test/medical_histories', 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.example.test/medical_histories",
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([
'medical_history' => [
'person_id' => '<string>',
'work_history' => [
'past_employment' => [
'active' => true,
'text' => '<string>'
],
'accident_caused_disabilities' => [
'active' => true,
'text' => null
],
'sickness_caused_disabilities' => [
'active' => true,
'text' => '<string>'
],
'contact_with_dust_particles' => [
'text' => null
],
'exposure_to_loud_noises' => [
'text' => null
],
'exposure_to_chemicals' => [
'text' => null
],
'fractures_or_injuries' => [
'text' => null
],
'accidents_or_illnesses' => [
'text' => null
],
'fit_to_work' => [
'text' => null
],
'others' => [
'text' => null
]
],
'allergies' => '<string>',
'pathological_records' => [
'prior_hospitalization' => [
'active' => true,
'text' => '<string>'
],
'prior_surgeries' => [
'active' => true,
'text' => null
],
'diabetes' => [
'text' => null
],
'thyroid_diseases' => [
'text' => null
],
'hypertension' => [
'text' => null
],
'heart_diseases' => [
'text' => null
],
'injuries' => [
'text' => null
],
'cancer' => [
'text' => null
],
'tuberculosis' => [
'text' => null
],
'transfusions' => [
'text' => null
],
'respiratory' => [
'text' => null
],
'gastrointestinal' => [
'text' => null
],
'stds' => [
'text' => null
],
'other' => [
'text' => null
]
],
'nonpathological_records' => [
'physical_activity' => [
'active' => true,
'text' => '<string>'
],
'smoking' => [
'active' => true,
'text' => null
],
'alcoholism' => [
'text' => null
],
'drugs_abuse' => [
'text' => null
],
'recent_immunization' => [
'text' => null
],
'other' => [
'text' => null
]
],
'heredofamilial_records' => [
'diabetes' => [
'active' => true,
'text' => '<string>'
],
'heart_diseases' => [
'active' => true,
'text' => null
],
'hypertension' => [
'text' => null
],
'thyroid_diseases' => [
'text' => null
],
'other' => [
'text' => null
]
]
]
]),
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://api.example.test/medical_histories"
payload := strings.NewReader("{\n \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.test/medical_histories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.test/medical_histories")
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 \"medical_history\": {\n \"person_id\": \"<string>\",\n \"work_history\": {\n \"past_employment\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"accident_caused_disabilities\": {\n \"active\": true,\n \"text\": null\n },\n \"sickness_caused_disabilities\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"contact_with_dust_particles\": {\n \"text\": null\n },\n \"exposure_to_loud_noises\": {\n \"text\": null\n },\n \"exposure_to_chemicals\": {\n \"text\": null\n },\n \"fractures_or_injuries\": {\n \"text\": null\n },\n \"accidents_or_illnesses\": {\n \"text\": null\n },\n \"fit_to_work\": {\n \"text\": null\n },\n \"others\": {\n \"text\": null\n }\n },\n \"allergies\": \"<string>\",\n \"pathological_records\": {\n \"prior_hospitalization\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"prior_surgeries\": {\n \"active\": true,\n \"text\": null\n },\n \"diabetes\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"heart_diseases\": {\n \"text\": null\n },\n \"injuries\": {\n \"text\": null\n },\n \"cancer\": {\n \"text\": null\n },\n \"tuberculosis\": {\n \"text\": null\n },\n \"transfusions\": {\n \"text\": null\n },\n \"respiratory\": {\n \"text\": null\n },\n \"gastrointestinal\": {\n \"text\": null\n },\n \"stds\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"nonpathological_records\": {\n \"physical_activity\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"smoking\": {\n \"active\": true,\n \"text\": null\n },\n \"alcoholism\": {\n \"text\": null\n },\n \"drugs_abuse\": {\n \"text\": null\n },\n \"recent_immunization\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n },\n \"heredofamilial_records\": {\n \"diabetes\": {\n \"active\": true,\n \"text\": \"<string>\"\n },\n \"heart_diseases\": {\n \"active\": true,\n \"text\": null\n },\n \"hypertension\": {\n \"text\": null\n },\n \"thyroid_diseases\": {\n \"text\": null\n },\n \"other\": {\n \"text\": null\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body⌘I