Health Repository Provider Specifications for HIU
Health Repository Provider Specifications for HIUv0.5
The following are the specifications for the APIs to be implemented at the Health Repository end if an entity is only serving the role of a HIU. The specs are essentially duplicates from the Gateway and Bridge, but put together so as to make it clear to HIUs which set of APIs they should implement to participate in the network. 1. The APIs are organized by the flows - identification, consent flow, data flow and monitoring. They represent the APIs that are expected to be available at the HIU end by the Gateway. 2. For majority of the APIs, if Gateway has initiated a call, there are…
- Endpoints
- 32 (29 POST, 3 GET)
- Base URL
https://dev.ndhm.gov.in/gateway- Authentication
- Not specified in spec
- Spec format
- OpenAPI 3.0.0
- API version
- 0.5
- Source
- apisetu.gov.in
- Provider
- ndhm.gov.in
- Categories
- Open Data
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttps://dev.ndhm.gov.in/gateway), then send requests.
POST
Consent notification (POST)
{{baseUrl}}/v0.5/consents/hiu/notify
HEADERS
Authorization
X-HIU-ID
BODY json
{
"notification": {
"consentArtefacts": [
{
"id": ""
}
],
"consentRequestId": "",
"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/hiu/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:notification {:consentRequestId ""}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consents/hiu/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify"
payload := strings.NewReader("{\n \"notification\": {\n \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/consents/hiu/notify HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 129
{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consents/hiu/notify")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notification\": {\n \"consentRequestId\": \"\"\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 \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hiu/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consents/hiu/notify")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"notification\": {\n \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
notification: {
consentRequestId: ''
},
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/hiu/notify');
xhr.setRequestHeader('authorization', '');
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/consents/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
notification: {consentRequestId: ''},
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/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"notification":{"consentRequestId":""},"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/hiu/notify',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "notification": {\n "consentRequestId": ""\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 \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consents/hiu/notify")
.post(body)
.addHeader("authorization", "")
.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/consents/hiu/notify',
headers: {
authorization: '',
'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({
notification: {consentRequestId: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consents/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
notification: {consentRequestId: ''},
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/hiu/notify');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
notification: {
consentRequestId: ''
},
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/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
notification: {consentRequestId: ''},
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/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"notification":{"consentRequestId":""},"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"notification": @{ @"consentRequestId": @"" },
@"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/hiu/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/hiu/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/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' => [
'consentRequestId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/consents/hiu/notify', [
'body' => '{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consents/hiu/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notification' => [
'consentRequestId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notification' => [
'consentRequestId' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consents/hiu/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consents/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consents/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notification\": {\n \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consents/hiu/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/hiu/notify"
payload = {
"notification": { "consentRequestId": "" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consents/hiu/notify"
payload <- "{\n \"notification\": {\n \"consentRequestId\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consents/hiu/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"notification\": {\n \"consentRequestId\": \"\"\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/hiu/notify";
let payload = json!({
"notification": json!({"consentRequestId": ""}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/consents/hiu/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"notification": {
"consentRequestId": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consents/hiu/notify \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "notification": {\n "consentRequestId": ""\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consents/hiu/notify
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"notification": ["consentRequestId": ""],
"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/hiu/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 consent request
{{baseUrl}}/v0.5/consent-requests/on-init
HEADERS
Authorization
X-HIU-ID
BODY json
{
"consentRequest": {
"id": ""
},
"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/consent-requests/on-init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:consentRequest {:id "f29f0e59-8388-4698-9fe6-05db67aeac46"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consent-requests/on-init"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init"
payload := strings.NewReader("{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/consent-requests/on-init HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 133
{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consent-requests/on-init")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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 \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consent-requests/on-init")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
consentRequest: {
id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'
},
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/consent-requests/on-init');
xhr.setRequestHeader('authorization', '');
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/consent-requests/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consentRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'},
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/consent-requests/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consentRequest":{"id":"f29f0e59-8388-4698-9fe6-05db67aeac46"},"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/consent-requests/on-init',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "consentRequest": {\n "id": "f29f0e59-8388-4698-9fe6-05db67aeac46"\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 \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/on-init")
.post(body)
.addHeader("authorization", "")
.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/consent-requests/on-init',
headers: {
authorization: '',
'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({
consentRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consent-requests/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
consentRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'},
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/consent-requests/on-init');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
consentRequest: {
id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'
},
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/consent-requests/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consentRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'},
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/consent-requests/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consentRequest":{"id":"f29f0e59-8388-4698-9fe6-05db67aeac46"},"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"consentRequest": @{ @"id": @"f29f0e59-8388-4698-9fe6-05db67aeac46" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/consent-requests/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/consent-requests/on-init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/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([
'consentRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/consent-requests/on-init', [
'body' => '{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consent-requests/on-init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'consentRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'consentRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consent-requests/on-init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consent-requests/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consent-requests/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consent-requests/on-init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consent-requests/on-init"
payload = {
"consentRequest": { "id": "f29f0e59-8388-4698-9fe6-05db67aeac46" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consent-requests/on-init"
payload <- "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consent-requests/on-init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"consentRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/consent-requests/on-init";
let payload = json!({
"consentRequest": json!({"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/consent-requests/on-init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"consentRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consent-requests/on-init \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "consentRequest": {\n "id": "f29f0e59-8388-4698-9fe6-05db67aeac46"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consent-requests/on-init
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"consentRequest": ["id": "f29f0e59-8388-4698-9fe6-05db67aeac46"],
"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/consent-requests/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
Result of consent request status
{{baseUrl}}/v0.5/consent-requests/on-status
HEADERS
Authorization
X-HIU-ID
BODY json
{
"consentRequest": {
"consentArtefacts": [
{
"id": ""
}
],
"id": "",
"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/consent-requests/on-status");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:consentRequest {:id ""}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consent-requests/on-status"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status"
payload := strings.NewReader("{\n \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/consent-requests/on-status HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consent-requests/on-status")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"consentRequest\": {\n \"id\": \"\"\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 \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/on-status")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consent-requests/on-status")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
consentRequest: {
id: ''
},
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/consent-requests/on-status');
xhr.setRequestHeader('authorization', '');
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/consent-requests/on-status',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consentRequest: {id: ''},
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/consent-requests/on-status';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consentRequest":{"id":""},"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/consent-requests/on-status',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "consentRequest": {\n "id": ""\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 \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/on-status")
.post(body)
.addHeader("authorization", "")
.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/consent-requests/on-status',
headers: {
authorization: '',
'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({
consentRequest: {id: ''},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consent-requests/on-status',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
consentRequest: {id: ''},
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/consent-requests/on-status');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
consentRequest: {
id: ''
},
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/consent-requests/on-status',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consentRequest: {id: ''},
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/consent-requests/on-status';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consentRequest":{"id":""},"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"consentRequest": @{ @"id": @"" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/consent-requests/on-status"]
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/consent-requests/on-status" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status",
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([
'consentRequest' => [
'id' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/consent-requests/on-status', [
'body' => '{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consent-requests/on-status');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'consentRequest' => [
'id' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'consentRequest' => [
'id' => ''
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consent-requests/on-status');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consent-requests/on-status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consent-requests/on-status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consent-requests/on-status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consent-requests/on-status"
payload = {
"consentRequest": { "id": "" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consent-requests/on-status"
payload <- "{\n \"consentRequest\": {\n \"id\": \"\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consent-requests/on-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"consentRequest\": {\n \"id\": \"\"\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/consent-requests/on-status";
let payload = json!({
"consentRequest": json!({"id": ""}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/consent-requests/on-status \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"consentRequest": {
"id": ""
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consent-requests/on-status \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "consentRequest": {\n "id": ""\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consent-requests/on-status
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"consentRequest": ["id": ""],
"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/consent-requests/on-status")! 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
Result of fetch request for a consent artefact
{{baseUrl}}/v0.5/consents/on-fetch
HEADERS
Authorization
X-HIU-ID
BODY json
{
"consent": {
"consentDetail": {
"careContexts": [
{
"careContextReference": "",
"patientReference": ""
}
],
"consentId": "",
"consentManager": {},
"createdAt": "",
"hiTypes": [],
"hip": {},
"hiu": {},
"patient": {
"id": ""
},
"permission": {
"accessMode": "",
"dataEraseAt": "",
"dateRange": {
"from": "",
"to": ""
},
"frequency": {
"repeats": 0,
"unit": "",
"value": 0
}
},
"purpose": {
"code": "",
"refUri": "",
"text": ""
},
"requester": {
"identifier": {
"system": "",
"type": "",
"value": ""
},
"name": ""
},
"schemaVersion": ""
},
"signature": "",
"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/on-fetch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"consent\": {\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/on-fetch" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:consent {: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/on-fetch"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"consent\": {\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/on-fetch"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"consent\": {\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/on-fetch");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"consent\": {\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/on-fetch"
payload := strings.NewReader("{\n \"consent\": {\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-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/consents/on-fetch HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 156
{
"consent": {
"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/on-fetch")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"consent\": {\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/on-fetch"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"consent\": {\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 \"consent\": {\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/on-fetch")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/consents/on-fetch")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"consent\": {\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({
consent: {
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/on-fetch');
xhr.setRequestHeader('authorization', '');
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/consents/on-fetch',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consent: {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/on-fetch';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consent":{"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/on-fetch',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "consent": {\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 \"consent\": {\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/on-fetch")
.post(body)
.addHeader("authorization", "")
.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/consents/on-fetch',
headers: {
authorization: '',
'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({
consent: {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/on-fetch',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
consent: {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/on-fetch');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
consent: {
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/on-fetch',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
consent: {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/on-fetch';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"consent":{"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"consent": @{ @"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/on-fetch"]
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/on-fetch" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"consent\": {\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/on-fetch",
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([
'consent' => [
'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-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/consents/on-fetch', [
'body' => '{
"consent": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consents/on-fetch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'consent' => [
'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([
'consent' => [
'signature' => 'Signature of CM as defined in W3C standards; Base64 encoded'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consents/on-fetch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/consents/on-fetch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consent": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/consents/on-fetch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"consent": {
"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 \"consent\": {\n \"signature\": \"Signature of CM as defined in W3C standards; Base64 encoded\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consents/on-fetch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/on-fetch"
payload = {
"consent": { "signature": "Signature of CM as defined in W3C standards; Base64 encoded" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/consents/on-fetch"
payload <- "{\n \"consent\": {\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-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/consents/on-fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"consent\": {\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/on-fetch') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"consent\": {\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/on-fetch";
let payload = json!({
"consent": 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-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/consents/on-fetch \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"consent": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"consent": {
"signature": "Signature of CM as defined in W3C standards; Base64 encoded"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/consents/on-fetch \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "consent": {\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/on-fetch
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"consent": ["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/on-fetch")! 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/hiu/on-request
HEADERS
Authorization
X-HIU-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/hiu/on-request");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:hiRequest {:transactionId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}
:requestId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/hiu/on-request"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request"
payload := strings.NewReader("{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/health-information/hiu/on-request HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 141
{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/hiu/on-request")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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 \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hiu/on-request")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/health-information/hiu/on-request")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.asString();
const data = JSON.stringify({
hiRequest: {
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '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/hiu/on-request');
xhr.setRequestHeader('authorization', '');
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/health-information/hiu/on-request',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
hiRequest: {transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'},
requestId: '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/hiu/on-request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"hiRequest":{"transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"},"requestId":"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/hiu/on-request',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "hiRequest": {\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n },\n "requestId": "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 \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/hiu/on-request")
.post(body)
.addHeader("authorization", "")
.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/health-information/hiu/on-request',
headers: {
authorization: '',
'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({
hiRequest: {transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'},
requestId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/hiu/on-request',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
hiRequest: {transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'},
requestId: '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/hiu/on-request');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
hiRequest: {
transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
},
requestId: '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/hiu/on-request',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
hiRequest: {transactionId: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'},
requestId: '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/hiu/on-request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"hiRequest":{"transactionId":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"},"requestId":"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hiRequest": @{ @"transactionId": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d" },
@"requestId": @"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/hiu/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/hiu/on-request" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/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([
'hiRequest' => [
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/health-information/hiu/on-request', [
'body' => '{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/hiu/on-request');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hiRequest' => [
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hiRequest' => [
'transactionId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
],
'requestId' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/hiu/on-request');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/health-information/hiu/on-request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/health-information/hiu/on-request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/hiu/on-request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/hiu/on-request"
payload = {
"hiRequest": { "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d" },
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/health-information/hiu/on-request"
payload <- "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/health-information/hiu/on-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"hiRequest\": {\n \"transactionId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n },\n \"requestId\": \"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/hiu/on-request";
let payload = json!({
"hiRequest": json!({"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}),
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/health-information/hiu/on-request \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
echo '{
"hiRequest": {
"transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
},
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}' | \
http POST {{baseUrl}}/v0.5/health-information/hiu/on-request \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "hiRequest": {\n "transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n },\n "requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/hiu/on-request
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"hiRequest": ["transactionId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"],
"requestId": "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/hiu/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
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
Callback API for -subscription-requests-hiu-notify to acknowledge receipt of notification.
{{baseUrl}}/v0.5/subscription-requests/hiu/on-notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"acknowledgement": {
"status": "",
"subscriptionRequestId": ""
},
"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/subscription-requests/hiu/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 \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:acknowledgement {:subscriptionRequestId "subscription Id"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/on-notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/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 \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify"
payload := strings.NewReader("{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 132
{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscription-requests/hiu/on-notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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 \"subscriptionRequestId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/on-notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
acknowledgement: {
subscriptionRequestId: 'subscription Id'
},
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/subscription-requests/hiu/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/subscription-requests/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {subscriptionRequestId: 'subscription Id'},
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/subscription-requests/hiu/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"subscriptionRequestId":"subscription Id"},"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/subscription-requests/hiu/on-notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "acknowledgement": {\n "subscriptionRequestId": "subscription Id"\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 \"subscriptionRequestId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/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: {subscriptionRequestId: 'subscription Id'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscription-requests/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
acknowledgement: {subscriptionRequestId: 'subscription Id'},
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/subscription-requests/hiu/on-notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
acknowledgement: {
subscriptionRequestId: 'subscription Id'
},
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/subscription-requests/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {subscriptionRequestId: 'subscription Id'},
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/subscription-requests/hiu/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"subscriptionRequestId":"subscription Id"},"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": @{ @"subscriptionRequestId": @"subscription Id" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/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 \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/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' => [
'subscriptionRequestId' => 'subscription Id'
],
'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/subscription-requests/hiu/on-notify', [
'body' => '{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/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' => [
'subscriptionRequestId' => 'subscription Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acknowledgement' => [
'subscriptionRequestId' => 'subscription Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"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/subscription-requests/hiu/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscription-requests/hiu/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/on-notify"
payload = {
"acknowledgement": { "subscriptionRequestId": "subscription Id" },
"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/subscription-requests/hiu/on-notify"
payload <- "{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/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 \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"acknowledgement\": {\n \"subscriptionRequestId\": \"subscription Id\"\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/subscription-requests/hiu/on-notify";
let payload = json!({
"acknowledgement": json!({"subscriptionRequestId": "subscription Id"}),
"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/subscription-requests/hiu/on-notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"acknowledgement": {
"subscriptionRequestId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/subscription-requests/hiu/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 "subscriptionRequestId": "subscription Id"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscription-requests/hiu/on-notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"acknowledgement": ["subscriptionRequestId": "subscription Id"],
"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/subscription-requests/hiu/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
Callback API for -subscriptions-hiu-notify to acknowledge receipt of notification.
{{baseUrl}}/v0.5/subscriptions/hiu/on-notify
HEADERS
Authorization
X-CM-ID
BODY json
{
"acknowledgement": {
"eventId": "",
"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/subscriptions/hiu/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 \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:acknowledgement {:eventId "subscription event Id"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscriptions/hiu/on-notify"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/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 \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify"
payload := strings.NewReader("{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 124
{
"acknowledgement": {
"eventId": "subscription event Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscriptions/hiu/on-notify")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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 \"eventId\": \"subscription event Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscriptions/hiu/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/subscriptions/hiu/on-notify")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
acknowledgement: {
eventId: 'subscription event Id'
},
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/subscriptions/hiu/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/subscriptions/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {eventId: 'subscription event Id'},
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/subscriptions/hiu/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"eventId":"subscription event Id"},"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/subscriptions/hiu/on-notify',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "acknowledgement": {\n "eventId": "subscription event Id"\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 \"eventId\": \"subscription event Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscriptions/hiu/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/subscriptions/hiu/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: {eventId: 'subscription event Id'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscriptions/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {
acknowledgement: {eventId: 'subscription event Id'},
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/subscriptions/hiu/on-notify');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
acknowledgement: {
eventId: 'subscription event Id'
},
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/subscriptions/hiu/on-notify',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {
acknowledgement: {eventId: 'subscription event Id'},
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/subscriptions/hiu/on-notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"acknowledgement":{"eventId":"subscription event Id"},"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": @{ @"eventId": @"subscription event Id" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscriptions/hiu/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/subscriptions/hiu/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 \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/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' => [
'eventId' => 'subscription event Id'
],
'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/subscriptions/hiu/on-notify', [
'body' => '{
"acknowledgement": {
"eventId": "subscription event Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscriptions/hiu/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' => [
'eventId' => 'subscription event Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'acknowledgement' => [
'eventId' => 'subscription event Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscriptions/hiu/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/subscriptions/hiu/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"eventId": "subscription event Id"
},
"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/subscriptions/hiu/on-notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"acknowledgement": {
"eventId": "subscription event Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscriptions/hiu/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscriptions/hiu/on-notify"
payload = {
"acknowledgement": { "eventId": "subscription event Id" },
"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/subscriptions/hiu/on-notify"
payload <- "{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/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 \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"acknowledgement\": {\n \"eventId\": \"subscription event Id\"\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/subscriptions/hiu/on-notify";
let payload = json!({
"acknowledgement": json!({"eventId": "subscription event Id"}),
"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/subscriptions/hiu/on-notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"acknowledgement": {
"eventId": "subscription event Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"acknowledgement": {
"eventId": "subscription event Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/subscriptions/hiu/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 "eventId": "subscription event Id"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscriptions/hiu/on-notify
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = [
"acknowledgement": ["eventId": "subscription event Id"],
"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/subscriptions/hiu/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
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/hiu/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/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/hiu/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/consents/hiu/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/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/hiu/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/consents/hiu/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/consents/hiu/on-notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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/consents/hiu/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
Create consent request
{{baseUrl}}/v0.5/consent-requests/init
HEADERS
Authorization
X-CM-ID
BODY json
{
"consent": {
"careContexts": [
{
"careContextReference": "",
"patientReference": ""
}
],
"hiTypes": [],
"hip": {},
"hiu": {},
"patient": {},
"permission": {
"accessMode": "",
"dataEraseAt": "",
"dateRange": {
"from": "",
"to": ""
},
"frequency": {
"repeats": 0,
"unit": "",
"value": 0
}
},
"purpose": {
"code": "",
"refUri": "",
"text": ""
},
"requester": {
"identifier": {
"system": "",
"type": "",
"value": ""
},
"name": ""
}
},
"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/consent-requests/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\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/consent-requests/init" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "499a5a4a-7dda-4f20-9b67-e24589627061"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consent-requests/init"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\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/consent-requests/init"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\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/consent-requests/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\": \"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/consent-requests/init"
payload := strings.NewReader("{\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/consent-requests/init HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/consent-requests/init")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\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/consent-requests/init"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/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/consent-requests/init")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.asString();
const data = JSON.stringify({
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/consent-requests/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/consent-requests/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {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/consent-requests/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"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/consent-requests/init',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/consent-requests/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/consent-requests/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: '499a5a4a-7dda-4f20-9b67-e24589627061'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/consent-requests/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {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/consent-requests/init');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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/consent-requests/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {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/consent-requests/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"requestId": @"499a5a4a-7dda-4f20-9b67-e24589627061" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/consent-requests/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/consent-requests/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\": \"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/consent-requests/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' => '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/consent-requests/init', [
'body' => '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consent-requests/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' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/consent-requests/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/consent-requests/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"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/consent-requests/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/consent-requests/init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consent-requests/init"
payload = { "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/consent-requests/init"
payload <- "{\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/consent-requests/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\": \"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/consent-requests/init') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\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/consent-requests/init";
let payload = json!({"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/consent-requests/init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
echo '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}' | \
http POST {{baseUrl}}/v0.5/consent-requests/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": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}' \
--output-document \
- {{baseUrl}}/v0.5/consent-requests/init
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["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/consent-requests/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
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()
POST
Get consent artefact
{{baseUrl}}/v0.5/consents/fetch
HEADERS
Authorization
X-CM-ID
BODY json
{
"consentId": "",
"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/fetch");
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/consents/fetch" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consents/fetch"
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/consents/fetch"),
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/consents/fetch");
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/consents/fetch"
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/consents/fetch 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/consents/fetch")
.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/consents/fetch"))
.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/consents/fetch")
.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/fetch")
.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/consents/fetch');
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/fetch',
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/consents/fetch';
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/consents/fetch',
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/consents/fetch")
.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/fetch',
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/consents/fetch',
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/consents/fetch');
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/consents/fetch',
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/consents/fetch';
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/consents/fetch"]
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/fetch" 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/consents/fetch",
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/consents/fetch', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consents/fetch');
$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/consents/fetch');
$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/fetch' -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/consents/fetch' -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/consents/fetch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consents/fetch"
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/consents/fetch"
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/consents/fetch")
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/consents/fetch') 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/consents/fetch";
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/consents/fetch \
--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/consents/fetch \
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/consents/fetch
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/consents/fetch")! 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 consent request status
{{baseUrl}}/v0.5/consent-requests/status
HEADERS
Authorization
X-CM-ID
BODY json
{
"consentRequestId": "",
"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/consent-requests/status");
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/consent-requests/status" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/consent-requests/status"
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/consent-requests/status"),
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/consent-requests/status");
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/consent-requests/status"
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/consent-requests/status 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/consent-requests/status")
.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/consent-requests/status"))
.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/consent-requests/status")
.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/consent-requests/status")
.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/consent-requests/status');
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/consent-requests/status',
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/consent-requests/status';
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/consent-requests/status',
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/consent-requests/status")
.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/consent-requests/status',
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/consent-requests/status',
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/consent-requests/status');
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/consent-requests/status',
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/consent-requests/status';
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/consent-requests/status"]
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/consent-requests/status" 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/consent-requests/status",
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/consent-requests/status', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/consent-requests/status');
$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/consent-requests/status');
$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/consent-requests/status' -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/consent-requests/status' -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/consent-requests/status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/consent-requests/status"
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/consent-requests/status"
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/consent-requests/status")
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/consent-requests/status') 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/consent-requests/status";
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/consent-requests/status \
--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/consent-requests/status \
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/consent-requests/status
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/consent-requests/status")! 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 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/cm/request
HEADERS
Authorization
X-CM-ID
BODY json
{
"hiRequest": {
"consent": {
"id": ""
},
"dataPushUrl": "",
"dateRange": {
"from": "",
"to": ""
},
"keyMaterial": {
"cryptoAlg": "",
"curve": "",
"dhPublicKey": {
"expiry": "",
"keyValue": "",
"parameters": ""
},
"nonce": ""
}
},
"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/cm/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\": \"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/cm/request" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"}})
require "http/client"
url = "{{baseUrl}}/v0.5/health-information/cm/request"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"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/cm/request"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"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/cm/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\": \"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/cm/request"
payload := strings.NewReader("{\n \"requestId\": \"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/health-information/cm/request HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 58
{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/health-information/cm/request")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"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/cm/request"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"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}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/cm/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/cm/request")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}")
.asString();
const data = JSON.stringify({
requestId: '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/cm/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/cm/request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '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/cm/request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"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/cm/request',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "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}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/health-information/cm/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/cm/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: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/health-information/cm/request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {requestId: '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/cm/request');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '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/cm/request',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {requestId: '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/cm/request';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"requestId":"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": @"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/cm/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/cm/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\": \"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/cm/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'
]),
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/cm/request', [
'body' => '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/health-information/cm/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' => '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'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/health-information/cm/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/cm/request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "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/health-information/cm/request' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/health-information/cm/request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/health-information/cm/request"
payload = { "requestId": "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/health-information/cm/request"
payload <- "{\n \"requestId\": \"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/health-information/cm/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\": \"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/cm/request') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\n \"requestId\": \"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/cm/request";
let payload = json!({"requestId": "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/health-information/cm/request \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}'
echo '{
"requestId": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
}' | \
http POST {{baseUrl}}/v0.5/health-information/cm/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": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"\n}' \
--output-document \
- {{baseUrl}}/v0.5/health-information/cm/request
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["requestId": "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/cm/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
Identify a patient by her consent-manager user-id
{{baseUrl}}/v0.5/patients/find
HEADERS
Authorization
X-CM-ID
BODY json
{
"query": {
"patient": {
"id": ""
},
"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/patients/find");
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/patients/find" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/find"
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/patients/find"),
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/patients/find");
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/patients/find"
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/patients/find 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/patients/find")
.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/patients/find"))
.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/patients/find")
.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/find")
.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/patients/find');
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/find',
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/patients/find';
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/patients/find',
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/patients/find")
.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/find',
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/patients/find',
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/patients/find');
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/patients/find',
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/patients/find';
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/patients/find"]
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/find" 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/patients/find",
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/patients/find', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/find');
$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/patients/find');
$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/find' -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/patients/find' -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/patients/find", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/find"
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/patients/find"
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/patients/find")
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/patients/find') 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/patients/find";
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/patients/find \
--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/patients/find \
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/patients/find
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/patients/find")! 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
Request for subscription
{{baseUrl}}/v0.5/subscription-requests/cm/init
HEADERS
Authorization
X-CM-ID
BODY json
{
"requestId": "",
"subscription": {
"categories": [],
"hips": [
{
"id": ""
}
],
"hiu": {},
"patient": {
"id": ""
},
"period": {
"from": "",
"to": ""
},
"purpose": {
"code": "",
"refUri": "",
"text": ""
}
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/subscription-requests/cm/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\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/subscription-requests/cm/init" {:headers {:authorization ""
:x-cm-id ""}
:content-type :json
:form-params {:requestId "499a5a4a-7dda-4f20-9b67-e24589627061"}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscription-requests/cm/init"
headers = HTTP::Headers{
"authorization" => ""
"x-cm-id" => ""
"content-type" => "application/json"
}
reqBody = "{\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/subscription-requests/cm/init"),
Headers =
{
{ "authorization", "" },
{ "x-cm-id", "" },
},
Content = new StringContent("{\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/subscription-requests/cm/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\": \"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/subscription-requests/cm/init"
payload := strings.NewReader("{\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/subscription-requests/cm/init HTTP/1.1
Authorization:
X-Cm-Id:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscription-requests/cm/init")
.setHeader("authorization", "")
.setHeader("x-cm-id", "")
.setHeader("content-type", "application/json")
.setBody("{\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/subscription-requests/cm/init"))
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/cm/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/subscription-requests/cm/init")
.header("authorization", "")
.header("x-cm-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
.asString();
const data = JSON.stringify({
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/subscription-requests/cm/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/subscription-requests/cm/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {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/subscription-requests/cm/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"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/subscription-requests/cm/init',
method: 'POST',
headers: {
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/cm/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/subscription-requests/cm/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: '499a5a4a-7dda-4f20-9b67-e24589627061'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscription-requests/cm/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: {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/subscription-requests/cm/init');
req.headers({
authorization: '',
'x-cm-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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/subscription-requests/cm/init',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
data: {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/subscription-requests/cm/init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-cm-id': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"requestId": @"499a5a4a-7dda-4f20-9b67-e24589627061" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscription-requests/cm/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/subscription-requests/cm/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\": \"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/subscription-requests/cm/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' => '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/subscription-requests/cm/init', [
'body' => '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-cm-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscription-requests/cm/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' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '499a5a4a-7dda-4f20-9b67-e24589627061'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscription-requests/cm/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/subscription-requests/cm/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"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/subscription-requests/cm/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"499a5a4a-7dda-4f20-9b67-e24589627061\"\n}"
headers = {
'authorization': "",
'x-cm-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscription-requests/cm/init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscription-requests/cm/init"
payload = { "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/subscription-requests/cm/init"
payload <- "{\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/subscription-requests/cm/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\": \"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/subscription-requests/cm/init') do |req|
req.headers['authorization'] = ''
req.headers['x-cm-id'] = ''
req.body = "{\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/subscription-requests/cm/init";
let payload = json!({"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/subscription-requests/cm/init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-cm-id: ' \
--data '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}'
echo '{
"requestId": "499a5a4a-7dda-4f20-9b67-e24589627061"
}' | \
http POST {{baseUrl}}/v0.5/subscription-requests/cm/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": "499a5a4a-7dda-4f20-9b67-e24589627061"\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscription-requests/cm/init
import Foundation
let headers = [
"authorization": "",
"x-cm-id": "",
"content-type": "application/json"
]
let parameters = ["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/subscription-requests/cm/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 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
Identification result for a consent-manager user-id
{{baseUrl}}/v0.5/patients/on-find
HEADERS
Authorization
BODY json
{
"error": {
"code": 0,
"message": ""
},
"patient": {
"id": "",
"name": ""
},
"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/patients/on-find");
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 \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find" {:headers {:authorization ""}
:content-type :json
:form-params {:patient {:id "hinapatel79@ndhm"
:name "Hina Patel"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/patients/on-find"
headers = HTTP::Headers{
"authorization" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find"),
Headers =
{
{ "authorization", "" },
},
Content = new StringContent("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find"
payload := strings.NewReader("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\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/patients/on-find HTTP/1.1
Authorization:
Content-Type: application/json
Host: example.com
Content-Length: 132
{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/patients/on-find")
.setHeader("authorization", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find"))
.header("authorization", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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 \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/patients/on-find")
.post(body)
.addHeader("authorization", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/patients/on-find")
.header("authorization", "")
.header("content-type", "application/json")
.body("{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
patient: {
id: 'hinapatel79@ndhm',
name: 'Hina Patel'
},
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/on-find');
xhr.setRequestHeader('authorization', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/on-find',
headers: {authorization: '', 'content-type': 'application/json'},
data: {
patient: {id: 'hinapatel79@ndhm', name: 'Hina Patel'},
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/on-find';
const options = {
method: 'POST',
headers: {authorization: '', 'content-type': 'application/json'},
body: '{"patient":{"id":"hinapatel79@ndhm","name":"Hina Patel"},"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/on-find',
method: 'POST',
headers: {
authorization: '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "patient": {\n "id": "hinapatel79@ndhm",\n "name": "Hina Patel"\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 \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/patients/on-find")
.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/patients/on-find',
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({
patient: {id: 'hinapatel79@ndhm', name: 'Hina Patel'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/patients/on-find',
headers: {authorization: '', 'content-type': 'application/json'},
body: {
patient: {id: 'hinapatel79@ndhm', name: 'Hina Patel'},
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/on-find');
req.headers({
authorization: '',
'content-type': 'application/json'
});
req.type('json');
req.send({
patient: {
id: 'hinapatel79@ndhm',
name: 'Hina Patel'
},
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/on-find',
headers: {authorization: '', 'content-type': 'application/json'},
data: {
patient: {id: 'hinapatel79@ndhm', name: 'Hina Patel'},
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/on-find';
const options = {
method: 'POST',
headers: {authorization: '', 'content-type': 'application/json'},
body: '{"patient":{"id":"hinapatel79@ndhm","name":"Hina Patel"},"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": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"patient": @{ @"id": @"hinapatel79@ndhm", @"name": @"Hina Patel" },
@"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/on-find"]
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/on-find" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find",
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',
'name' => 'Hina Patel'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
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/patients/on-find', [
'body' => '{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/patients/on-find');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'patient' => [
'id' => 'hinapatel79@ndhm',
'name' => 'Hina Patel'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'patient' => [
'id' => 'hinapatel79@ndhm',
'name' => 'Hina Patel'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/patients/on-find');
$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/patients/on-find' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/patients/on-find' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/patients/on-find", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/patients/on-find"
payload = {
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/patients/on-find"
payload <- "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\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/patients/on-find")
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 \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find') do |req|
req.headers['authorization'] = ''
req.body = "{\n \"patient\": {\n \"id\": \"hinapatel79@ndhm\",\n \"name\": \"Hina Patel\"\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/on-find";
let payload = json!({
"patient": json!({
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
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/patients/on-find \
--header 'authorization: ' \
--header 'content-type: application/json' \
--data '{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"patient": {
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/patients/on-find \
authorization:'' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'content-type: application/json' \
--body-data '{\n "patient": {\n "id": "hinapatel79@ndhm",\n "name": "Hina Patel"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/patients/on-find
import Foundation
let headers = [
"authorization": "",
"content-type": "application/json"
]
let parameters = [
"patient": [
"id": "hinapatel79@ndhm",
"name": "Hina Patel"
],
"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/on-find")! 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 (GET)
{{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
Notification for subscription grant-deny-revoke
{{baseUrl}}/v0.5/subscription-requests/hiu/notify
HEADERS
Authorization
X-HIU-ID
BODY json
{
"notification": {
"status": "",
"subscription": {
"hiu": {
"id": ""
},
"id": "",
"patient": {
"id": ""
},
"sources": [
{
"categories": [],
"hip": {},
"period": {
"from": "",
"to": ""
}
}
]
},
"subscriptionRequestId": ""
},
"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/subscription-requests/hiu/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:notification {:subscriptionRequestId "request id of the subscription"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify"
payload := strings.NewReader("{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/subscription-requests/hiu/notify HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 144
{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscription-requests/hiu/notify")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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 \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/subscription-requests/hiu/notify")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
notification: {
subscriptionRequestId: 'request id of the subscription'
},
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/subscription-requests/hiu/notify');
xhr.setRequestHeader('authorization', '');
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/subscription-requests/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
notification: {subscriptionRequestId: 'request id of the subscription'},
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/subscription-requests/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"notification":{"subscriptionRequestId":"request id of the subscription"},"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/subscription-requests/hiu/notify',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "notification": {\n "subscriptionRequestId": "request id of the subscription"\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 \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/notify")
.post(body)
.addHeader("authorization", "")
.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/subscription-requests/hiu/notify',
headers: {
authorization: '',
'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({
notification: {subscriptionRequestId: 'request id of the subscription'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscription-requests/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
notification: {subscriptionRequestId: 'request id of the subscription'},
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/subscription-requests/hiu/notify');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
notification: {
subscriptionRequestId: 'request id of the subscription'
},
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/subscription-requests/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
notification: {subscriptionRequestId: 'request id of the subscription'},
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/subscription-requests/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"notification":{"subscriptionRequestId":"request id of the subscription"},"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"notification": @{ @"subscriptionRequestId": @"request id of the subscription" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/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' => [
'subscriptionRequestId' => 'request id of the subscription'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/subscription-requests/hiu/notify', [
'body' => '{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notification' => [
'subscriptionRequestId' => 'request id of the subscription'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notification' => [
'subscriptionRequestId' => 'request id of the subscription'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/subscription-requests/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/subscription-requests/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscription-requests/hiu/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/notify"
payload = {
"notification": { "subscriptionRequestId": "request id of the subscription" },
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/subscription-requests/hiu/notify"
payload <- "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/subscription-requests/hiu/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"notification\": {\n \"subscriptionRequestId\": \"request id of the subscription\"\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/subscription-requests/hiu/notify";
let payload = json!({
"notification": json!({"subscriptionRequestId": "request id of the subscription"}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/subscription-requests/hiu/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"notification": {
"subscriptionRequestId": "request id of the subscription"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/subscription-requests/hiu/notify \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "notification": {\n "subscriptionRequestId": "request id of the subscription"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscription-requests/hiu/notify
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"notification": ["subscriptionRequestId": "request id of the subscription"],
"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/subscription-requests/hiu/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
Notification to HIU on basis of a granted subscription
{{baseUrl}}/v0.5/subscriptions/hiu/notify
HEADERS
Authorization
X-HIU-ID
BODY json
{
"event": {
"category": "",
"content": {
"context": [
{
"careContext": {
"careContextReference": "",
"patientReference": ""
},
"hiTypes": []
}
],
"hip": {
"id": ""
},
"patient": {
"id": ""
}
},
"id": "",
"published": "",
"subscriptionId": ""
},
"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/subscriptions/hiu/notify");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:event {:id "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d"
:subscriptionId "subscription Id"}
:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscriptions/hiu/notify"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify"
payload := strings.NewReader("{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/subscriptions/hiu/notify HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 166
{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscriptions/hiu/notify")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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 \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscriptions/hiu/notify")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/subscriptions/hiu/notify")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
.asString();
const data = JSON.stringify({
event: {
id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
subscriptionId: 'subscription Id'
},
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/subscriptions/hiu/notify');
xhr.setRequestHeader('authorization', '');
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/subscriptions/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
event: {id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d', subscriptionId: 'subscription Id'},
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/subscriptions/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"event":{"id":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","subscriptionId":"subscription Id"},"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/subscriptions/hiu/notify',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "event": {\n "id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "subscriptionId": "subscription Id"\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 \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscriptions/hiu/notify")
.post(body)
.addHeader("authorization", "")
.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/subscriptions/hiu/notify',
headers: {
authorization: '',
'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({
event: {id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d', subscriptionId: 'subscription Id'},
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscriptions/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
event: {id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d', subscriptionId: 'subscription Id'},
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/subscriptions/hiu/notify');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
event: {
id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
subscriptionId: 'subscription Id'
},
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/subscriptions/hiu/notify',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
event: {id: 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d', subscriptionId: 'subscription Id'},
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/subscriptions/hiu/notify';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"event":{"id":"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d","subscriptionId":"subscription Id"},"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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"event": @{ @"id": @"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d", @"subscriptionId": @"subscription Id" },
@"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscriptions/hiu/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/subscriptions/hiu/notify" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/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([
'event' => [
'id' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'subscriptionId' => 'subscription Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/subscriptions/hiu/notify', [
'body' => '{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscriptions/hiu/notify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'event' => [
'id' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'subscriptionId' => 'subscription Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'event' => [
'id' => 'a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d',
'subscriptionId' => 'subscription Id'
],
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd'
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscriptions/hiu/notify');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/subscriptions/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/subscriptions/hiu/notify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscriptions/hiu/notify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscriptions/hiu/notify"
payload = {
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/subscriptions/hiu/notify"
payload <- "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\n },\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/subscriptions/hiu/notify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"event\": {\n \"id\": \"a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d\",\n \"subscriptionId\": \"subscription Id\"\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/subscriptions/hiu/notify";
let payload = json!({
"event": json!({
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
}),
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/subscriptions/hiu/notify \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}'
echo '{
"event": {
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
},
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"
}' | \
http POST {{baseUrl}}/v0.5/subscriptions/hiu/notify \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "event": {\n "id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",\n "subscriptionId": "subscription Id"\n },\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd"\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscriptions/hiu/notify
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"event": [
"id": "a1s2c932-2f70-3ds3-a3b5-2sfd46b12a18d",
"subscriptionId": "subscription Id"
],
"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/subscriptions/hiu/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
callback API for the -subscription-requests-cm-init to notify a HIU on acceptance-acknowledgement of the request for subscription.
{{baseUrl}}/v0.5/subscription-requests/hiu/on-init
HEADERS
Authorization
X-HIU-ID
BODY json
{
"error": {
"code": 0,
"message": ""
},
"requestId": "",
"resp": {
"requestId": ""
},
"subscriptionRequest": {
"id": ""
},
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: ");
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 \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init" {:headers {:authorization ""
:x-hiu-id ""}
:content-type :json
:form-params {:requestId "5f7a535d-a3fd-416b-b069-c97d021fbacd"
:subscriptionRequest {:id "f29f0e59-8388-4698-9fe6-05db67aeac46"}}})
require "http/client"
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init"
headers = HTTP::Headers{
"authorization" => ""
"x-hiu-id" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/subscription-requests/hiu/on-init"),
Headers =
{
{ "authorization", "" },
{ "x-hiu-id", "" },
},
Content = new StringContent("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/subscription-requests/hiu/on-init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "");
request.AddHeader("x-hiu-id", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init"
payload := strings.NewReader("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "")
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/subscription-requests/hiu/on-init HTTP/1.1
Authorization:
X-Hiu-Id:
Content-Type: application/json
Host: example.com
Content-Length: 138
{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init")
.setHeader("authorization", "")
.setHeader("x-hiu-id", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v0.5/subscription-requests/hiu/on-init"))
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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 \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/on-init")
.post(body)
.addHeader("authorization", "")
.addHeader("x-hiu-id", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v0.5/subscription-requests/hiu/on-init")
.header("authorization", "")
.header("x-hiu-id", "")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}")
.asString();
const data = JSON.stringify({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
subscriptionRequest: {
id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'
}
});
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/subscription-requests/hiu/on-init');
xhr.setRequestHeader('authorization', '');
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/subscription-requests/hiu/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
subscriptionRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v0.5/subscription-requests/hiu/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd","subscriptionRequest":{"id":"f29f0e59-8388-4698-9fe6-05db67aeac46"}}'
};
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/subscription-requests/hiu/on-init',
method: 'POST',
headers: {
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",\n "subscriptionRequest": {\n "id": "f29f0e59-8388-4698-9fe6-05db67aeac46"\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 \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v0.5/subscription-requests/hiu/on-init")
.post(body)
.addHeader("authorization", "")
.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/subscription-requests/hiu/on-init',
headers: {
authorization: '',
'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',
subscriptionRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v0.5/subscription-requests/hiu/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
subscriptionRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'}
},
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/subscription-requests/hiu/on-init');
req.headers({
authorization: '',
'x-hiu-id': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
subscriptionRequest: {
id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'
}
});
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/subscription-requests/hiu/on-init',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
data: {
requestId: '5f7a535d-a3fd-416b-b069-c97d021fbacd',
subscriptionRequest: {id: 'f29f0e59-8388-4698-9fe6-05db67aeac46'}
}
};
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/subscription-requests/hiu/on-init';
const options = {
method: 'POST',
headers: {authorization: '', 'x-hiu-id': '', 'content-type': 'application/json'},
body: '{"requestId":"5f7a535d-a3fd-416b-b069-c97d021fbacd","subscriptionRequest":{"id":"f29f0e59-8388-4698-9fe6-05db67aeac46"}}'
};
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-hiu-id": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"requestId": @"5f7a535d-a3fd-416b-b069-c97d021fbacd",
@"subscriptionRequest": @{ @"id": @"f29f0e59-8388-4698-9fe6-05db67aeac46" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v0.5/subscription-requests/hiu/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/subscription-requests/hiu/on-init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "");
("x-hiu-id", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v0.5/subscription-requests/hiu/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',
'subscriptionRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
]
]),
CURLOPT_HTTPHEADER => [
"authorization: ",
"content-type: application/json",
"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/subscription-requests/hiu/on-init', [
'body' => '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}',
'headers' => [
'authorization' => '',
'content-type' => 'application/json',
'x-hiu-id' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/on-init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd',
'subscriptionRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => '5f7a535d-a3fd-416b-b069-c97d021fbacd',
'subscriptionRequest' => [
'id' => 'f29f0e59-8388-4698-9fe6-05db67aeac46'
]
]));
$request->setRequestUrl('{{baseUrl}}/v0.5/subscription-requests/hiu/on-init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '',
'x-hiu-id' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v0.5/subscription-requests/hiu/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}'
$headers=@{}
$headers.Add("authorization", "")
$headers.Add("x-hiu-id", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v0.5/subscription-requests/hiu/on-init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}"
headers = {
'authorization': "",
'x-hiu-id': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v0.5/subscription-requests/hiu/on-init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init"
payload = {
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": { "id": "f29f0e59-8388-4698-9fe6-05db67aeac46" }
}
headers = {
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v0.5/subscription-requests/hiu/on-init"
payload <- "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '', 'x-hiu-id' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v0.5/subscription-requests/hiu/on-init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = ''
request["x-hiu-id"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/subscription-requests/hiu/on-init') do |req|
req.headers['authorization'] = ''
req.headers['x-hiu-id'] = ''
req.body = "{\n \"requestId\": \"5f7a535d-a3fd-416b-b069-c97d021fbacd\",\n \"subscriptionRequest\": {\n \"id\": \"f29f0e59-8388-4698-9fe6-05db67aeac46\"\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/subscription-requests/hiu/on-init";
let payload = json!({
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": json!({"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "".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/subscription-requests/hiu/on-init \
--header 'authorization: ' \
--header 'content-type: application/json' \
--header 'x-hiu-id: ' \
--data '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}'
echo '{
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": {
"id": "f29f0e59-8388-4698-9fe6-05db67aeac46"
}
}' | \
http POST {{baseUrl}}/v0.5/subscription-requests/hiu/on-init \
authorization:'' \
content-type:application/json \
x-hiu-id:''
wget --quiet \
--method POST \
--header 'authorization: ' \
--header 'x-hiu-id: ' \
--header 'content-type: application/json' \
--body-data '{\n "requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",\n "subscriptionRequest": {\n "id": "f29f0e59-8388-4698-9fe6-05db67aeac46"\n }\n}' \
--output-document \
- {{baseUrl}}/v0.5/subscription-requests/hiu/on-init
import Foundation
let headers = [
"authorization": "",
"x-hiu-id": "",
"content-type": "application/json"
]
let parameters = [
"requestId": "5f7a535d-a3fd-416b-b069-c97d021fbacd",
"subscriptionRequest": ["id": "f29f0e59-8388-4698-9fe6-05db67aeac46"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v0.5/subscription-requests/hiu/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
Identification result for a consent-manager user-id (POST)
{{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()