Health Repository Provider Specifications for HIP
POST
Consent notification (POST)
{{baseUrl}}/v0.5/consents/hip/notify
HEADERS
Authorization
X-HIP-ID
BODY json
{
"notification": {
"consentDetail": {
"careContexts": [
{
"careContextReference": "",
"patientReference": ""
}
],
"consentId": "",
"consentManager": {},
"createdAt": "",
"hiTypes": [],
"hip": {},
"patient": {
"id": ""
},
"permission": {
"accessMode": "",
"dataEraseAt": "",
"dateRange": {
"from": "",
"to": ""
},
"frequency": {
"repeats": 0,
"unit": "",
"value": 0
}
},
"purpose": {
"code": "",
"refUri": "",
"text": ""
},
"schemaVersion": ""
},
"consentId": "",
"signature": "",
"status": ""
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/consents/hip/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/consents/hip/notify" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:notification {:signature "Signature of CM as defined in W3C standards; Base64 encoded"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consents/hip/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/consents/hip/notify"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/consents/hip/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/consents/hip/notify"
payload := strings.NewReader("{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/consents/hip/notify HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 161
{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consents/hip/notify")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/consents/hip/notify"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hip/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consents/hip/notify")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
notification: {
signature: 'Signature of CM as defined in W3C standards; Base64 encoded'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/consents/hip/notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
notification: {signature: 'Signature of CM as defined in W3C standards; Base64 encoded'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/consents/hip/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"notification":{"signature":"Signature of CM as defined in W3C standards; Base64 encoded"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/consents/hip/notify',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "notification": {\n "signature": "Signature of CM as defined in W3C standards; Base64 encoded"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hip/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/consents/hip/notify',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
notification: {signature: 'Signature of CM as defined in W3C standards; Base64 encoded'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {
notification: {signature: 'Signature of CM as defined in W3C standards; Base64 encoded'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/consents/hip/notify');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
notification: {
signature: 'Signature of CM as defined in W3C standards; Base64 encoded'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
notification: {signature: 'Signature of CM as defined in W3C standards; Base64 encoded'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/consents/hip/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"notification":{"signature":"Signature of CM as defined in W3C standards; Base64 encoded"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"notification": @{ @"signature": @"Signature of CM as defined in W3C standards; Base64 encoded" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/consents/hip/notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/consents/hip/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/consents/hip/notify",
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([
'notification' => [
'signature' => 'Signature of CM as defined in W3C standards; Base64 encoded'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/consents/hip/notify', [
'body' => '{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consents/hip/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notification' => [
'signature' => 'Signature of CM as defined in W3C standards; Base64 encoded'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notification' => [
'signature' => 'Signature of CM as defined in W3C standards; Base64 encoded'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consents/hip/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consents/hip/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consents/hip/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consents/hip/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/hip/notify"
payload = {
"notification": { "signature": "Signature of CM as defined in W3C standards; Base64 encoded" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consents/hip/notify"
payload <- "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consents/hip/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/consents/hip/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"notification\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/consents/hip/notify";
let payload = json!({
"notification": json!({"signature": "Signature of CM as defined in W3C standards; Base64 encoded"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/consents/hip/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"notification": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consents/hip/notify \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "notification": {\n "signature": "Signature of CM as defined in W3C standards; Base64 encoded"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consents/hip/notify
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = [
"notification": ["signature": "Signature of CM as defined in W3C standards; Base64 encoded"],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/consents/hip/notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Health information data request (POST)
{{baseUrl}}/v0.5/health-information/hip/request
HEADERS
Authorization
X-HIP-ID
BODY json
{
"hiRequest": {
"consent": {
"id": ""
},
"dataPushUrl": "",
"dateRange": {
"from": "",
"to": ""
},
"keyMaterial": {
"cryptoAlg": "",
"curve": "",
"dhPublicKey": {
"expiry": "",
"keyValue": "",
"parameters": ""
},
"nonce": ""
}
},
"requestId": "",
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/health-information/hip/request");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/health-information/hip/request" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:requestId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
:transactionId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/hip/request"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/health-information/hip/request"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/health-information/hip/request");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/health-information/hip/request"
payload := strings.NewReader("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/health-information/hip/request HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 118
{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/hip/request")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/health-information/hip/request"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hip/request")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/health-information/hip/request")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.asString();
const data = JSON.stringify({
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/health-information/hip/request');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/request',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/health-information/hip/request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/health-information/hip/request',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hip/request")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/health-information/hip/request',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/request',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/health-information/hip/request');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/request',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/health-information/hip/request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
@"transactionId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/health-information/hip/request"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/health-information/hip/request" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/health-information/hip/request",
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([
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/health-information/hip/request', [
'body' => '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/hip/request');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/hip/request');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/health-information/hip/request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/health-information/hip/request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/hip/request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/hip/request"
payload = {
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/health-information/hip/request"
payload <- "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/health-information/hip/request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/health-information/hip/request') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/health-information/hip/request";
let payload = json!({
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/health-information/hip/request \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
echo '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}' | \
http POST {{baseUrl}}/v0.5/health-information/hip/request \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/hip/request
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = [
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/health-information/hip/request")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
health information transfer API
{{baseUrl}}/v0.5/health-information/transfer
HEADERS
Authorization
BODY json
{
"entries": [],
"keyMaterial": {
"cryptoAlg": "",
"curve": "",
"dhPublicKey": {
"expiry": "",
"keyValue": "",
"parameters": ""
},
"nonce": ""
},
"pageCount": 0,
"pageNumber": 0,
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/health-information/transfer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/health-information/transfer" {:headers {:authorization ""}
:content-type :json
:form-params {:keyMaterial {:cryptoAlg "ECDH"
:curve "Curve25519"
:nonce "3fa85f64-5717-4562-b3fc-2c963f66afa6"}}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/transfer"
headers = HTTP::Headers{
"authorization" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/health-information/transfer"),
Headers =
{
{ "authorization", "" },
},
Content = new StringContent("{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/health-information/transfer");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/health-information/transfer"
payload := strings.NewReader("{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/health-information/transfer HTTP/1.1
Authorization:
Content-Type: application/json
Host: example.com
Content-Length: 130
{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/transfer")
.setHeader("authorization", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/health-information/transfer"))
.header("authorization", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/transfer")
.post(body)
.addHeader("authorization", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/health-information/transfer")
.header("authorization", "")
.header("content-type", "application/json")
.body("{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}")
.asString();
const data = JSON.stringify({
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/health-information/transfer');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/transfer',
headers: {authorization: '', 'content-type': 'application/json'},
data: {
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/health-information/transfer';
const options = {
method: 'POST',
headers: {authorization: '', 'content-type': 'application/json'},
body: '{"keyMaterial":{"cryptoAlg":"ECDH","curve":"Curve25519","nonce":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/health-information/transfer',
method: 'POST',
headers: {
authorization: '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "keyMaterial": {\n "cryptoAlg": "ECDH",\n "curve": "Curve25519",\n "nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/transfer")
.post(body)
.addHeader("authorization", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/health-information/transfer',
headers: {
authorization: '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/transfer',
headers: {authorization: '', 'content-type': 'application/json'},
body: {
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/health-information/transfer');
req.headers({
authorization: '',
'content-type': 'application/json'
});
req.type('json');
req.send({
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/transfer',
headers: {authorization: '', 'content-type': 'application/json'},
data: {
keyMaterial: {
cryptoAlg: 'ECDH',
curve: 'Curve25519',
nonce: '3fa85f64-5717-4562-b3fc-2c963f66afa6'
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/health-information/transfer';
const options = {
method: 'POST',
headers: {authorization: '', 'content-type': 'application/json'},
body: '{"keyMaterial":{"cryptoAlg":"ECDH","curve":"Curve25519","nonce":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"keyMaterial": @{ @"cryptoAlg": @"ECDH", @"curve": @"Curve25519", @"nonce": @"3fa85f64-5717-4562-b3fc-2c963f66afa6" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/health-information/transfer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/health-information/transfer" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/health-information/transfer",
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([
'keyMaterial' => [
'cryptoAlg' => 'ECDH',
'curve' => 'Curve25519',
'nonce' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
]
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/health-information/transfer', [
'body' => '{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/transfer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'keyMaterial' => [
'cryptoAlg' => 'ECDH',
'curve' => 'Curve25519',
'nonce' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'keyMaterial' => [
'cryptoAlg' => 'ECDH',
'curve' => 'Curve25519',
'nonce' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
]
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/transfer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/health-information/transfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/health-information/transfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"
headers = {
'authorization': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/transfer", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/transfer"
payload = { "keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
} }
headers = {
"authorization": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/health-information/transfer"
payload <- "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/health-information/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/health-information/transfer') do |req|
req.headers['authorization'] = ''
req.body = "{\n \"keyMaterial\": {\n \"cryptoAlg\": \"ECDH\",\n \"curve\": \"Curve25519\",\n \"nonce\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/health-information/transfer";
let payload = json!({"keyMaterial": json!({
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/health-information/transfer \
--header 'authorization: ' \
--header 'content-type: application/json' \
--data '{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
echo '{
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}' | \
http POST {{baseUrl}}/v0.5/health-information/transfer \
authorization:'' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'content-type: application/json' \
--body-data '{\n "keyMaterial": {\n "cryptoAlg": "ECDH",\n "curve": "Curve25519",\n "nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"\n }\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/transfer
import Foundation
let headers = [
"authorization": "",
"content-type": "application/json"
]
let parameters = ["keyMaterial": [
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"nonce": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/health-information/transfer")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Discover patient's accounts
{{baseUrl}}/v0.5/care-contexts/discover
HEADERS
Authorization
X-HIP-ID
BODY json
{
"patient": {
"gender": "",
"id": "",
"name": "",
"unverifiedIdentifiers": [
{
"type": "",
"value": ""
}
],
"verifiedIdentifiers": [
{}
],
"yearOfBirth": 0
},
"requestId": "",
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/care-contexts/discover");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/care-contexts/discover" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:patient {:id "@"
:name "chandler bing"
:yearOfBirth 2000}
:requestId "499a5a4a-7dda-4f20-9b67-e24589627061"}})
require "http/client"
url = "{{baseUrl}}/v0.5/care-contexts/discover"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/care-contexts/discover"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/care-contexts/discover");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/care-contexts/discover"
payload := strings.NewReader("{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/care-contexts/discover HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 177
{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/care-contexts/discover")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/care-contexts/discover"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/care-contexts/discover")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/care-contexts/discover")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.asString();
const data = JSON.stringify({
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/care-contexts/discover');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/discover',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/care-contexts/discover';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"id":"@","name":"chandler bing","yearOfBirth":2000},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/care-contexts/discover',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "patient": {\n "id": "@",\n "name": "chandler bing",\n "yearOfBirth": 2000\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/care-contexts/discover")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/care-contexts/discover',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/discover',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/care-contexts/discover');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/discover',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
patient: {
id: '@',
name: 'chandler bing',
yearOfBirth: 2000
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/care-contexts/discover';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"id":"@","name":"chandler bing","yearOfBirth":2000},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"patient": @{ @"id": @"@", @"name": @"chandler bing", @"yearOfBirth": @2000 },
@"requestId": @"499a5a4a-7dda-4f20-9b67-e24589627061" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/care-contexts/discover"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/care-contexts/discover" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/care-contexts/discover",
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([
'patient' => [
'id' => '@',
'name' => 'chandler bing',
'yearOfBirth' => 2000
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/care-contexts/discover', [
'body' => '{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/care-contexts/discover');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'patient' => [
'id' => '@',
'name' => 'chandler bing',
'yearOfBirth' => 2000
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'patient' => [
'id' => '@',
'name' => 'chandler bing',
'yearOfBirth' => 2000
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/care-contexts/discover');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/care-contexts/discover' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/care-contexts/discover' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/care-contexts/discover", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/care-contexts/discover"
payload = {
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/care-contexts/discover"
payload <- "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/care-contexts/discover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/care-contexts/discover') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"patient\": {\n \"id\": \"@\",\n \"name\": \"chandler bing\",\n \"yearOfBirth\": 2000\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/care-contexts/discover";
let payload = json!({
"patient": json!({
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
}),
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/care-contexts/discover \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
echo '{
"patient": {
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}' | \
http POST {{baseUrl}}/v0.5/care-contexts/discover \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "patient": {\n "id": "@",\n "name": "chandler bing",\n "yearOfBirth": 2000\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}' \
--output-document \
- {{baseUrl}}/v0.5/care-contexts/discover
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = [
"patient": [
"id": "@",
"name": "chandler bing",
"yearOfBirth": 2000
],
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/care-contexts/discover")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
API for HIP initiated care-context linking for patient
{{baseUrl}}/v0.5/links/link/add-contexts
HEADERS
Authorization
X-CM-ID
BODY json
{
"link": {
"accessToken": "",
"patient": {
"careContexts": [
{
"display": "",
"referenceNumber": ""
}
],
"display": "",
"referenceNumber": ""
}
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/add-contexts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/add-contexts" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/add-contexts"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/add-contexts"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/add-contexts");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/add-contexts"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/add-contexts HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/add-contexts")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/add-contexts"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/add-contexts")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/add-contexts")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/add-contexts');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/add-contexts',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/add-contexts';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/add-contexts',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/add-contexts")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/add-contexts',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/add-contexts',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/add-contexts');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/add-contexts',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/add-contexts';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/add-contexts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/add-contexts" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/add-contexts",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/add-contexts', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/add-contexts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/add-contexts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/add-contexts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/add-contexts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/add-contexts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/add-contexts"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/add-contexts"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/add-contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/add-contexts') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/add-contexts";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/add-contexts \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/links/link/add-contexts \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/add-contexts
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/add-contexts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
API for HIP to send SMS notifications to patients
{{baseUrl}}/v0.5/patients/sms/notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"notification": {
"careContextInfo": "",
"deeplinkUrl": "",
"hip": {
"id": "",
"name": ""
},
"phoneNo": "",
"receiverName": ""
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/patients/sms/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/patients/sms/notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:notification {:careContextInfo "X-Ray on 22nd Dec"
:deeplinkUrl "https://link.to.health.records/ (Optional)"
:phoneNo "+91-9999999999"
:receiverName "Ramesh Singh (Optional)"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/sms/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/patients/sms/notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/patients/sms/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/patients/sms/notify"
payload := strings.NewReader("{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/patients/sms/notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 270
{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/patients/sms/notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/patients/sms/notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/patients/sms/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/patients/sms/notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/patients/sms/notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/patients/sms/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"notification":{"careContextInfo":"X-Ray on 22nd Dec","deeplinkUrl":"https://link.to.health.records/ (Optional)","phoneNo":"+91-9999999999","receiverName":"Ramesh Singh (Optional)"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/patients/sms/notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "notification": {\n "careContextInfo": "X-Ray on 22nd Dec",\n "deeplinkUrl": "https://link.to.health.records/ (Optional)",\n "phoneNo": "+91-9999999999",\n "receiverName": "Ramesh Singh (Optional)"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/patients/sms/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/patients/sms/notify',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/patients/sms/notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
notification: {
careContextInfo: 'X-Ray on 22nd Dec',
deeplinkUrl: 'https://link.to.health.records/ (Optional)',
phoneNo: '+91-9999999999',
receiverName: 'Ramesh Singh (Optional)'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/patients/sms/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"notification":{"careContextInfo":"X-Ray on 22nd Dec","deeplinkUrl":"https://link.to.health.records/ (Optional)","phoneNo":"+91-9999999999","receiverName":"Ramesh Singh (Optional)"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"notification": @{ @"careContextInfo": @"X-Ray on 22nd Dec", @"deeplinkUrl": @"https://link.to.health.records/ (Optional)", @"phoneNo": @"+91-9999999999", @"receiverName": @"Ramesh Singh (Optional)" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/patients/sms/notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/patients/sms/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/patients/sms/notify",
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([
'notification' => [
'careContextInfo' => 'X-Ray on 22nd Dec',
'deeplinkUrl' => 'https://link.to.health.records/ (Optional)',
'phoneNo' => '+91-9999999999',
'receiverName' => 'Ramesh Singh (Optional)'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/patients/sms/notify', [
'body' => '{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/sms/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notification' => [
'careContextInfo' => 'X-Ray on 22nd Dec',
'deeplinkUrl' => 'https://link.to.health.records/ (Optional)',
'phoneNo' => '+91-9999999999',
'receiverName' => 'Ramesh Singh (Optional)'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notification' => [
'careContextInfo' => 'X-Ray on 22nd Dec',
'deeplinkUrl' => 'https://link.to.health.records/ (Optional)',
'phoneNo' => '+91-9999999999',
'receiverName' => 'Ramesh Singh (Optional)'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/patients/sms/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/patients/sms/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/patients/sms/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/patients/sms/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/sms/notify"
payload = {
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/patients/sms/notify"
payload <- "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/patients/sms/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/patients/sms/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"notification\": {\n \"careContextInfo\": \"X-Ray on 22nd Dec\",\n \"deeplinkUrl\": \"https://link.to.health.records/ (Optional)\",\n \"phoneNo\": \"+91-9999999999\",\n \"receiverName\": \"Ramesh Singh (Optional)\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/patients/sms/notify";
let payload = json!({
"notification": json!({
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/patients/sms/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"notification": {
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/patients/sms/notify \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "notification": {\n "careContextInfo": "X-Ray on 22nd Dec",\n "deeplinkUrl": "https://link.to.health.records/ (Optional)",\n "phoneNo": "+91-9999999999",\n "receiverName": "Ramesh Singh (Optional)"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/patients/sms/notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"notification": [
"careContextInfo": "X-Ray on 22nd Dec",
"deeplinkUrl": "https://link.to.health.records/ (Optional)",
"phoneNo": "+91-9999999999",
"receiverName": "Ramesh Singh (Optional)"
],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/patients/sms/notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Confirmation request sending token, otp or other authentication details from HIP-HIU for confirmation
{{baseUrl}}/v0.5/users/auth/confirm
HEADERS
Authorization
X-CM-ID
BODY json
{
"credential": {
"authCode": "",
"demographic": {
"dateOfBirth": "",
"gender": "",
"identifier": {
"type": "",
"value": ""
},
"name": ""
}
},
"requestId": "",
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/confirm");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/confirm" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/confirm"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/confirm"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/confirm");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/confirm"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/confirm HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/confirm")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/confirm"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/confirm")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/confirm');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/confirm',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/confirm',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/confirm');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/confirm"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/confirm" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/confirm",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/confirm', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/confirm');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/confirm');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/confirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/confirm"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/confirm"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/confirm') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/confirm";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/confirm \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/confirm \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/confirm
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/confirm")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Consent notification
{{baseUrl}}/v0.5/consents/hip/on-notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"acknowledgement": {
"consentId": "",
"status": ""
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/consents/hip/on-notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/consents/hip/on-notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:acknowledgement {:consentId ""}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consents/hip/on-notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/consents/hip/on-notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/consents/hip/on-notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/consents/hip/on-notify"
payload := strings.NewReader("{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/consents/hip/on-notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 126
{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consents/hip/on-notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/consents/hip/on-notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hip/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consents/hip/on-notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
acknowledgement: {
consentId: ''
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/consents/hip/on-notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {consentId: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/consents/hip/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"consentId":""},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/consents/hip/on-notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "acknowledgement": {\n "consentId": ""\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hip/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/consents/hip/on-notify',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acknowledgement: {consentId: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
acknowledgement: {consentId: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/consents/hip/on-notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
acknowledgement: {
consentId: ''
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hip/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {consentId: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/consents/hip/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"consentId":""},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acknowledgement": @{ @"consentId": @"" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/consents/hip/on-notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/consents/hip/on-notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/consents/hip/on-notify",
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([
'acknowledgement' => [
'consentId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/consents/hip/on-notify', [
'body' => '{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consents/hip/on-notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acknowledgement' => [
'consentId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acknowledgement' => [
'consentId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consents/hip/on-notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consents/hip/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consents/hip/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consents/hip/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/hip/on-notify"
payload = {
"acknowledgement": { "consentId": "" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consents/hip/on-notify"
payload <- "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consents/hip/on-notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/consents/hip/on-notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"acknowledgement\": {\n \"consentId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/consents/hip/on-notify";
let payload = json!({
"acknowledgement": json!({"consentId": ""}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/consents/hip/on-notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"acknowledgement": {
"consentId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consents/hip/on-notify \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "acknowledgement": {\n "consentId": ""\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consents/hip/on-notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"acknowledgement": ["consentId": ""],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/consents/hip/on-notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get a patient's authentication modes relevant to specified purpose
{{baseUrl}}/v0.5/users/auth/fetch-modes
HEADERS
Authorization
X-CM-ID
BODY json
{
"query": {
"id": "",
"purpose": "",
"requester": {
"id": "",
"type": ""
}
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/fetch-modes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/fetch-modes" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:query {:id "hinapatel79@ndhm"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/fetch-modes"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/fetch-modes"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/fetch-modes");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/fetch-modes"
payload := strings.NewReader("{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/fetch-modes HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 104
{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/fetch-modes")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/fetch-modes"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/fetch-modes")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/fetch-modes")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
query: {
id: 'hinapatel79@ndhm'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/fetch-modes');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/fetch-modes',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
query: {id: 'hinapatel79@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/fetch-modes';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"query":{"id":"hinapatel79@ndhm"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/fetch-modes',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "query": {\n "id": "hinapatel79@ndhm"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/fetch-modes")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/fetch-modes',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
query: {id: 'hinapatel79@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/fetch-modes',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
query: {id: 'hinapatel79@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/fetch-modes');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
query: {
id: 'hinapatel79@ndhm'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/fetch-modes',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
query: {id: 'hinapatel79@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/fetch-modes';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"query":{"id":"hinapatel79@ndhm"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"query": @{ @"id": @"hinapatel79@ndhm" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/fetch-modes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/fetch-modes" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/fetch-modes",
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([
'query' => [
'id' => 'hinapatel79@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/fetch-modes', [
'body' => '{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/fetch-modes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'query' => [
'id' => 'hinapatel79@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'query' => [
'id' => 'hinapatel79@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/fetch-modes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/fetch-modes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/fetch-modes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/fetch-modes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/fetch-modes"
payload = {
"query": { "id": "hinapatel79@ndhm" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/fetch-modes"
payload <- "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/fetch-modes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/fetch-modes') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"query\": {\n \"id\": \"hinapatel79@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/fetch-modes";
let payload = json!({
"query": json!({"id": "hinapatel79@ndhm"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/fetch-modes \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"query": {
"id": "hinapatel79@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/fetch-modes \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "query": {\n "id": "hinapatel79@ndhm"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/fetch-modes
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"query": ["id": "hinapatel79@ndhm"],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/fetch-modes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get access token
{{baseUrl}}/v0.5/sessions
BODY json
{
"clientId": "",
"clientSecret": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/sessions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/sessions" {:content-type :json
:form-params {:clientId ""
:clientSecret ""}})
require "http/client"
url = "{{baseUrl}}/v0.5/sessions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/sessions"),
Content = new StringContent("{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/sessions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/sessions"
payload := strings.NewReader("{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/sessions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"clientId": "",
"clientSecret": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/sessions")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/sessions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/sessions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/sessions")
.header("content-type", "application/json")
.body("{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}")
.asString();
const data = JSON.stringify({
clientId: '',
clientSecret: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/sessions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/sessions',
headers: {'content-type': 'application/json'},
data: {clientId: '', clientSecret: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/sessions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/sessions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientId": "",\n "clientSecret": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/sessions")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/sessions',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({clientId: '', clientSecret: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/sessions',
headers: {'content-type': 'application/json'},
body: {clientId: '', clientSecret: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/sessions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientId: '',
clientSecret: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/sessions',
headers: {'content-type': 'application/json'},
data: {clientId: '', clientSecret: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/sessions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientId":"","clientSecret":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientId": @"",
@"clientSecret": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/sessions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/sessions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/sessions",
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([
'clientId' => '',
'clientSecret' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/sessions', [
'body' => '{
"clientId": "",
"clientSecret": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/sessions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientId' => '',
'clientSecret' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientId' => '',
'clientSecret' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/sessions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/sessions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/sessions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientId": "",
"clientSecret": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v0.5/sessions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/sessions"
payload = {
"clientId": "",
"clientSecret": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/sessions"
payload <- "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/sessions') do |req|
req.body = "{\n \"clientId\": \"\",\n \"clientSecret\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/sessions";
let payload = json!({
"clientId": "",
"clientSecret": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/sessions \
--header 'content-type: application/json' \
--data '{
"clientId": "",
"clientSecret": ""
}'
echo '{
"clientId": "",
"clientSecret": ""
}' | \
http POST {{baseUrl}}/v0.5/sessions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientId": "",\n "clientSecret": ""\n}' \
--output-document \
- {{baseUrl}}/v0.5/sessions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientId": "",
"clientSecret": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/sessions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"accessToken": "eyJhbGciOiJSUzI1Ni.IsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrVVp.2MXJQMjRyYXN1UW9wU2lWbkdZQUZIVFowYVZGVWpYNXFLMnNibTk0In0",
"expiresIn": 1800,
"refreshExpiresIn": 1800,
"refreshToken": "eyJhbGciOiJSUzI1Ni.IsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrVVp.2MXJQMjRyYXN1UW9wU2lWbkdZQUZIVFowYVZGVWpYNXFLMnNibTk0In0",
"tokenType": "bearer"
}
RESPONSE HEADERS
Content-Type
application/xml
RESPONSE BODY xml
{
"accessToken": "eyJhbGciOiJSUzI1Ni.IsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrVVp.2MXJQMjRyYXN1UW9wU2lWbkdZQUZIVFowYVZGVWpYNXFLMnNibTk0In0",
"expiresIn": 1800,
"refreshExpiresIn": 1800,
"refreshToken": "eyJhbGciOiJSUzI1Ni.IsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrVVp.2MXJQMjRyYXN1UW9wU2lWbkdZQUZIVFowYVZGVWpYNXFLMnNibTk0In0",
"tokenType": "bearer"
}
GET
Get certs for JWT verification
{{baseUrl}}/v0.5/certs
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/certs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v0.5/certs")
require "http/client"
url = "{{baseUrl}}/v0.5/certs"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v0.5/certs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/certs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/certs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v0.5/certs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v0.5/certs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/certs"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/certs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v0.5/certs")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v0.5/certs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/certs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/certs';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/certs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/certs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/certs',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/certs'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v0.5/certs');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/certs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/certs';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/certs"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/certs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/certs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v0.5/certs');
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/certs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v0.5/certs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/certs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/certs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v0.5/certs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/certs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/certs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/certs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v0.5/certs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/certs";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v0.5/certs
http GET {{baseUrl}}/v0.5/certs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v0.5/certs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/certs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get openid configuration
{{baseUrl}}/v0.5/.well-known/openid-configuration
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/.well-known/openid-configuration");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v0.5/.well-known/openid-configuration")
require "http/client"
url = "{{baseUrl}}/v0.5/.well-known/openid-configuration"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v0.5/.well-known/openid-configuration"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/.well-known/openid-configuration");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/.well-known/openid-configuration"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v0.5/.well-known/openid-configuration HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v0.5/.well-known/openid-configuration")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/.well-known/openid-configuration"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/.well-known/openid-configuration")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v0.5/.well-known/openid-configuration")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v0.5/.well-known/openid-configuration');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v0.5/.well-known/openid-configuration'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/.well-known/openid-configuration';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/.well-known/openid-configuration',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/.well-known/openid-configuration")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/.well-known/openid-configuration',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v0.5/.well-known/openid-configuration'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v0.5/.well-known/openid-configuration');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v0.5/.well-known/openid-configuration'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/.well-known/openid-configuration';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/.well-known/openid-configuration"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/.well-known/openid-configuration" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/.well-known/openid-configuration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v0.5/.well-known/openid-configuration');
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/.well-known/openid-configuration');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v0.5/.well-known/openid-configuration');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/.well-known/openid-configuration' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/.well-known/openid-configuration' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v0.5/.well-known/openid-configuration")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/.well-known/openid-configuration"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/.well-known/openid-configuration"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/.well-known/openid-configuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v0.5/.well-known/openid-configuration') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/.well-known/openid-configuration";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v0.5/.well-known/openid-configuration
http GET {{baseUrl}}/v0.5/.well-known/openid-configuration
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v0.5/.well-known/openid-configuration
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/.well-known/openid-configuration")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"jwks_uri": "https://ncg-gateway/certs"
}
RESPONSE HEADERS
Content-Type
application/xml
RESPONSE BODY xml
{
"jwks_uri": "https://ncg-gateway/certs"
}
POST
Health information data request
{{baseUrl}}/v0.5/health-information/hip/on-request
HEADERS
Authorization
X-CM-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"hiRequest": {
"sessionStatus": "",
"transactionId": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/health-information/hip/on-request");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/health-information/hip/on-request" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/hip/on-request"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/health-information/hip/on-request"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/health-information/hip/on-request");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/health-information/hip/on-request"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/health-information/hip/on-request HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/hip/on-request")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/health-information/hip/on-request"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hip/on-request")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/health-information/hip/on-request")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/health-information/hip/on-request');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/on-request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/health-information/hip/on-request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/health-information/hip/on-request',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hip/on-request")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/health-information/hip/on-request',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/on-request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/health-information/hip/on-request');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hip/on-request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/health-information/hip/on-request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/health-information/hip/on-request"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/health-information/hip/on-request" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/health-information/hip/on-request",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/health-information/hip/on-request', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/hip/on-request');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/hip/on-request');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/health-information/hip/on-request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/health-information/hip/on-request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/hip/on-request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/hip/on-request"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/health-information/hip/on-request"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/health-information/hip/on-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/health-information/hip/on-request') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/health-information/hip/on-request";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/health-information/hip/on-request \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/health-information/hip/on-request \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/hip/on-request
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/health-information/hip/on-request")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Initialize authentication from HIP
{{baseUrl}}/v0.5/users/auth/init
HEADERS
Authorization
X-CM-ID
BODY json
{
"query": {
"authMode": "",
"id": "",
"purpose": "",
"requester": {
"id": "",
"type": ""
}
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/init" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:query {:id "hinapatel@ndhm"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/init"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/init"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/init"
payload := strings.NewReader("{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/init HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 102
{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/init")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/init"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/init")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
query: {
id: 'hinapatel@ndhm'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/init');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
query: {id: 'hinapatel@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"query":{"id":"hinapatel@ndhm"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/init',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "query": {\n "id": "hinapatel@ndhm"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/init',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
query: {id: 'hinapatel@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
query: {id: 'hinapatel@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/init');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
query: {
id: 'hinapatel@ndhm'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
query: {id: 'hinapatel@ndhm'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"query":{"id":"hinapatel@ndhm"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"query": @{ @"id": @"hinapatel@ndhm" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/init"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/init",
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([
'query' => [
'id' => 'hinapatel@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/init', [
'body' => '{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'query' => [
'id' => 'hinapatel@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'query' => [
'id' => 'hinapatel@ndhm'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/init"
payload = {
"query": { "id": "hinapatel@ndhm" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/init"
payload <- "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/init') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"query\": {\n \"id\": \"hinapatel@ndhm\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/init";
let payload = json!({
"query": json!({"id": "hinapatel@ndhm"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"query": {
"id": "hinapatel@ndhm"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/init \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "query": {\n "id": "hinapatel@ndhm"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/init
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"query": ["id": "hinapatel@ndhm"],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/init")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Notifications corresponding to events during data flow
{{baseUrl}}/v0.5/health-information/notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"notification": {
"consentId": "",
"doneAt": "",
"notifier": {
"id": "",
"type": ""
},
"statusNotification": {
"hipId": "",
"sessionStatus": "",
"statusResponses": [
{
"careContextReference": "",
"description": "",
"hiStatus": ""
}
]
},
"transactionId": ""
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/health-information/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/health-information/notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:notification {:consentId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
:transactionId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}
:requestId "499a5a4a-7dda-4f20-9b67-e24589627061"}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/health-information/notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/health-information/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/health-information/notify"
payload := strings.NewReader("{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/health-information/notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 201
{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/health-information/notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/health-information/notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.asString();
const data = JSON.stringify({
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/health-information/notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/health-information/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"notification":{"consentId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/health-information/notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "notification": {\n "consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/health-information/notify',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/health-information/notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
notification: {
consentId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/health-information/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"notification":{"consentId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"notification": @{ @"consentId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d", @"transactionId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d" },
@"requestId": @"499a5a4a-7dda-4f20-9b67-e24589627061" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/health-information/notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/health-information/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/health-information/notify",
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([
'notification' => [
'consentId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/health-information/notify', [
'body' => '{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notification' => [
'consentId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notification' => [
'consentId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/health-information/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/health-information/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/notify"
payload = {
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/health-information/notify"
payload <- "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/health-information/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/health-information/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"notification\": {\n \"consentId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/health-information/notify";
let payload = json!({
"notification": json!({
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}),
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/health-information/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
echo '{
"notification": {
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}' | \
http POST {{baseUrl}}/v0.5/health-information/notify \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "notification": {\n "consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"notification": [
"consentId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
],
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/health-information/notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Response to patient's account discovery request
{{baseUrl}}/v0.5/care-contexts/on-discover
HEADERS
Authorization
X-CM-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"patient": {
"careContexts": [
{
"display": "",
"referenceNumber": ""
}
],
"display": "",
"matchedBy": [],
"referenceNumber": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/care-contexts/on-discover");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/care-contexts/on-discover" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/care-contexts/on-discover"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/care-contexts/on-discover"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/care-contexts/on-discover");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/care-contexts/on-discover"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/care-contexts/on-discover HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/care-contexts/on-discover")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/care-contexts/on-discover"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/care-contexts/on-discover")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/care-contexts/on-discover")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/care-contexts/on-discover');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/on-discover',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/care-contexts/on-discover';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/care-contexts/on-discover',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/care-contexts/on-discover")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/care-contexts/on-discover',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/on-discover',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/care-contexts/on-discover');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/care-contexts/on-discover',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/care-contexts/on-discover';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/care-contexts/on-discover"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/care-contexts/on-discover" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/care-contexts/on-discover",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/care-contexts/on-discover', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/care-contexts/on-discover');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/care-contexts/on-discover');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/care-contexts/on-discover' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/care-contexts/on-discover' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/care-contexts/on-discover", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/care-contexts/on-discover"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/care-contexts/on-discover"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/care-contexts/on-discover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/care-contexts/on-discover') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/care-contexts/on-discover";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/care-contexts/on-discover \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/care-contexts/on-discover \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/care-contexts/on-discover
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/care-contexts/on-discover")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Response to patient's care context link request
{{baseUrl}}/v0.5/links/link/on-init
HEADERS
Authorization
X-CM-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"link": {
"authenticationType": "",
"meta": {
"communicationExpiry": "",
"communicationHint": "",
"communicationMedium": ""
},
"referenceNumber": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/on-init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/on-init" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"
:transactionId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/on-init"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/on-init"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/on-init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/on-init"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/on-init HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/on-init")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/on-init"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/on-init")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/on-init');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/on-init',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/on-init',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/on-init');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd","transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd",
@"transactionId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/on-init"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/on-init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/on-init",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/on-init', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/on-init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd',
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/on-init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/on-init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/on-init"
payload = {
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/on-init"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/on-init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/on-init') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/on-init";
let payload = json!({
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/on-init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}' | \
http POST {{baseUrl}}/v0.5/links/link/on-init \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/on-init
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/on-init")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/patients/profile/on-share");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/patients/profile/on-share" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:acknowledgement {:healthId "@"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/profile/on-share"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/patients/profile/on-share"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/patients/profile/on-share");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/patients/profile/on-share"
payload := strings.NewReader("{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/patients/profile/on-share HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 123
{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/patients/profile/on-share")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/patients/profile/on-share"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/patients/profile/on-share")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/patients/profile/on-share")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
acknowledgement: {
healthId: '@'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/patients/profile/on-share');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/on-share',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {healthId: '@'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/patients/profile/on-share';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"healthId":"@"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/patients/profile/on-share',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "acknowledgement": {\n "healthId": "@"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/patients/profile/on-share")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/patients/profile/on-share',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
acknowledgement: {healthId: '@'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/on-share',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
acknowledgement: {healthId: '@'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/patients/profile/on-share');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
acknowledgement: {
healthId: '@'
},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/on-share',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {healthId: '@'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/patients/profile/on-share';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"healthId":"@"},"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"acknowledgement": @{ @"healthId": @"@" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/patients/profile/on-share"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/patients/profile/on-share" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/patients/profile/on-share",
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([
'acknowledgement' => [
'healthId' => '@'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/patients/profile/on-share', [
'body' => '{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/profile/on-share');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'acknowledgement' => [
'healthId' => '@'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acknowledgement' => [
'healthId' => '@'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/patients/profile/on-share');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/patients/profile/on-share' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/patients/profile/on-share' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/patients/profile/on-share", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/profile/on-share"
payload = {
"acknowledgement": { "healthId": "@" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/patients/profile/on-share"
payload <- "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/patients/profile/on-share")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/patients/profile/on-share') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"acknowledgement\": {\n \"healthId\": \"@\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/patients/profile/on-share";
let payload = json!({
"acknowledgement": json!({"healthId": "@"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/patients/profile/on-share \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"acknowledgement": {
"healthId": "@"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/patients/profile/on-share \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "acknowledgement": {\n "healthId": "@"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/patients/profile/on-share
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"acknowledgement": ["healthId": "@"],
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/patients/profile/on-share")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Token authenticated by HIP, indicating completion of linkage of care-contexts
{{baseUrl}}/v0.5/links/link/on-confirm
HEADERS
Authorization
X-CM-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"patient": {
"careContexts": [
{
"display": "",
"referenceNumber": ""
}
],
"display": "",
"referenceNumber": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/on-confirm");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/on-confirm" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/on-confirm"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/on-confirm"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/on-confirm");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/on-confirm"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/on-confirm HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/on-confirm")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/on-confirm"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/on-confirm")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/on-confirm');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/on-confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/on-confirm',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/on-confirm',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/on-confirm');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-confirm',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/on-confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/on-confirm"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/on-confirm" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/on-confirm",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/on-confirm', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/on-confirm');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/on-confirm');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/on-confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/on-confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/on-confirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/on-confirm"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/on-confirm"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/on-confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/on-confirm') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/on-confirm";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/on-confirm \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/links/link/on-confirm \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/on-confirm
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/on-confirm")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
callback API by HIU-HIPs as acknowledgement of auth notification
{{baseUrl}}/v0.5/users/auth/on-notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"acknowledgement": {
"status": ""
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/on-notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-cm-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/on-notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/on-notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/on-notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/on-notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-cm-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/on-notify"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-cm-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/on-notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/on-notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/on-notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/on-notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/on-notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-cm-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/on-notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-cm-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/on-notify',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/on-notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-cm-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/on-notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/on-notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-cm-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/on-notify",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-cm-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/on-notify', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/on-notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/on-notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-cm-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-cm-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/on-notify"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/on-notify"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-cm-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/on-notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-cm-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/on-notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/on-notify";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-cm-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/on-notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/on-notify \
authorization:'' \
content-type:application/json \
x-cm-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-cm-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/on-notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/on-notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Link patient's care contexts
{{baseUrl}}/v0.5/links/link/init
HEADERS
Authorization
X-HIP-ID
BODY json
{
"patient": {
"careContexts": [
{
"referenceNumber": ""
}
],
"id": "",
"referenceNumber": ""
},
"requestId": "",
"timestamp": "",
"transactionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/init" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:patient {:id "hinapatel79@ndhm"
:referenceNumber "TMH-PUID-001"}}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/init"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/init"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/init"
payload := strings.NewReader("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/init HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 90
{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/init")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/init"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/init")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}")
.asString();
const data = JSON.stringify({
patient: {
id: 'hinapatel79@ndhm',
referenceNumber: 'TMH-PUID-001'
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/init');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/init',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {patient: {id: 'hinapatel79@ndhm', referenceNumber: 'TMH-PUID-001'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"id":"hinapatel79@ndhm","referenceNumber":"TMH-PUID-001"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/init',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "patient": {\n "id": "hinapatel79@ndhm",\n "referenceNumber": "TMH-PUID-001"\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/init',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({patient: {id: 'hinapatel79@ndhm', referenceNumber: 'TMH-PUID-001'}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/init',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {patient: {id: 'hinapatel79@ndhm', referenceNumber: 'TMH-PUID-001'}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/init');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
patient: {
id: 'hinapatel79@ndhm',
referenceNumber: 'TMH-PUID-001'
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/init',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {patient: {id: 'hinapatel79@ndhm', referenceNumber: 'TMH-PUID-001'}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"id":"hinapatel79@ndhm","referenceNumber":"TMH-PUID-001"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"patient": @{ @"id": @"hinapatel79@ndhm", @"referenceNumber": @"TMH-PUID-001" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/init"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/init",
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([
'patient' => [
'id' => 'hinapatel79@ndhm',
'referenceNumber' => 'TMH-PUID-001'
]
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/init', [
'body' => '{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'patient' => [
'id' => 'hinapatel79@ndhm',
'referenceNumber' => 'TMH-PUID-001'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'patient' => [
'id' => 'hinapatel79@ndhm',
'referenceNumber' => 'TMH-PUID-001'
]
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/init"
payload = { "patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
} }
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/init"
payload <- "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/init') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"referenceNumber\": \"TMH-PUID-001\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/init";
let payload = json!({"patient": json!({
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}'
echo '{
"patient": {
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
}
}' | \
http POST {{baseUrl}}/v0.5/links/link/init \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "patient": {\n "id": "hinapatel79@ndhm",\n "referenceNumber": "TMH-PUID-001"\n }\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/init
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = ["patient": [
"id": "hinapatel79@ndhm",
"referenceNumber": "TMH-PUID-001"
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/init")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Token submission by Consent Manager for link confirmation
{{baseUrl}}/v0.5/links/link/confirm
HEADERS
Authorization
X-HIP-ID
BODY json
{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/confirm");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/confirm" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:confirmation {:linkRefNumber ""
:token ""}
:requestId ""
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/confirm"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/confirm"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/confirm");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/confirm"
payload := strings.NewReader("{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/confirm HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 106
{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/confirm")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/confirm"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/confirm")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
confirmation: {
linkRefNumber: '',
token: ''
},
requestId: '',
timestamp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/confirm');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/confirm',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {confirmation: {linkRefNumber: '', token: ''}, requestId: '', timestamp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"confirmation":{"linkRefNumber":"","token":""},"requestId":"","timestamp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/confirm',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "confirmation": {\n "linkRefNumber": "",\n "token": ""\n },\n "requestId": "",\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/confirm',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({confirmation: {linkRefNumber: '', token: ''}, requestId: '', timestamp: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/confirm',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {confirmation: {linkRefNumber: '', token: ''}, requestId: '', timestamp: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/confirm');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
confirmation: {
linkRefNumber: '',
token: ''
},
requestId: '',
timestamp: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/confirm',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {confirmation: {linkRefNumber: '', token: ''}, requestId: '', timestamp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/confirm';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"confirmation":{"linkRefNumber":"","token":""},"requestId":"","timestamp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"confirmation": @{ @"linkRefNumber": @"", @"token": @"" },
@"requestId": @"",
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/confirm"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/confirm" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/confirm",
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([
'confirmation' => [
'linkRefNumber' => '',
'token' => ''
],
'requestId' => '',
'timestamp' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/confirm', [
'body' => '{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/confirm');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'confirmation' => [
'linkRefNumber' => '',
'token' => ''
],
'requestId' => '',
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'confirmation' => [
'linkRefNumber' => '',
'token' => ''
],
'requestId' => '',
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/confirm');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/confirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/confirm"
payload = {
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/confirm"
payload <- "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/confirm') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"confirmation\": {\n \"linkRefNumber\": \"\",\n \"token\": \"\"\n },\n \"requestId\": \"\",\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/confirm";
let payload = json!({
"confirmation": json!({
"linkRefNumber": "",
"token": ""
}),
"requestId": "",
"timestamp": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/confirm \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}'
echo '{
"confirmation": {
"linkRefNumber": "",
"token": ""
},
"requestId": "",
"timestamp": ""
}' | \
http POST {{baseUrl}}/v0.5/links/link/confirm \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "confirmation": {\n "linkRefNumber": "",\n "token": ""\n },\n "requestId": "",\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/confirm
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = [
"confirmation": [
"linkRefNumber": "",
"token": ""
],
"requestId": "",
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/confirm")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
callback API for HIP initiated patient linking -link-add-context
{{baseUrl}}/v0.5/links/link/on-add-contexts
HEADERS
Authorization
X-HIP-ID
BODY json
{
"acknowledgement": {
"status": ""
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/links/link/on-add-contexts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/links/link/on-add-contexts" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/links/link/on-add-contexts"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/links/link/on-add-contexts"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/links/link/on-add-contexts");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/links/link/on-add-contexts"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/links/link/on-add-contexts HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/links/link/on-add-contexts")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/links/link/on-add-contexts"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-add-contexts")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/links/link/on-add-contexts")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/links/link/on-add-contexts');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-add-contexts',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/links/link/on-add-contexts';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/links/link/on-add-contexts',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/links/link/on-add-contexts")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/links/link/on-add-contexts',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-add-contexts',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/links/link/on-add-contexts');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/links/link/on-add-contexts',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/links/link/on-add-contexts';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/links/link/on-add-contexts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/links/link/on-add-contexts" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/links/link/on-add-contexts",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/links/link/on-add-contexts', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/links/link/on-add-contexts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/links/link/on-add-contexts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/links/link/on-add-contexts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/links/link/on-add-contexts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/links/link/on-add-contexts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/links/link/on-add-contexts"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/links/link/on-add-contexts"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/links/link/on-add-contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/links/link/on-add-contexts') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/links/link/on-add-contexts";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/links/link/on-add-contexts \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/links/link/on-add-contexts \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/links/link/on-add-contexts
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/links/link/on-add-contexts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get consent request status
{{baseUrl}}/v0.5/heartbeat
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/heartbeat");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v0.5/heartbeat")
require "http/client"
url = "{{baseUrl}}/v0.5/heartbeat"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v0.5/heartbeat"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/heartbeat");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/heartbeat"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v0.5/heartbeat HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v0.5/heartbeat")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/heartbeat"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/heartbeat")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v0.5/heartbeat")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v0.5/heartbeat');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/heartbeat'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/heartbeat';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/heartbeat',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/heartbeat")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/heartbeat',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/heartbeat'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v0.5/heartbeat');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v0.5/heartbeat'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/heartbeat';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/heartbeat"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/heartbeat" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v0.5/heartbeat');
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/heartbeat');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v0.5/heartbeat');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/heartbeat' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/heartbeat' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v0.5/heartbeat")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/heartbeat"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/heartbeat"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v0.5/heartbeat') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/heartbeat";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v0.5/heartbeat
http GET {{baseUrl}}/v0.5/heartbeat
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v0.5/heartbeat
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/heartbeat")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Acknowledgment response for SMS notification sent to patient by HIP
{{baseUrl}}/v0.5/patients/sms/on-notify
HEADERS
Authorization
X-HIP-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"status": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/patients/sms/on-notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/patients/sms/on-notify" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/sms/on-notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/patients/sms/on-notify"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/patients/sms/on-notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/patients/sms/on-notify"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/patients/sms/on-notify HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/patients/sms/on-notify")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/patients/sms/on-notify"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/patients/sms/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/patients/sms/on-notify")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/patients/sms/on-notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/on-notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/patients/sms/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/patients/sms/on-notify',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/patients/sms/on-notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/patients/sms/on-notify',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/on-notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/patients/sms/on-notify');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/sms/on-notify',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/patients/sms/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/patients/sms/on-notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/patients/sms/on-notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/patients/sms/on-notify",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/patients/sms/on-notify', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/sms/on-notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/patients/sms/on-notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/patients/sms/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/patients/sms/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/patients/sms/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/sms/on-notify"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/patients/sms/on-notify"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/patients/sms/on-notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/patients/sms/on-notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/patients/sms/on-notify";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/patients/sms/on-notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/patients/sms/on-notify \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/patients/sms/on-notify
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/patients/sms/on-notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/patients/profile/share");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/patients/profile/share" {:headers {:authorization ""
:x-hip-id ""}
:content-type :json
:form-params {:patient {:hipCode "12345 (CounterId)"}
:requestId "499a5a4a-7dda-4f20-9b67-e24589627061"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/profile/share"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/patients/profile/share"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
},
Content = new StringContent("{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/patients/profile/share");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/patients/profile/share"
payload := strings.NewReader("{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/patients/profile/share HTTP/1.1
Authorization:
X-Hip-Id:
Content-Type: application/json
Host: example.com
Content-Length: 112
{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/patients/profile/share")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/patients/profile/share"))
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/patients/profile/share")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/patients/profile/share")
.header("authorization", "")
.header("x-hip-id", "")
.header("content-type", "application/json")
.body("{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.asString();
const data = JSON.stringify({
patient: {
hipCode: '12345 (CounterId)'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/patients/profile/share');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/share',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
patient: {hipCode: '12345 (CounterId)'},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/patients/profile/share';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"hipCode":"12345 (CounterId)"},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/patients/profile/share',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "patient": {\n "hipCode": "12345 (CounterId)"\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/patients/profile/share")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/patients/profile/share',
headers: {
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
patient: {hipCode: '12345 (CounterId)'},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/share',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: {
patient: {hipCode: '12345 (CounterId)'},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/patients/profile/share');
req.headers({
authorization: '',
'x-hip-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
patient: {
hipCode: '12345 (CounterId)'
},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/profile/share',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
data: {
patient: {hipCode: '12345 (CounterId)'},
requestId: '499a5a4a-7dda-4f20-9b67-e24589627061'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/patients/profile/share';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hip-id': '', 'content-type': 'application/json'},
body: '{"patient":{"hipCode":"12345 (CounterId)"},"requestId":"499a5a4a-7dda-4f20-9b67-e24589627061"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"patient": @{ @"hipCode": @"12345 (CounterId)" },
@"requestId": @"499a5a4a-7dda-4f20-9b67-e24589627061" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/patients/profile/share"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/patients/profile/share" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/patients/profile/share",
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([
'patient' => [
'hipCode' => '12345 (CounterId)'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/patients/profile/share', [
'body' => '{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/profile/share');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'patient' => [
'hipCode' => '12345 (CounterId)'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'patient' => [
'hipCode' => '12345 (CounterId)'
],
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/patients/profile/share');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/patients/profile/share' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/patients/profile/share' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/patients/profile/share", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/profile/share"
payload = {
"patient": { "hipCode": "12345 (CounterId)" },
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
headers = {
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/patients/profile/share"
payload <- "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/patients/profile/share")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/patients/profile/share') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.body = "{\n \"patient\": {\n \"hipCode\": \"12345 (CounterId)\"\n },\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/patients/profile/share";
let payload = json!({
"patient": json!({"hipCode": "12345 (CounterId)"}),
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/patients/profile/share \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--data '{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
echo '{
"patient": {
"hipCode": "12345 (CounterId)"
},
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}' | \
http POST {{baseUrl}}/v0.5/patients/profile/share \
authorization:'' \
content-type:application/json \
x-hip-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "patient": {\n "hipCode": "12345 (CounterId)"\n },\n "requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}' \
--output-document \
- {{baseUrl}}/v0.5/patients/profile/share
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"content-type": "application/json"
]
let parameters = [
"patient": ["hipCode": "12345 (CounterId)"],
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/patients/profile/share")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Identification result for a consent-manager user-id
{{baseUrl}}/v0.5/users/auth/on-fetch-modes
HEADERS
Authorization
X-HIP-ID
X-HIU-ID
BODY json
{
"auth": {
"modes": [],
"purpose": ""
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/on-fetch-modes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "x-hiu-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/on-fetch-modes" {:headers {:authorization ""
:x-hip-id ""
:x-hiu-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/on-fetch-modes"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/on-fetch-modes"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/on-fetch-modes");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/on-fetch-modes"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("x-hiu-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/on-fetch-modes HTTP/1.1
Authorization:
X-Hip-Id:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/on-fetch-modes")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/on-fetch-modes"))
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-fetch-modes")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/on-fetch-modes")
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/on-fetch-modes');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('x-hiu-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-fetch-modes',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/on-fetch-modes';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/on-fetch-modes',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-fetch-modes")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/on-fetch-modes',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-fetch-modes',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/on-fetch-modes');
req.headers({
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-fetch-modes',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/on-fetch-modes';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"x-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/on-fetch-modes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/on-fetch-modes" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/on-fetch-modes",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: ",
"x-hiu-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/on-fetch-modes', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/on-fetch-modes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/on-fetch-modes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/on-fetch-modes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/on-fetch-modes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/on-fetch-modes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/on-fetch-modes"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/on-fetch-modes"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/on-fetch-modes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/on-fetch-modes') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/on-fetch-modes";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("x-hiu-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/on-fetch-modes \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/on-fetch-modes \
authorization:'' \
content-type:application/json \
x-hip-id:'' \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/on-fetch-modes
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/on-fetch-modes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Response to user authentication initialization from HIP
{{baseUrl}}/v0.5/users/auth/on-init
HEADERS
Authorization
X-HIP-ID
X-HIU-ID
BODY json
{
"auth": {
"meta": {
"expiry": "",
"hint": ""
},
"mode": "",
"transactionId": ""
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/on-init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "x-hiu-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/on-init" {:headers {:authorization ""
:x-hip-id ""
:x-hiu-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/on-init"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/on-init"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/on-init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/on-init"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("x-hiu-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/on-init HTTP/1.1
Authorization:
X-Hip-Id:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/on-init")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/on-init"))
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/on-init")
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/on-init');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('x-hiu-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-init',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/on-init';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/on-init',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/on-init',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-init',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/on-init');
req.headers({
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-init',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/on-init';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"x-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/on-init"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/on-init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/on-init",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: ",
"x-hiu-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/on-init', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/on-init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/on-init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/on-init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/on-init"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/on-init"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/on-init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/on-init') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/on-init";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("x-hiu-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/on-init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/on-init \
authorization:'' \
content-type:application/json \
x-hip-id:'' \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/on-init
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/on-init")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
callback API for -auth-confirm (in case of MEDIATED auth) to confirm user authentication or not
{{baseUrl}}/v0.5/users/auth/on-confirm
HEADERS
Authorization
X-HIP-ID
X-HIU-ID
BODY json
{
"auth": {
"accessToken": "",
"patient": {
"address": {
"district": "",
"line": "",
"pincode": "",
"state": ""
},
"gender": "",
"id": "",
"identifiers": [
{
"type": "",
"value": ""
}
],
"name": "",
"yearOfBirth": 0
},
"validity": {
"expiry": "",
"limit": 0,
"purpose": "",
"requester": {
"id": "",
"type": ""
}
}
},
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/on-confirm");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "x-hiu-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/on-confirm" {:headers {:authorization ""
:x-hip-id ""
:x-hiu-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/on-confirm"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/on-confirm"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/on-confirm");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/on-confirm"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("x-hiu-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/on-confirm HTTP/1.1
Authorization:
X-Hip-Id:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/on-confirm")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/on-confirm"))
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/on-confirm")
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/on-confirm');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('x-hiu-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-confirm',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/on-confirm';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/on-confirm',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/on-confirm")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/on-confirm',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-confirm',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/on-confirm');
req.headers({
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/on-confirm',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/on-confirm';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"x-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/on-confirm"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/on-confirm" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/on-confirm",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: ",
"x-hiu-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/on-confirm', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/on-confirm');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/on-confirm');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/on-confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/on-confirm' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/on-confirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/on-confirm"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/on-confirm"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/on-confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/on-confirm') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/on-confirm";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("x-hiu-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/on-confirm \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/on-confirm \
authorization:'' \
content-type:application/json \
x-hip-id:'' \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/on-confirm
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/on-confirm")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
notification API in case of DIRECT mode of authentication by the CM
{{baseUrl}}/v0.5/users/auth/notify
HEADERS
Authorization
X-HIP-ID
X-HIU-ID
BODY json
{
"auth": {
"accessToken": "",
"patient": {
"address": {
"district": "",
"line": "",
"pincode": "",
"state": ""
},
"gender": "",
"id": "",
"identifiers": [
{
"type": "",
"value": ""
}
],
"name": "",
"yearOfBirth": 0
},
"status": "",
"transactionId": "",
"validity": {
"expiry": "",
"limit": 0,
"purpose": "",
"requester": {
"id": "",
"type": ""
}
}
},
"requestId": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/users/auth/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
headers = curl_slist_append(headers, "x-hip-id: ");
headers = curl_slist_append(headers, "x-hiu-id: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/users/auth/notify" {:headers {:authorization ""
:x-hip-id ""
:x-hiu-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/users/auth/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hip-id" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v0.5/users/auth/notify"),
Headers =
{
{ "authorization", "" },
{ "x-hip-id", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v0.5/users/auth/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hip-id", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/users/auth/notify"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
req.Header.Add("x-hip-id", "")
req.Header.Add("x-hiu-id", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v0.5/users/auth/notify HTTP/1.1
Authorization:
X-Hip-Id:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/users/auth/notify")
.setHeader("authorization", "")
.setHeader("x-hip-id", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/users/auth/notify"))
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/users/auth/notify")
.header("authorization", "")
.header("x-hip-id", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v0.5/users/auth/notify');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('x-hip-id', '');
xhr.setRequestHeader('x-hiu-id', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/notify',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/users/auth/notify';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v0.5/users/auth/notify',
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/users/auth/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hip-id", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v0.5/users/auth/notify',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/notify',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v0.5/users/auth/notify');
req.headers({
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/users/auth/notify',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
data: {requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v0.5/users/auth/notify';
const options = {
method: 'POST',
headers: {
authorization: '',
'x-hip-id': '',
'x-hiu-id': '',
'content-type': 'application/json'
},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"",
@"x-hip-id": @"",
@"x-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/users/auth/notify"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v0.5/users/auth/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hip-id", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/users/auth/notify",
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([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"x-hip-id: ",
"x-hiu-id: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v0.5/users/auth/notify', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hip-id' => '',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/users/auth/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/users/auth/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hip-id' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/users/auth/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hip-id", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/users/auth/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hip-id': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/users/auth/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/users/auth/notify"
payload = { "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd" }
headers = {
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/users/auth/notify"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hip-id' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/users/auth/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hip-id"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v0.5/users/auth/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hip-id'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v0.5/users/auth/notify";
let payload = json!({"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".parse().unwrap());
headers.insert("x-hip-id", "".parse().unwrap());
headers.insert("x-hiu-id", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v0.5/users/auth/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/users/auth/notify \
authorization:'' \
content-type:application/json \
x-hip-id:'' \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hip-id: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/users/auth/notify
import Foundation
let headers = [
"authorization": "",
"x-hip-id": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/users/auth/notify")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()