Health ID Service
GET
Auth token public key.
{{baseUrl}}/v1/auth/cert
HEADERS
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/cert");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/auth/cert" {:headers {:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/auth/cert"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/auth/cert"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/auth/cert");
var request = new RestRequest("", Method.Get);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/cert"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/auth/cert HTTP/1.1
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/auth/cert")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/cert"))
.header("authorization", "{{apiKey}}")
.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}}/v1/auth/cert")
.get()
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/auth/cert")
.header("authorization", "{{apiKey}}")
.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}}/v1/auth/cert');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/auth/cert',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/cert';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
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}}/v1/auth/cert',
method: 'GET',
headers: {
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/cert")
.get()
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/auth/cert',
headers: {
authorization: '{{apiKey}}'
}
};
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}}/v1/auth/cert',
headers: {authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/auth/cert');
req.headers({
authorization: '{{apiKey}}'
});
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}}/v1/auth/cert',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/cert';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/cert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/auth/cert" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/cert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/auth/cert', [
'headers' => [
'authorization' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/cert');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/auth/cert');
$request->setRequestMethod('GET');
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/cert' -Method GET -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/cert' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'authorization': "{{apiKey}}" }
conn.request("GET", "/baseUrl/v1/auth/cert", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/cert"
headers = {"authorization": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/cert"
response <- VERB("GET", url, add_headers('authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/cert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/auth/cert') do |req|
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/cert";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/auth/cert \
--header 'authorization: {{apiKey}}'
http GET {{baseUrl}}/v1/auth/cert \
authorization:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/auth/cert
import Foundation
let headers = ["authorization": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/cert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Authenticate request to generate Mobile OTP using Health ID number - Health ID
{{baseUrl}}/v1/auth/authWithMobile
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/authWithMobile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/authWithMobile" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthid ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/authWithMobile"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthid\": \"\"\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}}/v1/auth/authWithMobile"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthid\": \"\"\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}}/v1/auth/authWithMobile");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/authWithMobile"
payload := strings.NewReader("{\n \"healthid\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/authWithMobile HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"healthid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/authWithMobile")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/authWithMobile"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthid\": \"\"\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 \"healthid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/authWithMobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/authWithMobile")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthid\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/authWithMobile');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authWithMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/authWithMobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthid":""}'
};
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}}/v1/auth/authWithMobile',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/authWithMobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/authWithMobile',
headers: {
authorization: '{{apiKey}}',
'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({healthid: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authWithMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthid: ''},
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}}/v1/auth/authWithMobile');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthid: ''
});
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}}/v1/auth/authWithMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/authWithMobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/authWithMobile"]
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}}/v1/auth/authWithMobile" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthid\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/authWithMobile",
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([
'healthid' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/authWithMobile', [
'body' => '{
"healthid": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/authWithMobile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/authWithMobile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/authWithMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthid": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/authWithMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthid\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/authWithMobile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/authWithMobile"
payload = { "healthid": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/authWithMobile"
payload <- "{\n \"healthid\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/authWithMobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthid\": \"\"\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/v1/auth/authWithMobile') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthid\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/authWithMobile";
let payload = json!({"healthid": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/authWithMobile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthid": ""
}'
echo '{
"healthid": ""
}' | \
http POST {{baseUrl}}/v1/auth/authWithMobile \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthid": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/authWithMobile
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["healthid": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/authWithMobile")! 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
Authenticate using Health ID number - Health ID and password
{{baseUrl}}/v1/auth/authPassword
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthId": "",
"password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/authPassword");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthId\": \"\",\n \"password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/authPassword" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthId ""
:password ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/authPassword"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthId\": \"\",\n \"password\": \"\"\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}}/v1/auth/authPassword"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthId\": \"\",\n \"password\": \"\"\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}}/v1/auth/authPassword");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthId\": \"\",\n \"password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/authPassword"
payload := strings.NewReader("{\n \"healthId\": \"\",\n \"password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/authPassword HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"healthId": "",
"password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/authPassword")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthId\": \"\",\n \"password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/authPassword"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthId\": \"\",\n \"password\": \"\"\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 \"healthId\": \"\",\n \"password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/authPassword")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/authPassword")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthId\": \"\",\n \"password\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthId: '',
password: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/authPassword');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/authPassword';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":"","password":""}'
};
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}}/v1/auth/authPassword',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthId": "",\n "password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthId\": \"\",\n \"password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/authPassword")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/authPassword',
headers: {
authorization: '{{apiKey}}',
'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({healthId: '', password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthId: '', password: ''},
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}}/v1/auth/authPassword');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthId: '',
password: ''
});
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}}/v1/auth/authPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/authPassword';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":"","password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthId": @"",
@"password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/authPassword"]
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}}/v1/auth/authPassword" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthId\": \"\",\n \"password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/authPassword",
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([
'healthId' => '',
'password' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/authPassword', [
'body' => '{
"healthId": "",
"password": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/authPassword');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthId' => '',
'password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthId' => '',
'password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/authPassword');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/authPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": "",
"password": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/authPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": "",
"password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthId\": \"\",\n \"password\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/authPassword", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/authPassword"
payload = {
"healthId": "",
"password": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/authPassword"
payload <- "{\n \"healthId\": \"\",\n \"password\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/authPassword")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthId\": \"\",\n \"password\": \"\"\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/v1/auth/authPassword') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthId\": \"\",\n \"password\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/authPassword";
let payload = json!({
"healthId": "",
"password": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/authPassword \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthId": "",
"password": ""
}'
echo '{
"healthId": "",
"password": ""
}' | \
http POST {{baseUrl}}/v1/auth/authPassword \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthId": "",\n "password": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/authPassword
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"healthId": "",
"password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/authPassword")! 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
Authenticate using demographic data of user.
{{baseUrl}}/v1/auth/confirmWithDemographics
HEADERS
Authorization
{{apiKey}}
BODY json
{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/confirmWithDemographics");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/confirmWithDemographics" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:gender ""
:name ""
:txnId ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/confirmWithDemographics"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/auth/confirmWithDemographics"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/auth/confirmWithDemographics");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/confirmWithDemographics"
payload := strings.NewReader("{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/confirmWithDemographics HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 68
{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/confirmWithDemographics")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/confirmWithDemographics"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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 \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithDemographics")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/confirmWithDemographics")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
gender: '',
name: '',
txnId: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/confirmWithDemographics');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithDemographics',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', name: '', txnId: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/confirmWithDemographics';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","name":"","txnId":"","yearOfBirth":""}'
};
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}}/v1/auth/confirmWithDemographics',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "gender": "",\n "name": "",\n "txnId": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithDemographics")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/confirmWithDemographics',
headers: {
authorization: '{{apiKey}}',
'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({gender: '', name: '', txnId: '', yearOfBirth: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithDemographics',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {gender: '', name: '', txnId: '', yearOfBirth: ''},
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}}/v1/auth/confirmWithDemographics');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
gender: '',
name: '',
txnId: '',
yearOfBirth: ''
});
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}}/v1/auth/confirmWithDemographics',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', name: '', txnId: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/confirmWithDemographics';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","name":"","txnId":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"gender": @"",
@"name": @"",
@"txnId": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/confirmWithDemographics"]
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}}/v1/auth/confirmWithDemographics" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/confirmWithDemographics",
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([
'gender' => '',
'name' => '',
'txnId' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/confirmWithDemographics', [
'body' => '{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/confirmWithDemographics');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gender' => '',
'name' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gender' => '',
'name' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/confirmWithDemographics');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/confirmWithDemographics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/confirmWithDemographics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/confirmWithDemographics", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/confirmWithDemographics"
payload = {
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/confirmWithDemographics"
payload <- "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/confirmWithDemographics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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/v1/auth/confirmWithDemographics') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"gender\": \"\",\n \"name\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/confirmWithDemographics";
let payload = json!({
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/confirmWithDemographics \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}'
echo '{
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/auth/confirmWithDemographics \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "gender": "",\n "name": "",\n "txnId": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/confirmWithDemographics
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"gender": "",
"name": "",
"txnId": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/confirmWithDemographics")! 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
Authenticate using verified Mobile Number and user data
{{baseUrl}}/v1/auth/authWithMobileToken
HEADERS
Authorization
{{apiKey}}
BODY json
{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/authWithMobileToken");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/authWithMobileToken" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:gender ""
:healthId ""
:name ""
:token ""
:txnId ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/authWithMobileToken"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/auth/authWithMobileToken"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/auth/authWithMobileToken");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/authWithMobileToken"
payload := strings.NewReader("{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/authWithMobileToken HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 101
{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/authWithMobileToken")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/authWithMobileToken"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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 \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/authWithMobileToken")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/authWithMobileToken")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
gender: '',
healthId: '',
name: '',
token: '',
txnId: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/authWithMobileToken');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authWithMobileToken',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', healthId: '', name: '', token: '', txnId: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/authWithMobileToken';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","healthId":"","name":"","token":"","txnId":"","yearOfBirth":""}'
};
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}}/v1/auth/authWithMobileToken',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "gender": "",\n "healthId": "",\n "name": "",\n "token": "",\n "txnId": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/authWithMobileToken")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/authWithMobileToken',
headers: {
authorization: '{{apiKey}}',
'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({gender: '', healthId: '', name: '', token: '', txnId: '', yearOfBirth: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/authWithMobileToken',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {gender: '', healthId: '', name: '', token: '', txnId: '', yearOfBirth: ''},
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}}/v1/auth/authWithMobileToken');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
gender: '',
healthId: '',
name: '',
token: '',
txnId: '',
yearOfBirth: ''
});
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}}/v1/auth/authWithMobileToken',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', healthId: '', name: '', token: '', txnId: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/authWithMobileToken';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","healthId":"","name":"","token":"","txnId":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"gender": @"",
@"healthId": @"",
@"name": @"",
@"token": @"",
@"txnId": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/authWithMobileToken"]
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}}/v1/auth/authWithMobileToken" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/authWithMobileToken",
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([
'gender' => '',
'healthId' => '',
'name' => '',
'token' => '',
'txnId' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/authWithMobileToken', [
'body' => '{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/authWithMobileToken');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gender' => '',
'healthId' => '',
'name' => '',
'token' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gender' => '',
'healthId' => '',
'name' => '',
'token' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/authWithMobileToken');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/authWithMobileToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/authWithMobileToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/authWithMobileToken", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/authWithMobileToken"
payload = {
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/authWithMobileToken"
payload <- "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/authWithMobileToken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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/v1/auth/authWithMobileToken') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"gender\": \"\",\n \"healthId\": \"\",\n \"name\": \"\",\n \"token\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/authWithMobileToken";
let payload = json!({
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/authWithMobileToken \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}'
echo '{
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/auth/authWithMobileToken \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "gender": "",\n "healthId": "",\n "name": "",\n "token": "",\n "txnId": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/authWithMobileToken
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"gender": "",
"healthId": "",
"name": "",
"token": "",
"txnId": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/authWithMobileToken")! 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
Authentication with Aadhaar Biometric based auth transaction.
{{baseUrl}}/v1/auth/confirmWithAadhaarBio
HEADERS
Authorization
{{apiKey}}
BODY json
{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/confirmWithAadhaarBio");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/confirmWithAadhaarBio" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:authType ""
:bioType ""
:pid ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/confirmWithAadhaarBio"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithAadhaarBio"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithAadhaarBio");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/confirmWithAadhaarBio"
payload := strings.NewReader("{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/confirmWithAadhaarBio HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/confirmWithAadhaarBio")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/confirmWithAadhaarBio"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\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 \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithAadhaarBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/confirmWithAadhaarBio")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
authType: '',
bioType: '',
pid: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/confirmWithAadhaarBio');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithAadhaarBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authType: '', bioType: '', pid: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/confirmWithAadhaarBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authType":"","bioType":"","pid":"","txnId":""}'
};
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}}/v1/auth/confirmWithAadhaarBio',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "authType": "",\n "bioType": "",\n "pid": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithAadhaarBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/confirmWithAadhaarBio',
headers: {
authorization: '{{apiKey}}',
'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({authType: '', bioType: '', pid: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithAadhaarBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {authType: '', bioType: '', pid: '', txnId: ''},
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}}/v1/auth/confirmWithAadhaarBio');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
authType: '',
bioType: '',
pid: '',
txnId: ''
});
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}}/v1/auth/confirmWithAadhaarBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authType: '', bioType: '', pid: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/confirmWithAadhaarBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authType":"","bioType":"","pid":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"authType": @"",
@"bioType": @"",
@"pid": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/confirmWithAadhaarBio"]
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}}/v1/auth/confirmWithAadhaarBio" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/confirmWithAadhaarBio",
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([
'authType' => '',
'bioType' => '',
'pid' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/confirmWithAadhaarBio', [
'body' => '{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/confirmWithAadhaarBio');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authType' => '',
'bioType' => '',
'pid' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authType' => '',
'bioType' => '',
'pid' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/confirmWithAadhaarBio');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/confirmWithAadhaarBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/confirmWithAadhaarBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/confirmWithAadhaarBio", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/confirmWithAadhaarBio"
payload = {
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/confirmWithAadhaarBio"
payload <- "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/confirmWithAadhaarBio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\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/v1/auth/confirmWithAadhaarBio') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"authType\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/confirmWithAadhaarBio";
let payload = json!({
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/confirmWithAadhaarBio \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}'
echo '{
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/auth/confirmWithAadhaarBio \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "authType": "",\n "bioType": "",\n "pid": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/confirmWithAadhaarBio
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"authType": "",
"bioType": "",
"pid": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/confirmWithAadhaarBio")! 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
Authentication with Aadhaar OTP based auth transaction.
{{baseUrl}}/v1/auth/confirmWithAadhaarOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithAadhaarOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithAadhaarOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/confirmWithAadhaarOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
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}}/v1/auth/confirmWithAadhaarOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/confirmWithAadhaarOtp',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', txnId: ''},
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}}/v1/auth/confirmWithAadhaarOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
txnId: ''
});
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}}/v1/auth/confirmWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"]
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}}/v1/auth/confirmWithAadhaarOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/confirmWithAadhaarOtp",
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([
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/confirmWithAadhaarOtp', [
'body' => '{
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/confirmWithAadhaarOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/confirmWithAadhaarOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/confirmWithAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/confirmWithAadhaarOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"
payload = {
"otp": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp"
payload <- "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/auth/confirmWithAadhaarOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp";
let payload = json!({
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/confirmWithAadhaarOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"txnId": ""
}'
echo '{
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/auth/confirmWithAadhaarOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/confirmWithAadhaarOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/confirmWithAadhaarOtp")! 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
Authentication with Mobile OTP based auth transaction.
{{baseUrl}}/v1/auth/confirmWithMobileOTP
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/confirmWithMobileOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/confirmWithMobileOTP" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/confirmWithMobileOTP"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithMobileOTP"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithMobileOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/confirmWithMobileOTP"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/confirmWithMobileOTP HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/confirmWithMobileOTP")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/confirmWithMobileOTP"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/confirmWithMobileOTP")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/confirmWithMobileOTP');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/confirmWithMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
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}}/v1/auth/confirmWithMobileOTP',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/confirmWithMobileOTP',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', txnId: ''},
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}}/v1/auth/confirmWithMobileOTP');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
txnId: ''
});
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}}/v1/auth/confirmWithMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/confirmWithMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/confirmWithMobileOTP"]
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}}/v1/auth/confirmWithMobileOTP" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/confirmWithMobileOTP",
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([
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/confirmWithMobileOTP', [
'body' => '{
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/confirmWithMobileOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/confirmWithMobileOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/confirmWithMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/confirmWithMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/confirmWithMobileOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/confirmWithMobileOTP"
payload = {
"otp": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/confirmWithMobileOTP"
payload <- "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/confirmWithMobileOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/auth/confirmWithMobileOTP') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/confirmWithMobileOTP";
let payload = json!({
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/confirmWithMobileOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"txnId": ""
}'
echo '{
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/auth/confirmWithMobileOTP \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/confirmWithMobileOTP
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/confirmWithMobileOTP")! 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
Authentication with PASSWORD based auth transaction.
{{baseUrl}}/v1/auth/confirmWithPassword
HEADERS
Authorization
{{apiKey}}
BODY json
{
"password": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/confirmWithPassword");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"password\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/confirmWithPassword" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:password ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/confirmWithPassword"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"password\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithPassword"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"password\": \"\",\n \"txnId\": \"\"\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}}/v1/auth/confirmWithPassword");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"password\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/confirmWithPassword"
payload := strings.NewReader("{\n \"password\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/confirmWithPassword HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"password": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/confirmWithPassword")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"password\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/confirmWithPassword"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"password\": \"\",\n \"txnId\": \"\"\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 \"password\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithPassword")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/confirmWithPassword")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"password\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
password: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/confirmWithPassword');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {password: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/confirmWithPassword';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"password":"","txnId":""}'
};
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}}/v1/auth/confirmWithPassword',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "password": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"password\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/confirmWithPassword")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/confirmWithPassword',
headers: {
authorization: '{{apiKey}}',
'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({password: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/confirmWithPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {password: '', txnId: ''},
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}}/v1/auth/confirmWithPassword');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
password: '',
txnId: ''
});
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}}/v1/auth/confirmWithPassword',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {password: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/confirmWithPassword';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"password":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"password": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/confirmWithPassword"]
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}}/v1/auth/confirmWithPassword" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"password\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/confirmWithPassword",
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([
'password' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/confirmWithPassword', [
'body' => '{
"password": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/confirmWithPassword');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'password' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'password' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/confirmWithPassword');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/confirmWithPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"password": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/confirmWithPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"password": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"password\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/confirmWithPassword", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/confirmWithPassword"
payload = {
"password": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/confirmWithPassword"
payload <- "{\n \"password\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/confirmWithPassword")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"password\": \"\",\n \"txnId\": \"\"\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/v1/auth/confirmWithPassword') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"password\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/confirmWithPassword";
let payload = json!({
"password": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/confirmWithPassword \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"password": "",
"txnId": ""
}'
echo '{
"password": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/auth/confirmWithPassword \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "password": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/confirmWithPassword
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"password": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/confirmWithPassword")! 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
Initiate authentication process for given Health ID
{{baseUrl}}/v1/auth/init
HEADERS
Authorization
{{apiKey}}
BODY json
{
"authMethod": "",
"healthid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/init");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/init" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:authMethod ""
:healthid ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/init"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\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}}/v1/auth/init"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"authMethod\": \"\",\n \"healthid\": \"\"\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}}/v1/auth/init");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/init"
payload := strings.NewReader("{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/init HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"authMethod": "",
"healthid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/init")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/init"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authMethod\": \"\",\n \"healthid\": \"\"\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 \"authMethod\": \"\",\n \"healthid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/init")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/init")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}")
.asString();
const data = JSON.stringify({
authMethod: '',
healthid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/init');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/init',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authMethod: '', healthid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/init';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authMethod":"","healthid":""}'
};
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}}/v1/auth/init',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "authMethod": "",\n "healthid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/init")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/init',
headers: {
authorization: '{{apiKey}}',
'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({authMethod: '', healthid: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/init',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {authMethod: '', healthid: ''},
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}}/v1/auth/init');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
authMethod: '',
healthid: ''
});
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}}/v1/auth/init',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authMethod: '', healthid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/init';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authMethod":"","healthid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"authMethod": @"",
@"healthid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/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}}/v1/auth/init" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/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([
'authMethod' => '',
'healthid' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/init', [
'body' => '{
"authMethod": "",
"healthid": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/init');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authMethod' => '',
'healthid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authMethod' => '',
'healthid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authMethod": "",
"healthid": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/init' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authMethod": "",
"healthid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/init", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/init"
payload = {
"authMethod": "",
"healthid": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/init"
payload <- "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/init")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\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/v1/auth/init') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"authMethod\": \"\",\n \"healthid\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/init";
let payload = json!({
"authMethod": "",
"healthid": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/init \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"authMethod": "",
"healthid": ""
}'
echo '{
"authMethod": "",
"healthid": ""
}' | \
http POST {{baseUrl}}/v1/auth/init \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "authMethod": "",\n "healthid": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/init
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"authMethod": "",
"healthid": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/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
Resend Aadhaar-Mobile OTP for Authentication Transaction.
{{baseUrl}}/v1/auth/resendAuthOTP
HEADERS
Authorization
{{apiKey}}
BODY json
{
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/auth/resendAuthOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/auth/resendAuthOTP" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/auth/resendAuthOTP"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"txnId\": \"\"\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}}/v1/auth/resendAuthOTP"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"txnId\": \"\"\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}}/v1/auth/resendAuthOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/auth/resendAuthOTP"
payload := strings.NewReader("{\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/auth/resendAuthOTP HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/auth/resendAuthOTP")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/auth/resendAuthOTP"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"txnId\": \"\"\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 \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/auth/resendAuthOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/auth/resendAuthOTP")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/auth/resendAuthOTP');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/resendAuthOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/auth/resendAuthOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
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}}/v1/auth/resendAuthOTP',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/auth/resendAuthOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/auth/resendAuthOTP',
headers: {
authorization: '{{apiKey}}',
'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({txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/auth/resendAuthOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {txnId: ''},
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}}/v1/auth/resendAuthOTP');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
txnId: ''
});
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}}/v1/auth/resendAuthOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/auth/resendAuthOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/auth/resendAuthOTP"]
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}}/v1/auth/resendAuthOTP" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/auth/resendAuthOTP",
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([
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/auth/resendAuthOTP', [
'body' => '{
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/auth/resendAuthOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/auth/resendAuthOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/auth/resendAuthOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/auth/resendAuthOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/auth/resendAuthOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/auth/resendAuthOTP"
payload = { "txnId": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/auth/resendAuthOTP"
payload <- "{\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/auth/resendAuthOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"txnId\": \"\"\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/v1/auth/resendAuthOTP') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/auth/resendAuthOTP";
let payload = json!({"txnId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/auth/resendAuthOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"txnId": ""
}'
echo '{
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/auth/resendAuthOTP \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/auth/resendAuthOTP
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["txnId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/auth/resendAuthOTP")! 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
Generate Aadhaar OTP on registrered mobile number
{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/forgot/healthId/aadhaar/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/forgot/healthId/aadhaar/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/forgot/healthId/aadhaar/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/forgot/healthId/aadhaar/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/forgot/healthId/aadhaar/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/forgot/healthId/aadhaar/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/forgot/healthId/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"]
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}}/v1/forgot/healthId/aadhaar/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/forgot/healthId/aadhaar/generateOtp', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/forgot/healthId/aadhaar/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"
payload = { "aadhaar": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/forgot/healthId/aadhaar/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/forgot/healthId/aadhaar/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/forgot/healthId/aadhaar/generateOtp")! 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
Generate Mobile OTP to start registration
{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"mobile": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"mobile\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:mobile ""}})
require "http/client"
url = "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"mobile\": \"\"\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}}/v1/forgot/healthId/mobile/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"mobile\": \"\"\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}}/v1/forgot/healthId/mobile/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mobile\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"
payload := strings.NewReader("{\n \"mobile\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/forgot/healthId/mobile/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"mobile": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"mobile\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mobile\": \"\"\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 \"mobile\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"mobile\": \"\"\n}")
.asString();
const data = JSON.stringify({
mobile: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
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}}/v1/forgot/healthId/mobile/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "mobile": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"mobile\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/forgot/healthId/mobile/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({mobile: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {mobile: ''},
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}}/v1/forgot/healthId/mobile/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
mobile: ''
});
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}}/v1/forgot/healthId/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"mobile": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"]
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}}/v1/forgot/healthId/mobile/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"mobile\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp",
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([
'mobile' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/forgot/healthId/mobile/generateOtp', [
'body' => '{
"mobile": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mobile' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mobile' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mobile\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/forgot/healthId/mobile/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"
payload = { "mobile": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp"
payload <- "{\n \"mobile\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"mobile\": \"\"\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/v1/forgot/healthId/mobile/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"mobile\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp";
let payload = json!({"mobile": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/forgot/healthId/mobile/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"mobile": ""
}'
echo '{
"mobile": ""
}' | \
http POST {{baseUrl}}/v1/forgot/healthId/mobile/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "mobile": ""\n}' \
--output-document \
- {{baseUrl}}/v1/forgot/healthId/mobile/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["mobile": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/forgot/healthId/mobile/generateOtp")! 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
Verify Mobile OTP sent as part of forgetHealth id.
{{baseUrl}}/v1/forgot/healthId/mobile
HEADERS
Authorization
{{apiKey}}
BODY json
{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/forgot/healthId/mobile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/forgot/healthId/mobile" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:dayOfBirth ""
:firstName ""
:gender ""
:lastName ""
:middleName ""
:monthOfBirth ""
:name ""
:otp ""
:txnId ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/forgot/healthId/mobile"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/forgot/healthId/mobile"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/forgot/healthId/mobile");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/forgot/healthId/mobile"
payload := strings.NewReader("{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/forgot/healthId/mobile HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 180
{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/forgot/healthId/mobile")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/forgot/healthId/mobile"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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 \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/mobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/forgot/healthId/mobile")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/forgot/healthId/mobile');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/forgot/healthId/mobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"dayOfBirth":"","firstName":"","gender":"","lastName":"","middleName":"","monthOfBirth":"","name":"","otp":"","txnId":"","yearOfBirth":""}'
};
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}}/v1/forgot/healthId/mobile',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "dayOfBirth": "",\n "firstName": "",\n "gender": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "name": "",\n "otp": "",\n "txnId": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/mobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/forgot/healthId/mobile',
headers: {
authorization: '{{apiKey}}',
'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({
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
},
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}}/v1/forgot/healthId/mobile');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
});
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}}/v1/forgot/healthId/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
dayOfBirth: '',
firstName: '',
gender: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
otp: '',
txnId: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/forgot/healthId/mobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"dayOfBirth":"","firstName":"","gender":"","lastName":"","middleName":"","monthOfBirth":"","name":"","otp":"","txnId":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dayOfBirth": @"",
@"firstName": @"",
@"gender": @"",
@"lastName": @"",
@"middleName": @"",
@"monthOfBirth": @"",
@"name": @"",
@"otp": @"",
@"txnId": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/forgot/healthId/mobile"]
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}}/v1/forgot/healthId/mobile" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/forgot/healthId/mobile",
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([
'dayOfBirth' => '',
'firstName' => '',
'gender' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/forgot/healthId/mobile', [
'body' => '{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/forgot/healthId/mobile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dayOfBirth' => '',
'firstName' => '',
'gender' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dayOfBirth' => '',
'firstName' => '',
'gender' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/forgot/healthId/mobile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/forgot/healthId/mobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/forgot/healthId/mobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/forgot/healthId/mobile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/forgot/healthId/mobile"
payload = {
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/forgot/healthId/mobile"
payload <- "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/forgot/healthId/mobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\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/v1/forgot/healthId/mobile') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"dayOfBirth\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/forgot/healthId/mobile";
let payload = json!({
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/forgot/healthId/mobile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}'
echo '{
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/forgot/healthId/mobile \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "dayOfBirth": "",\n "firstName": "",\n "gender": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "name": "",\n "otp": "",\n "txnId": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/forgot/healthId/mobile
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"dayOfBirth": "",
"firstName": "",
"gender": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"otp": "",
"txnId": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/forgot/healthId/mobile")! 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
Verify aadhar OTP sent as part of forgetHealth id.
{{baseUrl}}/v1/forgot/healthId/aadhaar
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/forgot/healthId/aadhaar");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/forgot/healthId/aadhaar" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/forgot/healthId/aadhaar"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/forgot/healthId/aadhaar"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/forgot/healthId/aadhaar");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/forgot/healthId/aadhaar"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/forgot/healthId/aadhaar HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/forgot/healthId/aadhaar")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/forgot/healthId/aadhaar"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/aadhaar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/forgot/healthId/aadhaar")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/forgot/healthId/aadhaar');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/forgot/healthId/aadhaar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
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}}/v1/forgot/healthId/aadhaar',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/forgot/healthId/aadhaar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/forgot/healthId/aadhaar',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/forgot/healthId/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', txnId: ''},
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}}/v1/forgot/healthId/aadhaar');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
txnId: ''
});
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}}/v1/forgot/healthId/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/forgot/healthId/aadhaar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/forgot/healthId/aadhaar"]
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}}/v1/forgot/healthId/aadhaar" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/forgot/healthId/aadhaar",
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([
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/forgot/healthId/aadhaar', [
'body' => '{
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/forgot/healthId/aadhaar');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/forgot/healthId/aadhaar');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/forgot/healthId/aadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/forgot/healthId/aadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/forgot/healthId/aadhaar", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/forgot/healthId/aadhaar"
payload = {
"otp": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/forgot/healthId/aadhaar"
payload <- "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/forgot/healthId/aadhaar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/forgot/healthId/aadhaar') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/forgot/healthId/aadhaar";
let payload = json!({
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/forgot/healthId/aadhaar \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"txnId": ""
}'
echo '{
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/forgot/healthId/aadhaar \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/forgot/healthId/aadhaar
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/forgot/healthId/aadhaar")! 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
Change password for heath facility id.
{{baseUrl}}/v1/health/facility/change/password
HEADERS
Authorization
{{apiKey}}
BODY json
{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/change/password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/change/password" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:hfrUid ""
:newPassword ""
:oldPassword ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/change/password"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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}}/v1/health/facility/change/password"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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}}/v1/health/facility/change/password");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/change/password"
payload := strings.NewReader("{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/change/password HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/change/password")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/change/password"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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 \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/change/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/change/password")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
hfrUid: '',
newPassword: '',
oldPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/change/password');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/change/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: '', newPassword: '', oldPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/change/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":"","newPassword":"","oldPassword":""}'
};
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}}/v1/health/facility/change/password',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "hfrUid": "",\n "newPassword": "",\n "oldPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/change/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/change/password',
headers: {
authorization: '{{apiKey}}',
'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({hfrUid: '', newPassword: '', oldPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/change/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {hfrUid: '', newPassword: '', oldPassword: ''},
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}}/v1/health/facility/change/password');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
hfrUid: '',
newPassword: '',
oldPassword: ''
});
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}}/v1/health/facility/change/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: '', newPassword: '', oldPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/change/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":"","newPassword":"","oldPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hfrUid": @"",
@"newPassword": @"",
@"oldPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/change/password"]
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}}/v1/health/facility/change/password" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/change/password",
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([
'hfrUid' => '',
'newPassword' => '',
'oldPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/health/facility/change/password', [
'body' => '{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/change/password');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hfrUid' => '',
'newPassword' => '',
'oldPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hfrUid' => '',
'newPassword' => '',
'oldPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/change/password');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/change/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/change/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/change/password", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/change/password"
payload = {
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/change/password"
payload <- "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/change/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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/v1/health/facility/change/password') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"hfrUid\": \"\",\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/change/password";
let payload = json!({
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/change/password \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}'
echo '{
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/change/password \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "hfrUid": "",\n "newPassword": "",\n "oldPassword": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/change/password
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"hfrUid": "",
"newPassword": "",
"oldPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/change/password")! 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
Generate Health ID card SVG (POST)
{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified
HEADERS
Authorization
{{apiKey}}
BODY json
{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:email ""
:firstName ""
:healthId ""
:lastName ""
:middleName ""
:password ""
:profilePhoto ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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}}/v1/health/facility/createHealthIdWithPreVerified"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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}}/v1/health/facility/createHealthIdWithPreVerified");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"
payload := strings.NewReader("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/createHealthIdWithPreVerified HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 147
{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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 \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","healthId":"","lastName":"","middleName":"","password":"","profilePhoto":"","txnId":""}'
};
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}}/v1/health/facility/createHealthIdWithPreVerified',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "password": "",\n "profilePhoto": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/createHealthIdWithPreVerified',
headers: {
authorization: '{{apiKey}}',
'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({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
},
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}}/v1/health/facility/createHealthIdWithPreVerified');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
});
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}}/v1/health/facility/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","healthId":"","lastName":"","middleName":"","password":"","profilePhoto":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"email": @"",
@"firstName": @"",
@"healthId": @"",
@"lastName": @"",
@"middleName": @"",
@"password": @"",
@"profilePhoto": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"]
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}}/v1/health/facility/createHealthIdWithPreVerified" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified",
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([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/health/facility/createHealthIdWithPreVerified', [
'body' => '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/createHealthIdWithPreVerified", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"
payload = {
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified"
payload <- "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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/v1/health/facility/createHealthIdWithPreVerified') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified";
let payload = json!({
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/createHealthIdWithPreVerified \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
echo '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "password": "",\n "profilePhoto": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/createHealthIdWithPreVerified")! 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
Generate health hacility OTP on registrered mobile number
{{baseUrl}}/v1/health/facility/generateOtp
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/generateOtp" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/generateOtp"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/health/facility/generateOtp"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/health/facility/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/generateOtp"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/generateOtp HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/generateOtp")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/generateOtp"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/generateOtp")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/generateOtp")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/generateOtp');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/generateOtp',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/generateOtp';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/health/facility/generateOtp',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/generateOtp")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/generateOtp',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/generateOtp',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/health/facility/generateOtp');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/health/facility/generateOtp',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/generateOtp';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/generateOtp"]
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}}/v1/health/facility/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/generateOtp",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/health/facility/generateOtp', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/generateOtp"
payload = { "aadhaar": "" }
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/generateOtp"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/health/facility/generateOtp') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/generateOtp";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/generateOtp
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/generateOtp")! 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
Generate token for heath facility id.
{{baseUrl}}/v1/health/facility/authenticate
HEADERS
Authorization
{{apiKey}}
BODY json
{
"hfrUid": "",
"password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/authenticate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/authenticate" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:hfrUid ""
:password ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/authenticate"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"hfrUid\": \"\",\n \"password\": \"\"\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}}/v1/health/facility/authenticate"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"hfrUid\": \"\",\n \"password\": \"\"\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}}/v1/health/facility/authenticate");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/authenticate"
payload := strings.NewReader("{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/authenticate HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"hfrUid": "",
"password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/authenticate")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/authenticate"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"hfrUid\": \"\",\n \"password\": \"\"\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 \"hfrUid\": \"\",\n \"password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/authenticate")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/authenticate")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}")
.asString();
const data = JSON.stringify({
hfrUid: '',
password: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/authenticate');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/authenticate',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/authenticate';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":"","password":""}'
};
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}}/v1/health/facility/authenticate',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "hfrUid": "",\n "password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/authenticate")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/authenticate',
headers: {
authorization: '{{apiKey}}',
'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({hfrUid: '', password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/authenticate',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {hfrUid: '', password: ''},
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}}/v1/health/facility/authenticate');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
hfrUid: '',
password: ''
});
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}}/v1/health/facility/authenticate',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/authenticate';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":"","password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hfrUid": @"",
@"password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/authenticate"]
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}}/v1/health/facility/authenticate" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/authenticate",
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([
'hfrUid' => '',
'password' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/health/facility/authenticate', [
'body' => '{
"hfrUid": "",
"password": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/authenticate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hfrUid' => '',
'password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hfrUid' => '',
'password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/authenticate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/authenticate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": "",
"password": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/authenticate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": "",
"password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/authenticate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/authenticate"
payload = {
"hfrUid": "",
"password": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/authenticate"
payload <- "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/authenticate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"hfrUid\": \"\",\n \"password\": \"\"\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/v1/health/facility/authenticate') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"hfrUid\": \"\",\n \"password\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/authenticate";
let payload = json!({
"hfrUid": "",
"password": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/authenticate \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"hfrUid": "",
"password": ""
}'
echo '{
"hfrUid": "",
"password": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/authenticate \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "hfrUid": "",\n "password": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/authenticate
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"hfrUid": "",
"password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/authenticate")! 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
Generates password for heath facility id.
{{baseUrl}}/v1/health/facility/generate/password
HEADERS
Authorization
{{apiKey}}
BODY json
{
"hfrUid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/generate/password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"hfrUid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/generate/password" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:hfrUid ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/generate/password"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"hfrUid\": \"\"\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}}/v1/health/facility/generate/password"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"hfrUid\": \"\"\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}}/v1/health/facility/generate/password");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hfrUid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/generate/password"
payload := strings.NewReader("{\n \"hfrUid\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/generate/password HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"hfrUid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/generate/password")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"hfrUid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/generate/password"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"hfrUid\": \"\"\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 \"hfrUid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/generate/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/generate/password")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"hfrUid\": \"\"\n}")
.asString();
const data = JSON.stringify({
hfrUid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/generate/password');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/generate/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/generate/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":""}'
};
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}}/v1/health/facility/generate/password',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "hfrUid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"hfrUid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/generate/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/generate/password',
headers: {
authorization: '{{apiKey}}',
'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({hfrUid: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/generate/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {hfrUid: ''},
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}}/v1/health/facility/generate/password');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
hfrUid: ''
});
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}}/v1/health/facility/generate/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/generate/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hfrUid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/generate/password"]
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}}/v1/health/facility/generate/password" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"hfrUid\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/generate/password",
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([
'hfrUid' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/health/facility/generate/password', [
'body' => '{
"hfrUid": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/generate/password');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hfrUid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hfrUid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/generate/password');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/generate/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/generate/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hfrUid\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/generate/password", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/generate/password"
payload = { "hfrUid": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/generate/password"
payload <- "{\n \"hfrUid\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/generate/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"hfrUid\": \"\"\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/v1/health/facility/generate/password') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"hfrUid\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/generate/password";
let payload = json!({"hfrUid": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/generate/password \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"hfrUid": ""
}'
echo '{
"hfrUid": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/generate/password \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "hfrUid": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/generate/password
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["hfrUid": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/generate/password")! 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
Reset password for heath facility id.
{{baseUrl}}/v1/health/facility/reset/password
HEADERS
Authorization
{{apiKey}}
BODY json
{
"hfrUid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/reset/password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"hfrUid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/health/facility/reset/password" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:hfrUid ""}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/reset/password"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"hfrUid\": \"\"\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}}/v1/health/facility/reset/password"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"hfrUid\": \"\"\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}}/v1/health/facility/reset/password");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"hfrUid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/reset/password"
payload := strings.NewReader("{\n \"hfrUid\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/health/facility/reset/password HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"hfrUid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/health/facility/reset/password")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"hfrUid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/reset/password"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"hfrUid\": \"\"\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 \"hfrUid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/health/facility/reset/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/health/facility/reset/password")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"hfrUid\": \"\"\n}")
.asString();
const data = JSON.stringify({
hfrUid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/health/facility/reset/password');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/reset/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/reset/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":""}'
};
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}}/v1/health/facility/reset/password',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "hfrUid": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"hfrUid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/reset/password")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/health/facility/reset/password',
headers: {
authorization: '{{apiKey}}',
'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({hfrUid: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/health/facility/reset/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {hfrUid: ''},
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}}/v1/health/facility/reset/password');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
hfrUid: ''
});
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}}/v1/health/facility/reset/password',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {hfrUid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/reset/password';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"hfrUid":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"hfrUid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/reset/password"]
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}}/v1/health/facility/reset/password" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"hfrUid\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/reset/password",
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([
'hfrUid' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/health/facility/reset/password', [
'body' => '{
"hfrUid": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/reset/password');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'hfrUid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'hfrUid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/health/facility/reset/password');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/reset/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/reset/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"hfrUid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"hfrUid\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/health/facility/reset/password", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/reset/password"
payload = { "hfrUid": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/reset/password"
payload <- "{\n \"hfrUid\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/reset/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"hfrUid\": \"\"\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/v1/health/facility/reset/password') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"hfrUid\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/reset/password";
let payload = json!({"hfrUid": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/health/facility/reset/password \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"hfrUid": ""
}'
echo '{
"hfrUid": ""
}' | \
http POST {{baseUrl}}/v1/health/facility/reset/password \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "hfrUid": ""\n}' \
--output-document \
- {{baseUrl}}/v1/health/facility/reset/password
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["hfrUid": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/reset/password")! 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
generateSvgCard
{{baseUrl}}/v1/health/facility/getSvgCard
HEADERS
Health-ID
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/health/facility/getSvgCard");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "health-id: ");
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/health/facility/getSvgCard" {:headers {:health-id ""
:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/health/facility/getSvgCard"
headers = HTTP::Headers{
"health-id" => ""
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/health/facility/getSvgCard"),
Headers =
{
{ "health-id", "" },
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/health/facility/getSvgCard");
var request = new RestRequest("", Method.Get);
request.AddHeader("health-id", "");
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/health/facility/getSvgCard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("health-id", "")
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/health/facility/getSvgCard HTTP/1.1
Health-Id:
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/health/facility/getSvgCard")
.setHeader("health-id", "")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/health/facility/getSvgCard"))
.header("health-id", "")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/health/facility/getSvgCard")
.get()
.addHeader("health-id", "")
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/health/facility/getSvgCard")
.header("health-id", "")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/health/facility/getSvgCard');
xhr.setRequestHeader('health-id', '');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/health/facility/getSvgCard',
headers: {'health-id': '', 'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/health/facility/getSvgCard';
const options = {
method: 'GET',
headers: {'health-id': '', 'x-token': '', authorization: '{{apiKey}}'}
};
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}}/v1/health/facility/getSvgCard',
method: 'GET',
headers: {
'health-id': '',
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/health/facility/getSvgCard")
.get()
.addHeader("health-id", "")
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/health/facility/getSvgCard',
headers: {
'health-id': '',
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/health/facility/getSvgCard',
headers: {'health-id': '', 'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/health/facility/getSvgCard');
req.headers({
'health-id': '',
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/health/facility/getSvgCard',
headers: {'health-id': '', 'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/health/facility/getSvgCard';
const options = {
method: 'GET',
headers: {'health-id': '', 'x-token': '', authorization: '{{apiKey}}'}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"health-id": @"",
@"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/health/facility/getSvgCard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/health/facility/getSvgCard" in
let headers = Header.add_list (Header.init ()) [
("health-id", "");
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/health/facility/getSvgCard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"health-id: ",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/health/facility/getSvgCard', [
'headers' => [
'authorization' => '{{apiKey}}',
'health-id' => '',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/health/facility/getSvgCard');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'health-id' => '',
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/health/facility/getSvgCard');
$request->setRequestMethod('GET');
$request->setHeaders([
'health-id' => '',
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("health-id", "")
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/health/facility/getSvgCard' -Method GET -Headers $headers
$headers=@{}
$headers.Add("health-id", "")
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/health/facility/getSvgCard' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'health-id': "",
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/health/facility/getSvgCard", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/health/facility/getSvgCard"
headers = {
"health-id": "",
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/health/facility/getSvgCard"
response <- VERB("GET", url, add_headers('health-id' = '', 'x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/health/facility/getSvgCard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["health-id"] = ''
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/health/facility/getSvgCard') do |req|
req.headers['health-id'] = ''
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/health/facility/getSvgCard";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("health-id", "".parse().unwrap());
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/health/facility/getSvgCard \
--header 'authorization: {{apiKey}}' \
--header 'health-id: ' \
--header 'x-token: '
http GET {{baseUrl}}/v1/health/facility/getSvgCard \
authorization:'{{apiKey}}' \
health-id:'' \
x-token:''
wget --quiet \
--method GET \
--header 'health-id: ' \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/health/facility/getSvgCard
import Foundation
let headers = [
"health-id": "",
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/health/facility/getSvgCard")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 health id using Aadhaar Demo Auth.
{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadharNumber ""
:autoGeneratedBenefitId false
:benefitId ""
:benefitName ""
:consentHealthId false
:dateOfBirth ""
:gender ""
:mobileNumber ""
:name ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/createHealthId/demo/auth"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/createHealthId/demo/auth");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"
payload := strings.NewReader("{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/createHealthId/demo/auth HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 218
{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\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 \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadharNumber":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","gender":"","mobileNumber":"","name":"","validity":""}'
};
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}}/v1/hid/benefit/createHealthId/demo/auth',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadharNumber": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "gender": "",\n "mobileNumber": "",\n "name": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/createHealthId/demo/auth',
headers: {
authorization: '{{apiKey}}',
'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({
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
},
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}}/v1/hid/benefit/createHealthId/demo/auth');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
});
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}}/v1/hid/benefit/createHealthId/demo/auth',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadharNumber: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadharNumber":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","gender":"","mobileNumber":"","name":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadharNumber": @"",
@"autoGeneratedBenefitId": @NO,
@"benefitId": @"",
@"benefitName": @"",
@"consentHealthId": @NO,
@"dateOfBirth": @"",
@"gender": @"",
@"mobileNumber": @"",
@"name": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"]
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}}/v1/hid/benefit/createHealthId/demo/auth" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth",
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([
'aadharNumber' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/createHealthId/demo/auth', [
'body' => '{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadharNumber' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadharNumber' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/createHealthId/demo/auth", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"
payload = {
"aadharNumber": "",
"autoGeneratedBenefitId": False,
"benefitId": "",
"benefitName": "",
"consentHealthId": False,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth"
payload <- "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/createHealthId/demo/auth') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadharNumber\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth";
let payload = json!({
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/createHealthId/demo/auth \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}'
echo '{
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadharNumber": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "gender": "",\n "mobileNumber": "",\n "name": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"aadharNumber": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/createHealthId/demo/auth")! 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 health id using Aadhaar Number Otp.
{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:autoGeneratedBenefitId false
:benefitId ""
:benefitName ""
:consentHealthId false
:mobileNumber ""
:otp ""
:txnId ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/aadhaar/verifyAadharOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/aadhaar/verifyAadharOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"
payload := strings.NewReader("{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/aadhaar/verifyAadharOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 173
{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\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 \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"mobileNumber":"","otp":"","txnId":"","validity":""}'
};
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}}/v1/hid/benefit/aadhaar/verifyAadharOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "mobileNumber": "",\n "otp": "",\n "txnId": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/aadhaar/verifyAadharOtp',
headers: {
authorization: '{{apiKey}}',
'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({
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
},
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}}/v1/hid/benefit/aadhaar/verifyAadharOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
});
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}}/v1/hid/benefit/aadhaar/verifyAadharOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
mobileNumber: '',
otp: '',
txnId: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"mobileNumber":"","otp":"","txnId":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"autoGeneratedBenefitId": @NO,
@"benefitId": @"",
@"benefitName": @"",
@"consentHealthId": @NO,
@"mobileNumber": @"",
@"otp": @"",
@"txnId": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"]
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}}/v1/hid/benefit/aadhaar/verifyAadharOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp",
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([
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'otp' => '',
'txnId' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/aadhaar/verifyAadharOtp', [
'body' => '{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'otp' => '',
'txnId' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'otp' => '',
'txnId' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/aadhaar/verifyAadharOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"
payload = {
"autoGeneratedBenefitId": False,
"benefitId": "",
"benefitName": "",
"consentHealthId": False,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp"
payload <- "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/aadhaar/verifyAadharOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp";
let payload = json!({
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/aadhaar/verifyAadharOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}'
echo '{
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "mobileNumber": "",\n "otp": "",\n "txnId": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"mobileNumber": "",
"otp": "",
"txnId": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyAadharOtp")! 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 health id using Biometric Authentication.
{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""
:autoGeneratedBenefitId false
:benefitId ""
:benefitName ""
:bioType ""
:consentHealthId false
:mobileNumber ""
:pid ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/aadhaar/verifyBio"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/aadhaar/verifyBio");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"
payload := strings.NewReader("{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/aadhaar/verifyBio HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 192
{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\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 \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","bioType":"","consentHealthId":false,"mobileNumber":"","pid":"","validity":""}'
};
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}}/v1/hid/benefit/aadhaar/verifyBio',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "bioType": "",\n "consentHealthId": false,\n "mobileNumber": "",\n "pid": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/aadhaar/verifyBio',
headers: {
authorization: '{{apiKey}}',
'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({
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
},
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}}/v1/hid/benefit/aadhaar/verifyBio');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
});
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}}/v1/hid/benefit/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadhaar: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
bioType: '',
consentHealthId: false,
mobileNumber: '',
pid: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","bioType":"","consentHealthId":false,"mobileNumber":"","pid":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"",
@"autoGeneratedBenefitId": @NO,
@"benefitId": @"",
@"benefitName": @"",
@"bioType": @"",
@"consentHealthId": @NO,
@"mobileNumber": @"",
@"pid": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"]
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}}/v1/hid/benefit/aadhaar/verifyBio" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio",
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([
'aadhaar' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'bioType' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'pid' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/aadhaar/verifyBio', [
'body' => '{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'bioType' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'pid' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'bioType' => '',
'consentHealthId' => null,
'mobileNumber' => '',
'pid' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/aadhaar/verifyBio", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"
payload = {
"aadhaar": "",
"autoGeneratedBenefitId": False,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": False,
"mobileNumber": "",
"pid": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio"
payload <- "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/aadhaar/verifyBio') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"bioType\": \"\",\n \"consentHealthId\": false,\n \"mobileNumber\": \"\",\n \"pid\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio";
let payload = json!({
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/aadhaar/verifyBio \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}'
echo '{
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "bioType": "",\n "consentHealthId": false,\n "mobileNumber": "",\n "pid": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"aadhaar": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"bioType": "",
"consentHealthId": false,
"mobileNumber": "",
"pid": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/aadhaar/verifyBio")! 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 health id using mobile Authentication.
{{baseUrl}}/v1/hid/benefit/mobile/createHealthId
HEADERS
Authorization
{{apiKey}}
BODY json
{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:autoGeneratedBenefitId false
:benefitDocType ""
:benefitId ""
:benefitName ""
:consentHealthId false
:dateOfBirth ""
:docNumber ""
:fileType ""
:gender ""
:name ""
:otp ""
:txnId ""
:uploadedDoc ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/mobile/createHealthId"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/mobile/createHealthId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"
payload := strings.NewReader("{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/mobile/createHealthId HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 284
{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\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 \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"autoGeneratedBenefitId":false,"benefitDocType":"","benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","docNumber":"","fileType":"","gender":"","name":"","otp":"","txnId":"","uploadedDoc":"","validity":""}'
};
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}}/v1/hid/benefit/mobile/createHealthId',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "autoGeneratedBenefitId": false,\n "benefitDocType": "",\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "docNumber": "",\n "fileType": "",\n "gender": "",\n "name": "",\n "otp": "",\n "txnId": "",\n "uploadedDoc": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/mobile/createHealthId',
headers: {
authorization: '{{apiKey}}',
'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({
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
},
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}}/v1/hid/benefit/mobile/createHealthId');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
});
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}}/v1/hid/benefit/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
autoGeneratedBenefitId: false,
benefitDocType: '',
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
docNumber: '',
fileType: '',
gender: '',
name: '',
otp: '',
txnId: '',
uploadedDoc: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"autoGeneratedBenefitId":false,"benefitDocType":"","benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","docNumber":"","fileType":"","gender":"","name":"","otp":"","txnId":"","uploadedDoc":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"autoGeneratedBenefitId": @NO,
@"benefitDocType": @"",
@"benefitId": @"",
@"benefitName": @"",
@"consentHealthId": @NO,
@"dateOfBirth": @"",
@"docNumber": @"",
@"fileType": @"",
@"gender": @"",
@"name": @"",
@"otp": @"",
@"txnId": @"",
@"uploadedDoc": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"]
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}}/v1/hid/benefit/mobile/createHealthId" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/mobile/createHealthId",
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([
'autoGeneratedBenefitId' => null,
'benefitDocType' => '',
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'docNumber' => '',
'fileType' => '',
'gender' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'uploadedDoc' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/mobile/createHealthId', [
'body' => '{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/mobile/createHealthId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'autoGeneratedBenefitId' => null,
'benefitDocType' => '',
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'docNumber' => '',
'fileType' => '',
'gender' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'uploadedDoc' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'autoGeneratedBenefitId' => null,
'benefitDocType' => '',
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'docNumber' => '',
'fileType' => '',
'gender' => '',
'name' => '',
'otp' => '',
'txnId' => '',
'uploadedDoc' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/mobile/createHealthId');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/mobile/createHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/mobile/createHealthId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"
payload = {
"autoGeneratedBenefitId": False,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": False,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId"
payload <- "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/mobile/createHealthId') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"autoGeneratedBenefitId\": false,\n \"benefitDocType\": \"\",\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"docNumber\": \"\",\n \"fileType\": \"\",\n \"gender\": \"\",\n \"name\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\",\n \"uploadedDoc\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId";
let payload = json!({
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/mobile/createHealthId \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}'
echo '{
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/mobile/createHealthId \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "autoGeneratedBenefitId": false,\n "benefitDocType": "",\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "docNumber": "",\n "fileType": "",\n "gender": "",\n "name": "",\n "otp": "",\n "txnId": "",\n "uploadedDoc": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/mobile/createHealthId
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"autoGeneratedBenefitId": false,
"benefitDocType": "",
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"docNumber": "",
"fileType": "",
"gender": "",
"name": "",
"otp": "",
"txnId": "",
"uploadedDoc": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/mobile/createHealthId")! 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 health id using notify Benefit.
{{baseUrl}}/v1/hid/benefit/notify/benefit
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/notify/benefit");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/notify/benefit" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadharNumberOrUidToken ""
:autoGeneratedBenefitId false
:benefitId ""
:benefitName ""
:consentHealthId false
:dateOfBirth ""
:gender ""
:mobileNumber ""
:name ""
:stateCode ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/notify/benefit"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/notify/benefit"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/notify/benefit");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/notify/benefit"
payload := strings.NewReader("{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/notify/benefit HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 247
{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/notify/benefit")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/notify/benefit"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\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 \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/notify/benefit")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/notify/benefit")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/notify/benefit');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/notify/benefit',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/notify/benefit';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadharNumberOrUidToken":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","gender":"","mobileNumber":"","name":"","stateCode":"","validity":""}'
};
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}}/v1/hid/benefit/notify/benefit',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadharNumberOrUidToken": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "gender": "",\n "mobileNumber": "",\n "name": "",\n "stateCode": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/notify/benefit")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/notify/benefit',
headers: {
authorization: '{{apiKey}}',
'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({
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/notify/benefit',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
},
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}}/v1/hid/benefit/notify/benefit');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
});
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}}/v1/hid/benefit/notify/benefit',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
aadharNumberOrUidToken: '',
autoGeneratedBenefitId: false,
benefitId: '',
benefitName: '',
consentHealthId: false,
dateOfBirth: '',
gender: '',
mobileNumber: '',
name: '',
stateCode: '',
validity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/notify/benefit';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadharNumberOrUidToken":"","autoGeneratedBenefitId":false,"benefitId":"","benefitName":"","consentHealthId":false,"dateOfBirth":"","gender":"","mobileNumber":"","name":"","stateCode":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadharNumberOrUidToken": @"",
@"autoGeneratedBenefitId": @NO,
@"benefitId": @"",
@"benefitName": @"",
@"consentHealthId": @NO,
@"dateOfBirth": @"",
@"gender": @"",
@"mobileNumber": @"",
@"name": @"",
@"stateCode": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/notify/benefit"]
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}}/v1/hid/benefit/notify/benefit" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/notify/benefit",
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([
'aadharNumberOrUidToken' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'stateCode' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/notify/benefit', [
'body' => '{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/notify/benefit');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadharNumberOrUidToken' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'stateCode' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadharNumberOrUidToken' => '',
'autoGeneratedBenefitId' => null,
'benefitId' => '',
'benefitName' => '',
'consentHealthId' => null,
'dateOfBirth' => '',
'gender' => '',
'mobileNumber' => '',
'name' => '',
'stateCode' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/notify/benefit');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/notify/benefit' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/notify/benefit' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/notify/benefit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/notify/benefit"
payload = {
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": False,
"benefitId": "",
"benefitName": "",
"consentHealthId": False,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/notify/benefit"
payload <- "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/notify/benefit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/notify/benefit') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadharNumberOrUidToken\": \"\",\n \"autoGeneratedBenefitId\": false,\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"consentHealthId\": false,\n \"dateOfBirth\": \"\",\n \"gender\": \"\",\n \"mobileNumber\": \"\",\n \"name\": \"\",\n \"stateCode\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/notify/benefit";
let payload = json!({
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/notify/benefit \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}'
echo '{
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/notify/benefit \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadharNumberOrUidToken": "",\n "autoGeneratedBenefitId": false,\n "benefitId": "",\n "benefitName": "",\n "consentHealthId": false,\n "dateOfBirth": "",\n "gender": "",\n "mobileNumber": "",\n "name": "",\n "stateCode": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/notify/benefit
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"aadharNumberOrUidToken": "",
"autoGeneratedBenefitId": false,
"benefitId": "",
"benefitName": "",
"consentHealthId": false,
"dateOfBirth": "",
"gender": "",
"mobileNumber": "",
"name": "",
"stateCode": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/notify/benefit")! 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
De-Linked with hid.
{{baseUrl}}/v1/hid/benefit/delink
HEADERS
Authorization
{{apiKey}}
BODY json
{
"benefitName": "",
"uidToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/delink");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/delink" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:benefitName ""
:uidToken ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/delink"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\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}}/v1/hid/benefit/delink"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\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}}/v1/hid/benefit/delink");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/delink"
payload := strings.NewReader("{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/delink HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"benefitName": "",
"uidToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/delink")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/delink"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\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 \"benefitName\": \"\",\n \"uidToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/delink")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/delink")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
benefitName: '',
uidToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/delink');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/delink',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitName: '', uidToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/delink';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitName":"","uidToken":""}'
};
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}}/v1/hid/benefit/delink',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "benefitName": "",\n "uidToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/delink")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/delink',
headers: {
authorization: '{{apiKey}}',
'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({benefitName: '', uidToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/delink',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {benefitName: '', uidToken: ''},
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}}/v1/hid/benefit/delink');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
benefitName: '',
uidToken: ''
});
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}}/v1/hid/benefit/delink',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitName: '', uidToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/delink';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitName":"","uidToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"benefitName": @"",
@"uidToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/delink"]
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}}/v1/hid/benefit/delink" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/delink",
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([
'benefitName' => '',
'uidToken' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/delink', [
'body' => '{
"benefitName": "",
"uidToken": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/delink');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'benefitName' => '',
'uidToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'benefitName' => '',
'uidToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/delink');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/delink' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitName": "",
"uidToken": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/delink' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitName": "",
"uidToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/delink", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/delink"
payload = {
"benefitName": "",
"uidToken": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/delink"
payload <- "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/delink")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\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/v1/hid/benefit/delink') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"benefitName\": \"\",\n \"uidToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/delink";
let payload = json!({
"benefitName": "",
"uidToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/delink \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"benefitName": "",
"uidToken": ""
}'
echo '{
"benefitName": "",
"uidToken": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/delink \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "benefitName": "",\n "uidToken": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/delink
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"benefitName": "",
"uidToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/delink")! 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
Generate Aadhaar OTP on registrered mobile number (POST)
{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/hid/benefit/aadhaar/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/hid/benefit/aadhaar/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/aadhaar/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/hid/benefit/aadhaar/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/aadhaar/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/hid/benefit/aadhaar/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/hid/benefit/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"]
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}}/v1/hid/benefit/aadhaar/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/aadhaar/generateOtp', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/aadhaar/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"
payload = { "aadhaar": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/hid/benefit/aadhaar/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/aadhaar/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/aadhaar/generateOtp")! 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
Generate mobile OTP on registrered mobile number
{{baseUrl}}/v1/hid/benefit/mobile/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"mobile": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"mobile\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:mobile ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"mobile\": \"\"\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}}/v1/hid/benefit/mobile/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"mobile\": \"\"\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}}/v1/hid/benefit/mobile/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mobile\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"
payload := strings.NewReader("{\n \"mobile\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/mobile/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"mobile": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"mobile\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mobile\": \"\"\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 \"mobile\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"mobile\": \"\"\n}")
.asString();
const data = JSON.stringify({
mobile: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
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}}/v1/hid/benefit/mobile/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "mobile": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"mobile\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/mobile/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({mobile: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {mobile: ''},
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}}/v1/hid/benefit/mobile/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
mobile: ''
});
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}}/v1/hid/benefit/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"mobile": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"]
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}}/v1/hid/benefit/mobile/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"mobile\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/mobile/generateOtp",
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([
'mobile' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/mobile/generateOtp', [
'body' => '{
"mobile": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/mobile/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mobile' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mobile' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/mobile/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mobile\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/mobile/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"
payload = { "mobile": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp"
payload <- "{\n \"mobile\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"mobile\": \"\"\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/v1/hid/benefit/mobile/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"mobile\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp";
let payload = json!({"mobile": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/mobile/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"mobile": ""
}'
echo '{
"mobile": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/mobile/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "mobile": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/mobile/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["mobile": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/mobile/generateOtp")! 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
Linked with hid.
{{baseUrl}}/v1/hid/benefit/link
HEADERS
Authorization
{{apiKey}}
BODY json
{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/link");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/link" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:benefitId ""
:benefitName ""
:stateCode ""
:uidToken ""
:validity ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/link"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/link"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\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}}/v1/hid/benefit/link");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/link"
payload := strings.NewReader("{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/link HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 97
{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/link")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/link"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\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 \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/link")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/link")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}")
.asString();
const data = JSON.stringify({
benefitId: '',
benefitName: '',
stateCode: '',
uidToken: '',
validity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/link');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/link',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitId: '', benefitName: '', stateCode: '', uidToken: '', validity: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/link';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitId":"","benefitName":"","stateCode":"","uidToken":"","validity":""}'
};
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}}/v1/hid/benefit/link',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "benefitId": "",\n "benefitName": "",\n "stateCode": "",\n "uidToken": "",\n "validity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/link")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/link',
headers: {
authorization: '{{apiKey}}',
'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({benefitId: '', benefitName: '', stateCode: '', uidToken: '', validity: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/link',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {benefitId: '', benefitName: '', stateCode: '', uidToken: '', validity: ''},
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}}/v1/hid/benefit/link');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
benefitId: '',
benefitName: '',
stateCode: '',
uidToken: '',
validity: ''
});
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}}/v1/hid/benefit/link',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitId: '', benefitName: '', stateCode: '', uidToken: '', validity: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/link';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitId":"","benefitName":"","stateCode":"","uidToken":"","validity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"benefitId": @"",
@"benefitName": @"",
@"stateCode": @"",
@"uidToken": @"",
@"validity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/link"]
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}}/v1/hid/benefit/link" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/link",
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([
'benefitId' => '',
'benefitName' => '',
'stateCode' => '',
'uidToken' => '',
'validity' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/link', [
'body' => '{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/link');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'benefitId' => '',
'benefitName' => '',
'stateCode' => '',
'uidToken' => '',
'validity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'benefitId' => '',
'benefitName' => '',
'stateCode' => '',
'uidToken' => '',
'validity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/link');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/link' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/link' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/link", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/link"
payload = {
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/link"
payload <- "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\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/v1/hid/benefit/link') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"benefitId\": \"\",\n \"benefitName\": \"\",\n \"stateCode\": \"\",\n \"uidToken\": \"\",\n \"validity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/link";
let payload = json!({
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/link \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}'
echo '{
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/link \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "benefitId": "",\n "benefitName": "",\n "stateCode": "",\n "uidToken": "",\n "validity": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/link
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"benefitId": "",
"benefitName": "",
"stateCode": "",
"uidToken": "",
"validity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/link")! 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
Search benefit using health id number.
{{baseUrl}}/v1/hid/benefit/search/healthIdNumber
HEADERS
Authorization
{{apiKey}}
BODY json
{
"benefitId": "",
"healthId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:benefitId ""
:healthId ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\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}}/v1/hid/benefit/search/healthIdNumber"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"benefitId\": \"\",\n \"healthId\": \"\"\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}}/v1/hid/benefit/search/healthIdNumber");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"
payload := strings.NewReader("{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/search/healthIdNumber HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"benefitId": "",
"healthId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"benefitId\": \"\",\n \"healthId\": \"\"\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 \"benefitId\": \"\",\n \"healthId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}")
.asString();
const data = JSON.stringify({
benefitId: '',
healthId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitId: '', healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitId":"","healthId":""}'
};
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}}/v1/hid/benefit/search/healthIdNumber',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "benefitId": "",\n "healthId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/search/healthIdNumber',
headers: {
authorization: '{{apiKey}}',
'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({benefitId: '', healthId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {benefitId: '', healthId: ''},
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}}/v1/hid/benefit/search/healthIdNumber');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
benefitId: '',
healthId: ''
});
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}}/v1/hid/benefit/search/healthIdNumber',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {benefitId: '', healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"benefitId":"","healthId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"benefitId": @"",
@"healthId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"]
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}}/v1/hid/benefit/search/healthIdNumber" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/search/healthIdNumber",
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([
'benefitId' => '',
'healthId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/search/healthIdNumber', [
'body' => '{
"benefitId": "",
"healthId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/search/healthIdNumber');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'benefitId' => '',
'healthId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'benefitId' => '',
'healthId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/search/healthIdNumber');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitId": "",
"healthId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/search/healthIdNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"benefitId": "",
"healthId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/search/healthIdNumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"
payload = {
"benefitId": "",
"healthId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber"
payload <- "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\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/v1/hid/benefit/search/healthIdNumber') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"benefitId\": \"\",\n \"healthId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber";
let payload = json!({
"benefitId": "",
"healthId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/search/healthIdNumber \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"benefitId": "",
"healthId": ""
}'
echo '{
"benefitId": "",
"healthId": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/search/healthIdNumber \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "benefitId": "",\n "healthId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/search/healthIdNumber
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"benefitId": "",
"healthId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/search/healthIdNumber")! 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
Search health id number using aadhar or aadhar token.
{{baseUrl}}/v1/hid/benefit/search/aadhaar
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/search/aadhaar");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/search/aadhaar" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/search/aadhaar"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/hid/benefit/search/aadhaar"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/hid/benefit/search/aadhaar");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/search/aadhaar"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/search/aadhaar HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/search/aadhaar")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/search/aadhaar"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/search/aadhaar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/search/aadhaar")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/search/aadhaar');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/search/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/search/aadhaar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/hid/benefit/search/aadhaar',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/search/aadhaar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/search/aadhaar',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/search/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/hid/benefit/search/aadhaar');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/hid/benefit/search/aadhaar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/search/aadhaar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/search/aadhaar"]
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}}/v1/hid/benefit/search/aadhaar" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/search/aadhaar",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/search/aadhaar', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/search/aadhaar');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/search/aadhaar');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/search/aadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/search/aadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/search/aadhaar", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/search/aadhaar"
payload = { "aadhaar": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/search/aadhaar"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/search/aadhaar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/hid/benefit/search/aadhaar') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/search/aadhaar";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/search/aadhaar \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/search/aadhaar \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/search/aadhaar
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/search/aadhaar")! 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
Update account information (POST)
{{baseUrl}}/v1/hid/benefit/update/profile
HEADERS
Authorization
{{apiKey}}
BODY json
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/update/profile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/update/profile" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:address ""
:dayOfBirth ""
:districtCode ""
:email ""
:firstName ""
:healthId ""
:healthIdNumber ""
:lastName ""
:middleName ""
:monthOfBirth ""
:password ""
:pincode 0
:profilePhoto ""
:stateCode ""
:subdistrictCode ""
:townCode ""
:villageCode ""
:wardCode ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/update/profile"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/hid/benefit/update/profile"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/hid/benefit/update/profile");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/update/profile"
payload := strings.NewReader("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/update/profile HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 375
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/update/profile")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/update/profile"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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 \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/profile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/update/profile")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/update/profile');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/profile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/update/profile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","healthId":"","healthIdNumber":"","lastName":"","middleName":"","monthOfBirth":"","password":"","pincode":0,"profilePhoto":"","stateCode":"","subdistrictCode":"","townCode":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
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}}/v1/hid/benefit/update/profile',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "healthId": "",\n "healthIdNumber": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "stateCode": "",\n "subdistrictCode": "",\n "townCode": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/profile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/update/profile',
headers: {
authorization: '{{apiKey}}',
'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({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/profile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
},
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}}/v1/hid/benefit/update/profile');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
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}}/v1/hid/benefit/update/profile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
healthIdNumber: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/update/profile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","healthId":"","healthIdNumber":"","lastName":"","middleName":"","monthOfBirth":"","password":"","pincode":0,"profilePhoto":"","stateCode":"","subdistrictCode":"","townCode":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"dayOfBirth": @"",
@"districtCode": @"",
@"email": @"",
@"firstName": @"",
@"healthId": @"",
@"healthIdNumber": @"",
@"lastName": @"",
@"middleName": @"",
@"monthOfBirth": @"",
@"password": @"",
@"pincode": @0,
@"profilePhoto": @"",
@"stateCode": @"",
@"subdistrictCode": @"",
@"townCode": @"",
@"villageCode": @"",
@"wardCode": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/update/profile"]
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}}/v1/hid/benefit/update/profile" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/update/profile",
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([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'healthIdNumber' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/update/profile', [
'body' => '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/update/profile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'healthIdNumber' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'healthIdNumber' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/update/profile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/update/profile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/update/profile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/update/profile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/update/profile"
payload = {
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/update/profile"
payload <- "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/update/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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/v1/hid/benefit/update/profile') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"healthIdNumber\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/update/profile";
let payload = json!({
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/update/profile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
echo '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/update/profile \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "healthId": "",\n "healthIdNumber": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "stateCode": "",\n "subdistrictCode": "",\n "townCode": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/update/profile
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"healthIdNumber": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/update/profile")! 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
Update health id status .
{{baseUrl}}/v1/hid/benefit/update/status
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthIdNumber": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/update/status");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthIdNumber\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/update/status" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthIdNumber ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/update/status"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthIdNumber\": \"\"\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}}/v1/hid/benefit/update/status"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthIdNumber\": \"\"\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}}/v1/hid/benefit/update/status");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthIdNumber\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/update/status"
payload := strings.NewReader("{\n \"healthIdNumber\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/update/status HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"healthIdNumber": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/update/status")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthIdNumber\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/update/status"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthIdNumber\": \"\"\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 \"healthIdNumber\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/status")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/update/status")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthIdNumber\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthIdNumber: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/update/status');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/status',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthIdNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/update/status';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthIdNumber":""}'
};
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}}/v1/hid/benefit/update/status',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthIdNumber": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthIdNumber\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/status")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/update/status',
headers: {
authorization: '{{apiKey}}',
'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({healthIdNumber: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/status',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthIdNumber: ''},
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}}/v1/hid/benefit/update/status');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthIdNumber: ''
});
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}}/v1/hid/benefit/update/status',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthIdNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/update/status';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthIdNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthIdNumber": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/update/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}}/v1/hid/benefit/update/status" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthIdNumber\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/update/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([
'healthIdNumber' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/update/status', [
'body' => '{
"healthIdNumber": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/update/status');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthIdNumber' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthIdNumber' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/update/status');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/update/status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthIdNumber": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/update/status' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthIdNumber": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthIdNumber\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/update/status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/update/status"
payload = { "healthIdNumber": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/update/status"
payload <- "{\n \"healthIdNumber\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/update/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthIdNumber\": \"\"\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/v1/hid/benefit/update/status') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthIdNumber\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/update/status";
let payload = json!({"healthIdNumber": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/update/status \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthIdNumber": ""
}'
echo '{
"healthIdNumber": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/update/status \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthIdNumber": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/update/status
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["healthIdNumber": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/update/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
Update mobile number for account.
{{baseUrl}}/v1/hid/benefit/update/mobile
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthIdNumber": "",
"mobile": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/hid/benefit/update/mobile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/hid/benefit/update/mobile" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthIdNumber ""
:mobile ""}})
require "http/client"
url = "{{baseUrl}}/v1/hid/benefit/update/mobile"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\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}}/v1/hid/benefit/update/mobile"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\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}}/v1/hid/benefit/update/mobile");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/hid/benefit/update/mobile"
payload := strings.NewReader("{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/hid/benefit/update/mobile HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"healthIdNumber": "",
"mobile": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/hid/benefit/update/mobile")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/hid/benefit/update/mobile"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\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 \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/mobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/hid/benefit/update/mobile")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthIdNumber: '',
mobile: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/hid/benefit/update/mobile');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthIdNumber: '', mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/hid/benefit/update/mobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthIdNumber":"","mobile":""}'
};
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}}/v1/hid/benefit/update/mobile',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthIdNumber": "",\n "mobile": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/hid/benefit/update/mobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/hid/benefit/update/mobile',
headers: {
authorization: '{{apiKey}}',
'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({healthIdNumber: '', mobile: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/hid/benefit/update/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthIdNumber: '', mobile: ''},
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}}/v1/hid/benefit/update/mobile');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthIdNumber: '',
mobile: ''
});
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}}/v1/hid/benefit/update/mobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthIdNumber: '', mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/hid/benefit/update/mobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthIdNumber":"","mobile":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthIdNumber": @"",
@"mobile": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/hid/benefit/update/mobile"]
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}}/v1/hid/benefit/update/mobile" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/hid/benefit/update/mobile",
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([
'healthIdNumber' => '',
'mobile' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/hid/benefit/update/mobile', [
'body' => '{
"healthIdNumber": "",
"mobile": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/hid/benefit/update/mobile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthIdNumber' => '',
'mobile' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthIdNumber' => '',
'mobile' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/hid/benefit/update/mobile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/hid/benefit/update/mobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthIdNumber": "",
"mobile": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/hid/benefit/update/mobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthIdNumber": "",
"mobile": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/hid/benefit/update/mobile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/hid/benefit/update/mobile"
payload = {
"healthIdNumber": "",
"mobile": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/hid/benefit/update/mobile"
payload <- "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/hid/benefit/update/mobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\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/v1/hid/benefit/update/mobile') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthIdNumber\": \"\",\n \"mobile\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/hid/benefit/update/mobile";
let payload = json!({
"healthIdNumber": "",
"mobile": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/hid/benefit/update/mobile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthIdNumber": "",
"mobile": ""
}'
echo '{
"healthIdNumber": "",
"mobile": ""
}' | \
http POST {{baseUrl}}/v1/hid/benefit/update/mobile \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthIdNumber": "",\n "mobile": ""\n}' \
--output-document \
- {{baseUrl}}/v1/hid/benefit/update/mobile
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"healthIdNumber": "",
"mobile": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/hid/benefit/update/mobile")! 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
Change password via Aadhar for heath id.
{{baseUrl}}/v1/account/change/passwd/byAadhaar
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"newPassword": "",
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/change/passwd/byAadhaar");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/change/passwd/byAadhaar" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:newPassword ""
:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/change/passwd/byAadhaar"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/account/change/passwd/byAadhaar"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/account/change/passwd/byAadhaar");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/change/passwd/byAadhaar"
payload := strings.NewReader("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/change/passwd/byAadhaar HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"newPassword": "",
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/change/passwd/byAadhaar")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/change/passwd/byAadhaar"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/byAadhaar")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/change/passwd/byAadhaar")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
newPassword: '',
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/change/passwd/byAadhaar');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/passwd/byAadhaar',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/change/passwd/byAadhaar';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","otp":"","txnId":""}'
};
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}}/v1/account/change/passwd/byAadhaar',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "newPassword": "",\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/byAadhaar")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/change/passwd/byAadhaar',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({newPassword: '', otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/passwd/byAadhaar',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {newPassword: '', otp: '', txnId: ''},
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}}/v1/account/change/passwd/byAadhaar');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
newPassword: '',
otp: '',
txnId: ''
});
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}}/v1/account/change/passwd/byAadhaar',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/change/passwd/byAadhaar';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"newPassword": @"",
@"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/change/passwd/byAadhaar"]
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}}/v1/account/change/passwd/byAadhaar" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/change/passwd/byAadhaar",
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([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/change/passwd/byAadhaar', [
'body' => '{
"newPassword": "",
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/change/passwd/byAadhaar');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/change/passwd/byAadhaar');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/change/passwd/byAadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/change/passwd/byAadhaar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/change/passwd/byAadhaar", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/change/passwd/byAadhaar"
payload = {
"newPassword": "",
"otp": "",
"txnId": ""
}
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/change/passwd/byAadhaar"
payload <- "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/change/passwd/byAadhaar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/account/change/passwd/byAadhaar') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/change/passwd/byAadhaar";
let payload = json!({
"newPassword": "",
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/change/passwd/byAadhaar \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
echo '{
"newPassword": "",
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/account/change/passwd/byAadhaar \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "newPassword": "",\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/change/passwd/byAadhaar
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"newPassword": "",
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/change/passwd/byAadhaar")! 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
Change password via mobile for heath id.
{{baseUrl}}/v1/account/change/passwd/byMobile
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"newPassword": "",
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/change/passwd/byMobile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/change/passwd/byMobile" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:newPassword ""
:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/change/passwd/byMobile"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/account/change/passwd/byMobile"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/account/change/passwd/byMobile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/change/passwd/byMobile"
payload := strings.NewReader("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/change/passwd/byMobile HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"newPassword": "",
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/change/passwd/byMobile")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/change/passwd/byMobile"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/byMobile")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/change/passwd/byMobile")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
newPassword: '',
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/change/passwd/byMobile');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/passwd/byMobile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/change/passwd/byMobile';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","otp":"","txnId":""}'
};
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}}/v1/account/change/passwd/byMobile',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "newPassword": "",\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/byMobile")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/change/passwd/byMobile',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({newPassword: '', otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/passwd/byMobile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {newPassword: '', otp: '', txnId: ''},
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}}/v1/account/change/passwd/byMobile');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
newPassword: '',
otp: '',
txnId: ''
});
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}}/v1/account/change/passwd/byMobile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/change/passwd/byMobile';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"newPassword": @"",
@"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/change/passwd/byMobile"]
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}}/v1/account/change/passwd/byMobile" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/change/passwd/byMobile",
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([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/change/passwd/byMobile', [
'body' => '{
"newPassword": "",
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/change/passwd/byMobile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'newPassword' => '',
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/change/passwd/byMobile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/change/passwd/byMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/change/passwd/byMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/change/passwd/byMobile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/change/passwd/byMobile"
payload = {
"newPassword": "",
"otp": "",
"txnId": ""
}
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/change/passwd/byMobile"
payload <- "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/change/passwd/byMobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/account/change/passwd/byMobile') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"newPassword\": \"\",\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/change/passwd/byMobile";
let payload = json!({
"newPassword": "",
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/change/passwd/byMobile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"newPassword": "",
"otp": "",
"txnId": ""
}'
echo '{
"newPassword": "",
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/account/change/passwd/byMobile \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "newPassword": "",\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/change/passwd/byMobile
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"newPassword": "",
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/change/passwd/byMobile")! 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
Change password via password for heath id.
{{baseUrl}}/v1/account/change/password
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"newPassword": "",
"oldPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/change/password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/change/password" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:newPassword ""
:oldPassword ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/change/password"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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}}/v1/account/change/password"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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}}/v1/account/change/password");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/change/password"
payload := strings.NewReader("{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/change/password HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"newPassword": "",
"oldPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/change/password")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/change/password"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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 \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/change/password")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/change/password")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
newPassword: '',
oldPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/change/password');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/password',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', oldPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/change/password';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","oldPassword":""}'
};
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}}/v1/account/change/password',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "newPassword": "",\n "oldPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/change/password")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/change/password',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({newPassword: '', oldPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/change/password',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {newPassword: '', oldPassword: ''},
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}}/v1/account/change/password');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
newPassword: '',
oldPassword: ''
});
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}}/v1/account/change/password',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {newPassword: '', oldPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/change/password';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"newPassword":"","oldPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"newPassword": @"",
@"oldPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/change/password"]
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}}/v1/account/change/password" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/change/password",
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([
'newPassword' => '',
'oldPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/change/password', [
'body' => '{
"newPassword": "",
"oldPassword": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/change/password');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'newPassword' => '',
'oldPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'newPassword' => '',
'oldPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/change/password');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/change/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"oldPassword": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/change/password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"newPassword": "",
"oldPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/change/password", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/change/password"
payload = {
"newPassword": "",
"oldPassword": ""
}
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/change/password"
payload <- "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/change/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\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/v1/account/change/password') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"newPassword\": \"\",\n \"oldPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/change/password";
let payload = json!({
"newPassword": "",
"oldPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/change/password \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"newPassword": "",
"oldPassword": ""
}'
echo '{
"newPassword": "",
"oldPassword": ""
}' | \
http POST {{baseUrl}}/v1/account/change/password \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "newPassword": "",\n "oldPassword": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/change/password
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"newPassword": "",
"oldPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/change/password")! 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()
DELETE
Delete account
{{baseUrl}}/v1/account/profile
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/profile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/account/profile" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/profile"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/v1/account/profile"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/profile");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/profile"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/v1/account/profile HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/account/profile")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/profile"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.method("DELETE", 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}}/v1/account/profile")
.delete(null)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/account/profile")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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('DELETE', '{{baseUrl}}/v1/account/profile');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/profile';
const options = {method: 'DELETE', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/profile',
method: 'DELETE',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/profile")
.delete(null)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/profile',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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: 'DELETE',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/account/profile');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/profile';
const options = {method: 'DELETE', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/profile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/profile" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/v1/account/profile', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/profile');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/profile');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/profile' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/profile' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("DELETE", "/baseUrl/v1/account/profile", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/profile"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/profile"
response <- VERB("DELETE", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/v1/account/profile') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/profile";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/v1/account/profile \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http DELETE {{baseUrl}}/v1/account/profile \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method DELETE \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/profile
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/profile")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
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
Generate Aadhaar OTP on registrered for link account with aadhar number
{{baseUrl}}/v1/account/aadhaar/generateOTP
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/aadhaar/generateOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/aadhaar/generateOTP" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/aadhaar/generateOTP"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/account/aadhaar/generateOTP"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/aadhaar/generateOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/aadhaar/generateOTP"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/account/aadhaar/generateOTP HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/aadhaar/generateOTP")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/aadhaar/generateOTP"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.method("POST", 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}}/v1/account/aadhaar/generateOTP")
.post(null)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/aadhaar/generateOTP")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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('POST', '{{baseUrl}}/v1/account/aadhaar/generateOTP');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/aadhaar/generateOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/aadhaar/generateOTP';
const options = {method: 'POST', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/aadhaar/generateOTP',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/aadhaar/generateOTP")
.post(null)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/aadhaar/generateOTP',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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: 'POST',
url: '{{baseUrl}}/v1/account/aadhaar/generateOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/account/aadhaar/generateOTP');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/aadhaar/generateOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/aadhaar/generateOTP';
const options = {method: 'POST', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/aadhaar/generateOTP"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/aadhaar/generateOTP" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/aadhaar/generateOTP",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/aadhaar/generateOTP', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/aadhaar/generateOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/aadhaar/generateOTP');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/aadhaar/generateOTP' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/aadhaar/generateOTP' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("POST", "/baseUrl/v1/account/aadhaar/generateOTP", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/aadhaar/generateOTP"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/aadhaar/generateOTP"
response <- VERB("POST", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/aadhaar/generateOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/account/aadhaar/generateOTP') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/aadhaar/generateOTP";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/account/aadhaar/generateOTP \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http POST {{baseUrl}}/v1/account/aadhaar/generateOTP \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/aadhaar/generateOTP
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/aadhaar/generateOTP")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
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
Generate Aadhaar OTP on registrered mobile number.
{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/change/passwd/generateAadhaarOTP HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/change/passwd/generateAadhaarOTP")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/change/passwd/generateAadhaarOTP');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/change/passwd/generateAadhaarOTP',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/change/passwd/generateAadhaarOTP',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/change/passwd/generateAadhaarOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/change/passwd/generateAadhaarOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/change/passwd/generateAadhaarOTP" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/change/passwd/generateAadhaarOTP", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/change/passwd/generateAadhaarOTP') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/change/passwd/generateAadhaarOTP")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Generate Health ID card PNG
{{baseUrl}}/v1/account/getPngCard
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/getPngCard");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/getPngCard" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/getPngCard"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/getPngCard"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/getPngCard");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/getPngCard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/getPngCard HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/getPngCard")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/getPngCard"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getPngCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/getPngCard")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getPngCard');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/getPngCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/getPngCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/getPngCard',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/getPngCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/getPngCard',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/getPngCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/getPngCard');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/getPngCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/getPngCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/getPngCard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/getPngCard" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/getPngCard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/getPngCard', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/getPngCard');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/getPngCard');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/getPngCard' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/getPngCard' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/getPngCard", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/getPngCard"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/getPngCard"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/getPngCard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/getPngCard') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/getPngCard";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/getPngCard \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/getPngCard \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/getPngCard
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/getPngCard")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Generate Health ID card SVG
{{baseUrl}}/v1/account/getSvgCard
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/getSvgCard");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/getSvgCard" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/getSvgCard"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/getSvgCard"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/getSvgCard");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/getSvgCard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/getSvgCard HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/getSvgCard")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/getSvgCard"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getSvgCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/getSvgCard")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getSvgCard');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/getSvgCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/getSvgCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/getSvgCard',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/getSvgCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/getSvgCard',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/getSvgCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/getSvgCard');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/getSvgCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/getSvgCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/getSvgCard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/getSvgCard" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/getSvgCard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/getSvgCard', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/getSvgCard');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/getSvgCard');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/getSvgCard' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/getSvgCard' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/getSvgCard", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/getSvgCard"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/getSvgCard"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/getSvgCard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/getSvgCard') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/getSvgCard";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/getSvgCard \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/getSvgCard \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/getSvgCard
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/getSvgCard")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Generate Health ID card in PDF format
{{baseUrl}}/v1/account/getCard
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/getCard");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/getCard" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/getCard"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/getCard"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/getCard");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/getCard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/getCard HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/getCard")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/getCard"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/getCard")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/getCard');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/getCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/getCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/getCard',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/getCard")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/getCard',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/getCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/getCard');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/getCard',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/getCard';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/getCard"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/getCard" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/getCard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/getCard', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/getCard');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/getCard');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/getCard' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/getCard' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/getCard", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/getCard"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/getCard"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/getCard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/getCard') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/getCard";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/getCard \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/getCard \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/getCard
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/getCard")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Generate Mobile OTP to start registration.
{{baseUrl}}/v1/account/change/passwd/generateMobileOTP
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/change/passwd/generateMobileOTP HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/change/passwd/generateMobileOTP")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/change/passwd/generateMobileOTP');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/change/passwd/generateMobileOTP',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/change/passwd/generateMobileOTP',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/change/passwd/generateMobileOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/change/passwd/generateMobileOTP',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/change/passwd/generateMobileOTP" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/change/passwd/generateMobileOTP",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/change/passwd/generateMobileOTP');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/change/passwd/generateMobileOTP');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/change/passwd/generateMobileOTP' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/change/passwd/generateMobileOTP", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/change/passwd/generateMobileOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/change/passwd/generateMobileOTP') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/change/passwd/generateMobileOTP \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/change/passwd/generateMobileOTP \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/change/passwd/generateMobileOTP
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/change/passwd/generateMobileOTP")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 List of Benefits associated with HealthID.
{{baseUrl}}/v1/account/benefits
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/benefits");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/benefits" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/benefits"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/benefits"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/benefits");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/benefits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/benefits HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/benefits")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/benefits"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/benefits")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/benefits")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/benefits');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/benefits',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/benefits';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/benefits',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/benefits")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/benefits',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/benefits',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/benefits');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/benefits',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/benefits';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/benefits"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/benefits" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/benefits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/benefits', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/benefits');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/benefits');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/benefits' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/benefits' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/benefits", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/benefits"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/benefits"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/benefits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/benefits') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/benefits";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/benefits \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/benefits \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/benefits
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/benefits")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 Quick Response code in PNG format for this account.
{{baseUrl}}/v1/account/qrCode
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/qrCode");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/qrCode" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/qrCode"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/qrCode"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/qrCode");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/qrCode"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/qrCode HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/qrCode")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/qrCode"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/qrCode")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/qrCode")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/qrCode');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/qrCode',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/qrCode';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/qrCode',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/qrCode")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/qrCode',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/qrCode',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/qrCode');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/qrCode',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/qrCode';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/qrCode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/qrCode" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/qrCode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/qrCode', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/qrCode');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/qrCode');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/qrCode' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/qrCode' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/qrCode", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/qrCode"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/qrCode"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/qrCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/qrCode') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/qrCode";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/qrCode \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/qrCode \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/qrCode
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/qrCode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 account information.
{{baseUrl}}/v1/account/profile
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/profile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/account/profile" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/account/profile"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/account/profile"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/account/profile");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/account/profile HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/account/profile")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/profile"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/profile")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/account/profile")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/account/profile');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/profile';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/account/profile',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/profile")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/account/profile',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/account/profile');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/profile';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/profile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/account/profile" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/account/profile', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/profile');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/account/profile');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/profile' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/profile' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/account/profile", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/profile"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/profile"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/account/profile') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/profile";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/account/profile \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/account/profile \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/account/profile
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/profile")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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
Update account information
{{baseUrl}}/v1/account/profile
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/profile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/profile" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:address ""
:dayOfBirth ""
:districtCode ""
:email ""
:firstName ""
:healthId ""
:lastName ""
:middleName ""
:monthOfBirth ""
:password ""
:pincode 0
:profilePhoto ""
:stateCode ""
:subdistrictCode ""
:townCode ""
:villageCode ""
:wardCode ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/profile"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/account/profile"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/account/profile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/profile"
payload := strings.NewReader("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/profile HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 351
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/profile")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/profile"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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 \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/profile")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/profile")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/profile');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/profile';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","healthId":"","lastName":"","middleName":"","monthOfBirth":"","password":"","pincode":0,"profilePhoto":"","stateCode":"","subdistrictCode":"","townCode":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
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}}/v1/account/profile',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "stateCode": "",\n "subdistrictCode": "",\n "townCode": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/profile")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/profile',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
},
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}}/v1/account/profile');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
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}}/v1/account/profile',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
password: '',
pincode: 0,
profilePhoto: '',
stateCode: '',
subdistrictCode: '',
townCode: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/profile';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","healthId":"","lastName":"","middleName":"","monthOfBirth":"","password":"","pincode":0,"profilePhoto":"","stateCode":"","subdistrictCode":"","townCode":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"dayOfBirth": @"",
@"districtCode": @"",
@"email": @"",
@"firstName": @"",
@"healthId": @"",
@"lastName": @"",
@"middleName": @"",
@"monthOfBirth": @"",
@"password": @"",
@"pincode": @0,
@"profilePhoto": @"",
@"stateCode": @"",
@"subdistrictCode": @"",
@"townCode": @"",
@"villageCode": @"",
@"wardCode": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/profile"]
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}}/v1/account/profile" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/profile",
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([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/profile', [
'body' => '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/profile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'stateCode' => '',
'subdistrictCode' => '',
'townCode' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/profile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/profile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/profile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/profile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/profile"
payload = {
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/profile"
payload <- "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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/v1/account/profile') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"townCode\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/profile";
let payload = json!({
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/profile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
echo '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/account/profile \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "stateCode": "",\n "subdistrictCode": "",\n "townCode": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/profile
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"stateCode": "",
"subdistrictCode": "",
"townCode": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/profile")! 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
Validate auth token
{{baseUrl}}/v1/account/token
HEADERS
Authorization
{{apiKey}}
BODY json
{
"authToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/token");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"authToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/token" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:authToken ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/token"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"authToken\": \"\"\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}}/v1/account/token"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"authToken\": \"\"\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}}/v1/account/token");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"authToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/token"
payload := strings.NewReader("{\n \"authToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/token HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"authToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/token")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"authToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/token"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"authToken\": \"\"\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 \"authToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/token")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/token")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"authToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
authToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/token');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/token',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/token';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authToken":""}'
};
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}}/v1/account/token',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "authToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"authToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/token")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/token',
headers: {
authorization: '{{apiKey}}',
'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({authToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/token',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {authToken: ''},
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}}/v1/account/token');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
authToken: ''
});
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}}/v1/account/token',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {authToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/token';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"authToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"authToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/token"]
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}}/v1/account/token" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"authToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/token",
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([
'authToken' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/account/token', [
'body' => '{
"authToken": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/token');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'authToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'authToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/token');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/token' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authToken": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/token' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"authToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"authToken\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/token", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/token"
payload = { "authToken": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/token"
payload <- "{\n \"authToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"authToken\": \"\"\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/v1/account/token') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"authToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/token";
let payload = json!({"authToken": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/token \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"authToken": ""
}'
echo '{
"authToken": ""
}' | \
http POST {{baseUrl}}/v1/account/token \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "authToken": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/token
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["authToken": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/token")! 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
Verify Aadhaar OTP to complete KYC-re-KYC verification.
{{baseUrl}}/v1/account/aadhaar/verifyOTP
HEADERS
X-Token
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"restrictions": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/account/aadhaar/verifyOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/account/aadhaar/verifyOTP" {:headers {:x-token ""
:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:restrictions ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/account/aadhaar/verifyOTP"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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}}/v1/account/aadhaar/verifyOTP"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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}}/v1/account/aadhaar/verifyOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/account/aadhaar/verifyOTP"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
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/v1/account/aadhaar/verifyOTP HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"otp": "",
"restrictions": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/account/aadhaar/verifyOTP")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/account/aadhaar/verifyOTP"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/account/aadhaar/verifyOTP")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/account/aadhaar/verifyOTP")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
restrictions: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/account/aadhaar/verifyOTP');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/aadhaar/verifyOTP',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', restrictions: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/account/aadhaar/verifyOTP';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","restrictions":"","txnId":""}'
};
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}}/v1/account/aadhaar/verifyOTP',
method: 'POST',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "restrictions": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/account/aadhaar/verifyOTP")
.post(body)
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.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/v1/account/aadhaar/verifyOTP',
headers: {
'x-token': '',
authorization: '{{apiKey}}',
'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({otp: '', restrictions: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/account/aadhaar/verifyOTP',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', restrictions: '', txnId: ''},
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}}/v1/account/aadhaar/verifyOTP');
req.headers({
'x-token': '',
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
restrictions: '',
txnId: ''
});
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}}/v1/account/aadhaar/verifyOTP',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', restrictions: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/account/aadhaar/verifyOTP';
const options = {
method: 'POST',
headers: {'x-token': '', authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","restrictions":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"restrictions": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/account/aadhaar/verifyOTP"]
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}}/v1/account/aadhaar/verifyOTP" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/account/aadhaar/verifyOTP",
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([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"content-type: application/json",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/account/aadhaar/verifyOTP', [
'body' => '{
"otp": "",
"restrictions": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/account/aadhaar/verifyOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/account/aadhaar/verifyOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/account/aadhaar/verifyOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/account/aadhaar/verifyOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'x-token': "",
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/account/aadhaar/verifyOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/account/aadhaar/verifyOTP"
payload = {
"otp": "",
"restrictions": "",
"txnId": ""
}
headers = {
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/account/aadhaar/verifyOTP"
payload <- "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/account/aadhaar/verifyOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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/v1/account/aadhaar/verifyOTP') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/account/aadhaar/verifyOTP";
let payload = json!({
"otp": "",
"restrictions": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".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}}/v1/account/aadhaar/verifyOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--header 'x-token: ' \
--data '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
echo '{
"otp": "",
"restrictions": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/account/aadhaar/verifyOTP \
authorization:'{{apiKey}}' \
content-type:application/json \
x-token:''
wget --quiet \
--method POST \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "restrictions": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/account/aadhaar/verifyOTP
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"restrictions": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/account/aadhaar/verifyOTP")! 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 Health ID using pre-verified Aadhaar & Mobile.
{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified
HEADERS
Authorization
{{apiKey}}
BODY json
{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:email ""
:firstName ""
:healthId ""
:lastName ""
:middleName ""
:password ""
:profilePhoto ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/createHealthIdWithPreVerified"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/createHealthIdWithPreVerified");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"
payload := strings.NewReader("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/createHealthIdWithPreVerified HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 147
{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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 \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","healthId":"","lastName":"","middleName":"","password":"","profilePhoto":"","txnId":""}'
};
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}}/v1/registration/aadhaar/createHealthIdWithPreVerified',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "password": "",\n "profilePhoto": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/createHealthIdWithPreVerified',
headers: {
authorization: '{{apiKey}}',
'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({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
},
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}}/v1/registration/aadhaar/createHealthIdWithPreVerified');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
});
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}}/v1/registration/aadhaar/createHealthIdWithPreVerified',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
healthId: '',
lastName: '',
middleName: '',
password: '',
profilePhoto: '',
txnId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","healthId":"","lastName":"","middleName":"","password":"","profilePhoto":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"email": @"",
@"firstName": @"",
@"healthId": @"",
@"lastName": @"",
@"middleName": @"",
@"password": @"",
@"profilePhoto": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"]
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}}/v1/registration/aadhaar/createHealthIdWithPreVerified" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified",
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([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/createHealthIdWithPreVerified', [
'body' => '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'firstName' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'password' => '',
'profilePhoto' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/createHealthIdWithPreVerified", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"
payload = {
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified"
payload <- "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\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/v1/registration/aadhaar/createHealthIdWithPreVerified') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified";
let payload = json!({
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/createHealthIdWithPreVerified \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}'
echo '{
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "firstName": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "password": "",\n "profilePhoto": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"email": "",
"firstName": "",
"healthId": "",
"lastName": "",
"middleName": "",
"password": "",
"profilePhoto": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithPreVerified")! 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
Generate Aadhaar OTP on registrered mobile number (1)
{{baseUrl}}/v1/registration/aadhaar/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/registration/aadhaar/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/registration/aadhaar/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/generateOtp"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/registration/aadhaar/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/registration/aadhaar/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/registration/aadhaar/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/generateOtp"]
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}}/v1/registration/aadhaar/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/generateOtp",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/generateOtp', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/generateOtp"
payload = { "aadhaar": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/generateOtp"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/registration/aadhaar/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/generateOtp";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/generateOtp")! 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
Generate Mobile OTP for verification.
{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP
HEADERS
Authorization
{{apiKey}}
BODY json
{
"mobile": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:mobile ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"mobile\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/generateMobileOTP"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"mobile\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/generateMobileOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"
payload := strings.NewReader("{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/generateMobileOTP HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 33
{
"mobile": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mobile\": \"\",\n \"txnId\": \"\"\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 \"mobile\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
mobile: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":"","txnId":""}'
};
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}}/v1/registration/aadhaar/generateMobileOTP',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "mobile": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/generateMobileOTP',
headers: {
authorization: '{{apiKey}}',
'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({mobile: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {mobile: '', txnId: ''},
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}}/v1/registration/aadhaar/generateMobileOTP');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
mobile: '',
txnId: ''
});
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}}/v1/registration/aadhaar/generateMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"mobile": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"]
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}}/v1/registration/aadhaar/generateMobileOTP" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP",
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([
'mobile' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/generateMobileOTP', [
'body' => '{
"mobile": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mobile' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mobile' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/generateMobileOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"
payload = {
"mobile": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP"
payload <- "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"mobile\": \"\",\n \"txnId\": \"\"\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/v1/registration/aadhaar/generateMobileOTP') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"mobile\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP";
let payload = json!({
"mobile": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/generateMobileOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"mobile": "",
"txnId": ""
}'
echo '{
"mobile": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/generateMobileOTP \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "mobile": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/generateMobileOTP
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"mobile": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/generateMobileOTP")! 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
Resend Aadhaar OTP on registrered mobile number to create Health ID.
{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/resendAadhaarOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/resendAadhaarOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"
payload := strings.NewReader("{\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/resendAadhaarOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"txnId\": \"\"\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 \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
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}}/v1/registration/aadhaar/resendAadhaarOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/resendAadhaarOtp',
headers: {
authorization: '{{apiKey}}',
'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({txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {txnId: ''},
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}}/v1/registration/aadhaar/resendAadhaarOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
txnId: ''
});
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}}/v1/registration/aadhaar/resendAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"]
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}}/v1/registration/aadhaar/resendAadhaarOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp",
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([
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/resendAadhaarOtp', [
'body' => '{
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/resendAadhaarOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"
payload = { "txnId": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp"
payload <- "{\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"txnId\": \"\"\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/v1/registration/aadhaar/resendAadhaarOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp";
let payload = json!({"txnId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/resendAadhaarOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"txnId": ""
}'
echo '{
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["txnId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/resendAadhaarOtp")! 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
Search health id number using aadhar.
{{baseUrl}}/v1/registration/aadhaar/search/aadhar
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/search/aadhar");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/search/aadhar" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/search/aadhar"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\"\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}}/v1/registration/aadhaar/search/aadhar"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\"\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}}/v1/registration/aadhaar/search/aadhar");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/search/aadhar"
payload := strings.NewReader("{\n \"aadhaar\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/search/aadhar HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"aadhaar": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/search/aadhar")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/search/aadhar"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\"\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 \"aadhaar\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/search/aadhar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/search/aadhar")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/search/aadhar');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/search/aadhar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/search/aadhar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
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}}/v1/registration/aadhaar/search/aadhar',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/search/aadhar")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/search/aadhar',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/search/aadhar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: ''},
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}}/v1/registration/aadhaar/search/aadhar');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: ''
});
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}}/v1/registration/aadhaar/search/aadhar',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/search/aadhar';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/search/aadhar"]
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}}/v1/registration/aadhaar/search/aadhar" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/search/aadhar",
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([
'aadhaar' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/search/aadhar', [
'body' => '{
"aadhaar": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/search/aadhar');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/search/aadhar');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/search/aadhar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/search/aadhar' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/search/aadhar", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/search/aadhar"
payload = { "aadhaar": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/search/aadhar"
payload <- "{\n \"aadhaar\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/search/aadhar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\"\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/v1/registration/aadhaar/search/aadhar') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/search/aadhar";
let payload = json!({"aadhaar": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/search/aadhar \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": ""
}'
echo '{
"aadhaar": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/search/aadhar \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/search/aadhar
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["aadhaar": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/search/aadhar")! 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
Verify Aadhaar OTP and continue for mobile verification.
{{baseUrl}}/v1/registration/aadhaar/verifyOTP
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"restrictions": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/verifyOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/verifyOTP" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:restrictions ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/verifyOTP"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/verifyOTP"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/verifyOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/verifyOTP"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/verifyOTP HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"otp": "",
"restrictions": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/verifyOTP")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/verifyOTP"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/verifyOTP")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
restrictions: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/verifyOTP');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', restrictions: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","restrictions":"","txnId":""}'
};
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}}/v1/registration/aadhaar/verifyOTP',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "restrictions": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/verifyOTP',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', restrictions: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', restrictions: '', txnId: ''},
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}}/v1/registration/aadhaar/verifyOTP');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
restrictions: '',
txnId: ''
});
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}}/v1/registration/aadhaar/verifyOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', restrictions: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","restrictions":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"restrictions": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/verifyOTP"]
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}}/v1/registration/aadhaar/verifyOTP" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/verifyOTP",
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([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/verifyOTP', [
'body' => '{
"otp": "",
"restrictions": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/verifyOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'restrictions' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/verifyOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/verifyOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/verifyOTP"
payload = {
"otp": "",
"restrictions": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/verifyOTP"
payload <- "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/verifyOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\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/v1/registration/aadhaar/verifyOTP') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/verifyOTP";
let payload = json!({
"otp": "",
"restrictions": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/verifyOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"restrictions": "",
"txnId": ""
}'
echo '{
"otp": "",
"restrictions": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/verifyOTP \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "restrictions": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/verifyOTP
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"restrictions": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/verifyOTP")! 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
Verify Aadhaar OTP on registrered mobile number to create Health ID.
{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:email ""
:firstName ""
:lastName ""
:middleName ""
:mobile ""
:otp ""
:password ""
:profilePhoto ""
:restrictions ""
:txnId ""
:username ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"
payload := strings.NewReader("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/createHealthIdWithAadhaarOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 198
{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\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 \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","lastName":"","middleName":"","mobile":"","otp":"","password":"","profilePhoto":"","restrictions":"","txnId":"","username":""}'
};
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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "firstName": "",\n "lastName": "",\n "middleName": "",\n "mobile": "",\n "otp": "",\n "password": "",\n "profilePhoto": "",\n "restrictions": "",\n "txnId": "",\n "username": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/createHealthIdWithAadhaarOtp',
headers: {
authorization: '{{apiKey}}',
'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({
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
},
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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
});
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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
email: '',
firstName: '',
lastName: '',
middleName: '',
mobile: '',
otp: '',
password: '',
profilePhoto: '',
restrictions: '',
txnId: '',
username: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"email":"","firstName":"","lastName":"","middleName":"","mobile":"","otp":"","password":"","profilePhoto":"","restrictions":"","txnId":"","username":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"email": @"",
@"firstName": @"",
@"lastName": @"",
@"middleName": @"",
@"mobile": @"",
@"otp": @"",
@"password": @"",
@"profilePhoto": @"",
@"restrictions": @"",
@"txnId": @"",
@"username": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"]
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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp",
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([
'email' => '',
'firstName' => '',
'lastName' => '',
'middleName' => '',
'mobile' => '',
'otp' => '',
'password' => '',
'profilePhoto' => '',
'restrictions' => '',
'txnId' => '',
'username' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp', [
'body' => '{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'firstName' => '',
'lastName' => '',
'middleName' => '',
'mobile' => '',
'otp' => '',
'password' => '',
'profilePhoto' => '',
'restrictions' => '',
'txnId' => '',
'username' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'firstName' => '',
'lastName' => '',
'middleName' => '',
'mobile' => '',
'otp' => '',
'password' => '',
'profilePhoto' => '',
'restrictions' => '',
'txnId' => '',
'username' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/createHealthIdWithAadhaarOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"
payload = {
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp"
payload <- "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\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/v1/registration/aadhaar/createHealthIdWithAadhaarOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"email\": \"\",\n \"firstName\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"mobile\": \"\",\n \"otp\": \"\",\n \"password\": \"\",\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"txnId\": \"\",\n \"username\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp";
let payload = json!({
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}'
echo '{
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "firstName": "",\n "lastName": "",\n "middleName": "",\n "mobile": "",\n "otp": "",\n "password": "",\n "profilePhoto": "",\n "restrictions": "",\n "txnId": "",\n "username": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"email": "",
"firstName": "",
"lastName": "",
"middleName": "",
"mobile": "",
"otp": "",
"password": "",
"profilePhoto": "",
"restrictions": "",
"txnId": "",
"username": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/createHealthIdWithAadhaarOtp")! 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
Verify Aadhaar using biometrics.
{{baseUrl}}/v1/registration/aadhaar/verifyBio
HEADERS
Authorization
{{apiKey}}
BODY json
{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/verifyBio");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/verifyBio" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:aadhaar ""
:bioType ""
:pid ""
:restrictions ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/verifyBio"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\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}}/v1/registration/aadhaar/verifyBio"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\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}}/v1/registration/aadhaar/verifyBio");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/verifyBio"
payload := strings.NewReader("{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/verifyBio HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 71
{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/verifyBio")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/verifyBio"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\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 \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/verifyBio")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}")
.asString();
const data = JSON.stringify({
aadhaar: '',
bioType: '',
pid: '',
restrictions: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/verifyBio');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: '', bioType: '', pid: '', restrictions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":"","bioType":"","pid":"","restrictions":""}'
};
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}}/v1/registration/aadhaar/verifyBio',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "aadhaar": "",\n "bioType": "",\n "pid": "",\n "restrictions": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyBio")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/verifyBio',
headers: {
authorization: '{{apiKey}}',
'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({aadhaar: '', bioType: '', pid: '', restrictions: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {aadhaar: '', bioType: '', pid: '', restrictions: ''},
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}}/v1/registration/aadhaar/verifyBio');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
aadhaar: '',
bioType: '',
pid: '',
restrictions: ''
});
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}}/v1/registration/aadhaar/verifyBio',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {aadhaar: '', bioType: '', pid: '', restrictions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyBio';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"aadhaar":"","bioType":"","pid":"","restrictions":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"aadhaar": @"",
@"bioType": @"",
@"pid": @"",
@"restrictions": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/verifyBio"]
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}}/v1/registration/aadhaar/verifyBio" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/verifyBio",
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([
'aadhaar' => '',
'bioType' => '',
'pid' => '',
'restrictions' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/verifyBio', [
'body' => '{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/verifyBio');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aadhaar' => '',
'bioType' => '',
'pid' => '',
'restrictions' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aadhaar' => '',
'bioType' => '',
'pid' => '',
'restrictions' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/verifyBio');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyBio' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/verifyBio", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/verifyBio"
payload = {
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/verifyBio"
payload <- "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/verifyBio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\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/v1/registration/aadhaar/verifyBio') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"aadhaar\": \"\",\n \"bioType\": \"\",\n \"pid\": \"\",\n \"restrictions\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/verifyBio";
let payload = json!({
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/verifyBio \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}'
echo '{
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/verifyBio \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "aadhaar": "",\n "bioType": "",\n "pid": "",\n "restrictions": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/verifyBio
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"aadhaar": "",
"bioType": "",
"pid": "",
"restrictions": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/verifyBio")! 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
Verify Mobile OTP in an existing transaction.
{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/verifyMobileOTP"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/aadhaar/verifyMobileOTP");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/aadhaar/verifyMobileOTP HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
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}}/v1/registration/aadhaar/verifyMobileOTP',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/aadhaar/verifyMobileOTP',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', txnId: ''},
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}}/v1/registration/aadhaar/verifyMobileOTP');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
txnId: ''
});
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}}/v1/registration/aadhaar/verifyMobileOTP',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"]
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}}/v1/registration/aadhaar/verifyMobileOTP" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP",
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([
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/aadhaar/verifyMobileOTP', [
'body' => '{
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/aadhaar/verifyMobileOTP", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"
payload = {
"otp": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP"
payload <- "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/registration/aadhaar/verifyMobileOTP') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP";
let payload = json!({
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/aadhaar/verifyMobileOTP \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"txnId": ""
}'
echo '{
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/aadhaar/verifyMobileOTP")! 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 Health ID with verified mobile token
{{baseUrl}}/v1/registration/mobile/createHealthId
HEADERS
Authorization
{{apiKey}}
BODY json
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/mobile/createHealthId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/mobile/createHealthId" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:address ""
:dayOfBirth ""
:districtCode ""
:email ""
:firstName ""
:gender ""
:healthId ""
:lastName ""
:middleName ""
:monthOfBirth ""
:name ""
:password ""
:pincode 0
:profilePhoto ""
:restrictions ""
:stateCode ""
:subdistrictCode ""
:token ""
:townCode ""
:txnId ""
:villageCode ""
:wardCode ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/mobile/createHealthId"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/registration/mobile/createHealthId"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/registration/mobile/createHealthId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/mobile/createHealthId"
payload := strings.NewReader("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/mobile/createHealthId HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 433
{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/mobile/createHealthId")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/mobile/createHealthId"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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 \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/createHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/mobile/createHealthId")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/mobile/createHealthId');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/mobile/createHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","gender":"","healthId":"","lastName":"","middleName":"","monthOfBirth":"","name":"","password":"","pincode":0,"profilePhoto":"","restrictions":"","stateCode":"","subdistrictCode":"","token":"","townCode":"","txnId":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
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}}/v1/registration/mobile/createHealthId',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "gender": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "name": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "restrictions": "",\n "stateCode": "",\n "subdistrictCode": "",\n "token": "",\n "townCode": "",\n "txnId": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/createHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/mobile/createHealthId',
headers: {
authorization: '{{apiKey}}',
'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({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
},
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}}/v1/registration/mobile/createHealthId');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
});
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}}/v1/registration/mobile/createHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: '',
dayOfBirth: '',
districtCode: '',
email: '',
firstName: '',
gender: '',
healthId: '',
lastName: '',
middleName: '',
monthOfBirth: '',
name: '',
password: '',
pincode: 0,
profilePhoto: '',
restrictions: '',
stateCode: '',
subdistrictCode: '',
token: '',
townCode: '',
txnId: '',
villageCode: '',
wardCode: '',
yearOfBirth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/mobile/createHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":"","dayOfBirth":"","districtCode":"","email":"","firstName":"","gender":"","healthId":"","lastName":"","middleName":"","monthOfBirth":"","name":"","password":"","pincode":0,"profilePhoto":"","restrictions":"","stateCode":"","subdistrictCode":"","token":"","townCode":"","txnId":"","villageCode":"","wardCode":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @"",
@"dayOfBirth": @"",
@"districtCode": @"",
@"email": @"",
@"firstName": @"",
@"gender": @"",
@"healthId": @"",
@"lastName": @"",
@"middleName": @"",
@"monthOfBirth": @"",
@"name": @"",
@"password": @"",
@"pincode": @0,
@"profilePhoto": @"",
@"restrictions": @"",
@"stateCode": @"",
@"subdistrictCode": @"",
@"token": @"",
@"townCode": @"",
@"txnId": @"",
@"villageCode": @"",
@"wardCode": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/mobile/createHealthId"]
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}}/v1/registration/mobile/createHealthId" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/mobile/createHealthId",
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([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'gender' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'restrictions' => '',
'stateCode' => '',
'subdistrictCode' => '',
'token' => '',
'townCode' => '',
'txnId' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/mobile/createHealthId', [
'body' => '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/mobile/createHealthId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'gender' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'restrictions' => '',
'stateCode' => '',
'subdistrictCode' => '',
'token' => '',
'townCode' => '',
'txnId' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'dayOfBirth' => '',
'districtCode' => '',
'email' => '',
'firstName' => '',
'gender' => '',
'healthId' => '',
'lastName' => '',
'middleName' => '',
'monthOfBirth' => '',
'name' => '',
'password' => '',
'pincode' => 0,
'profilePhoto' => '',
'restrictions' => '',
'stateCode' => '',
'subdistrictCode' => '',
'token' => '',
'townCode' => '',
'txnId' => '',
'villageCode' => '',
'wardCode' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/mobile/createHealthId');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/mobile/createHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/mobile/createHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/mobile/createHealthId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/mobile/createHealthId"
payload = {
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/mobile/createHealthId"
payload <- "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/mobile/createHealthId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\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/v1/registration/mobile/createHealthId') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"address\": \"\",\n \"dayOfBirth\": \"\",\n \"districtCode\": \"\",\n \"email\": \"\",\n \"firstName\": \"\",\n \"gender\": \"\",\n \"healthId\": \"\",\n \"lastName\": \"\",\n \"middleName\": \"\",\n \"monthOfBirth\": \"\",\n \"name\": \"\",\n \"password\": \"\",\n \"pincode\": 0,\n \"profilePhoto\": \"\",\n \"restrictions\": \"\",\n \"stateCode\": \"\",\n \"subdistrictCode\": \"\",\n \"token\": \"\",\n \"townCode\": \"\",\n \"txnId\": \"\",\n \"villageCode\": \"\",\n \"wardCode\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/mobile/createHealthId";
let payload = json!({
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/mobile/createHealthId \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}'
echo '{
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/registration/mobile/createHealthId \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "dayOfBirth": "",\n "districtCode": "",\n "email": "",\n "firstName": "",\n "gender": "",\n "healthId": "",\n "lastName": "",\n "middleName": "",\n "monthOfBirth": "",\n "name": "",\n "password": "",\n "pincode": 0,\n "profilePhoto": "",\n "restrictions": "",\n "stateCode": "",\n "subdistrictCode": "",\n "token": "",\n "townCode": "",\n "txnId": "",\n "villageCode": "",\n "wardCode": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/mobile/createHealthId
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"address": "",
"dayOfBirth": "",
"districtCode": "",
"email": "",
"firstName": "",
"gender": "",
"healthId": "",
"lastName": "",
"middleName": "",
"monthOfBirth": "",
"name": "",
"password": "",
"pincode": 0,
"profilePhoto": "",
"restrictions": "",
"stateCode": "",
"subdistrictCode": "",
"token": "",
"townCode": "",
"txnId": "",
"villageCode": "",
"wardCode": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/mobile/createHealthId")! 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
Generate Mobile OTP to start registration (POST)
{{baseUrl}}/v1/registration/mobile/generateOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"mobile": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/mobile/generateOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"mobile\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/mobile/generateOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:mobile ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/mobile/generateOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"mobile\": \"\"\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}}/v1/registration/mobile/generateOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"mobile\": \"\"\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}}/v1/registration/mobile/generateOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"mobile\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/mobile/generateOtp"
payload := strings.NewReader("{\n \"mobile\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/mobile/generateOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"mobile": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/mobile/generateOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"mobile\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/mobile/generateOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"mobile\": \"\"\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 \"mobile\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/mobile/generateOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"mobile\": \"\"\n}")
.asString();
const data = JSON.stringify({
mobile: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/mobile/generateOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
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}}/v1/registration/mobile/generateOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "mobile": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"mobile\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/generateOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/mobile/generateOtp',
headers: {
authorization: '{{apiKey}}',
'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({mobile: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {mobile: ''},
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}}/v1/registration/mobile/generateOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
mobile: ''
});
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}}/v1/registration/mobile/generateOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {mobile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/mobile/generateOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"mobile":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"mobile": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/mobile/generateOtp"]
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}}/v1/registration/mobile/generateOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"mobile\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/mobile/generateOtp",
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([
'mobile' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/mobile/generateOtp', [
'body' => '{
"mobile": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/mobile/generateOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'mobile' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'mobile' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/mobile/generateOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/mobile/generateOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"mobile": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"mobile\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/mobile/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/mobile/generateOtp"
payload = { "mobile": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/mobile/generateOtp"
payload <- "{\n \"mobile\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/mobile/generateOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"mobile\": \"\"\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/v1/registration/mobile/generateOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"mobile\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/mobile/generateOtp";
let payload = json!({"mobile": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/mobile/generateOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"mobile": ""
}'
echo '{
"mobile": ""
}' | \
http POST {{baseUrl}}/v1/registration/mobile/generateOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "mobile": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/mobile/generateOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["mobile": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/mobile/generateOtp")! 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
Resend Mobile OTP for Health ID registration
{{baseUrl}}/v1/registration/mobile/resendOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/mobile/resendOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/mobile/resendOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/mobile/resendOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"txnId\": \"\"\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}}/v1/registration/mobile/resendOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"txnId\": \"\"\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}}/v1/registration/mobile/resendOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/mobile/resendOtp"
payload := strings.NewReader("{\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/mobile/resendOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/mobile/resendOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/mobile/resendOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"txnId\": \"\"\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 \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/resendOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/mobile/resendOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/mobile/resendOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/resendOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/mobile/resendOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
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}}/v1/registration/mobile/resendOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/resendOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/mobile/resendOtp',
headers: {
authorization: '{{apiKey}}',
'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({txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/resendOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {txnId: ''},
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}}/v1/registration/mobile/resendOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
txnId: ''
});
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}}/v1/registration/mobile/resendOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/mobile/resendOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/mobile/resendOtp"]
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}}/v1/registration/mobile/resendOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/mobile/resendOtp",
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([
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/mobile/resendOtp', [
'body' => '{
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/mobile/resendOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/mobile/resendOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/mobile/resendOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/mobile/resendOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/mobile/resendOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/mobile/resendOtp"
payload = { "txnId": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/mobile/resendOtp"
payload <- "{\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/mobile/resendOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"txnId\": \"\"\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/v1/registration/mobile/resendOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/mobile/resendOtp";
let payload = json!({"txnId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/mobile/resendOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"txnId": ""
}'
echo '{
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/mobile/resendOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/mobile/resendOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["txnId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/mobile/resendOtp")! 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
Verify Mobile OTP sent as part of registration transaction.
{{baseUrl}}/v1/registration/mobile/verifyOtp
HEADERS
Authorization
{{apiKey}}
BODY json
{
"otp": "",
"txnId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/registration/mobile/verifyOtp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/registration/mobile/verifyOtp" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:otp ""
:txnId ""}})
require "http/client"
url = "{{baseUrl}}/v1/registration/mobile/verifyOtp"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/mobile/verifyOtp"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"otp\": \"\",\n \"txnId\": \"\"\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}}/v1/registration/mobile/verifyOtp");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/registration/mobile/verifyOtp"
payload := strings.NewReader("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/registration/mobile/verifyOtp HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"otp": "",
"txnId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/registration/mobile/verifyOtp")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/registration/mobile/verifyOtp"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"otp\": \"\",\n \"txnId\": \"\"\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 \"otp\": \"\",\n \"txnId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/verifyOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/registration/mobile/verifyOtp")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
.asString();
const data = JSON.stringify({
otp: '',
txnId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/registration/mobile/verifyOtp');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/verifyOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/registration/mobile/verifyOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
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}}/v1/registration/mobile/verifyOtp',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "otp": "",\n "txnId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/registration/mobile/verifyOtp")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/registration/mobile/verifyOtp',
headers: {
authorization: '{{apiKey}}',
'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({otp: '', txnId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/registration/mobile/verifyOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {otp: '', txnId: ''},
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}}/v1/registration/mobile/verifyOtp');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
otp: '',
txnId: ''
});
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}}/v1/registration/mobile/verifyOtp',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {otp: '', txnId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/registration/mobile/verifyOtp';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"otp":"","txnId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"otp": @"",
@"txnId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/registration/mobile/verifyOtp"]
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}}/v1/registration/mobile/verifyOtp" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/registration/mobile/verifyOtp",
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([
'otp' => '',
'txnId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/registration/mobile/verifyOtp', [
'body' => '{
"otp": "",
"txnId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/registration/mobile/verifyOtp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'otp' => '',
'txnId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'otp' => '',
'txnId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/registration/mobile/verifyOtp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/registration/mobile/verifyOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/registration/mobile/verifyOtp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"otp": "",
"txnId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/registration/mobile/verifyOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/registration/mobile/verifyOtp"
payload = {
"otp": "",
"txnId": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/registration/mobile/verifyOtp"
payload <- "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/registration/mobile/verifyOtp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\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/v1/registration/mobile/verifyOtp') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"otp\": \"\",\n \"txnId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/registration/mobile/verifyOtp";
let payload = json!({
"otp": "",
"txnId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/registration/mobile/verifyOtp \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"otp": "",
"txnId": ""
}'
echo '{
"otp": "",
"txnId": ""
}' | \
http POST {{baseUrl}}/v1/registration/mobile/verifyOtp \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "otp": "",\n "txnId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/registration/mobile/verifyOtp
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"otp": "",
"txnId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/registration/mobile/verifyOtp")! 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
Search a user by Health ID Number.
{{baseUrl}}/v1/search/searchByHealthId
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/search/searchByHealthId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/search/searchByHealthId" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthId ""}})
require "http/client"
url = "{{baseUrl}}/v1/search/searchByHealthId"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthId\": \"\"\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}}/v1/search/searchByHealthId"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthId\": \"\"\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}}/v1/search/searchByHealthId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/search/searchByHealthId"
payload := strings.NewReader("{\n \"healthId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/search/searchByHealthId HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"healthId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/search/searchByHealthId")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/search/searchByHealthId"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthId\": \"\"\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 \"healthId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/search/searchByHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/search/searchByHealthId")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthId\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/search/searchByHealthId');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/searchByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/search/searchByHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":""}'
};
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}}/v1/search/searchByHealthId',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/search/searchByHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/search/searchByHealthId',
headers: {
authorization: '{{apiKey}}',
'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({healthId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/searchByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthId: ''},
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}}/v1/search/searchByHealthId');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthId: ''
});
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}}/v1/search/searchByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/search/searchByHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/search/searchByHealthId"]
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}}/v1/search/searchByHealthId" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/search/searchByHealthId",
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([
'healthId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/search/searchByHealthId', [
'body' => '{
"healthId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/search/searchByHealthId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/search/searchByHealthId');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/search/searchByHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/search/searchByHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/search/searchByHealthId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/search/searchByHealthId"
payload = { "healthId": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/search/searchByHealthId"
payload <- "{\n \"healthId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/search/searchByHealthId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthId\": \"\"\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/v1/search/searchByHealthId') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/search/searchByHealthId";
let payload = json!({"healthId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/search/searchByHealthId \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthId": ""
}'
echo '{
"healthId": ""
}' | \
http POST {{baseUrl}}/v1/search/searchByHealthId \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/search/searchByHealthId
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["healthId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/search/searchByHealthId")! 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
Search a user by Health IDs.
{{baseUrl}}/v1/search/existsByHealthId
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/search/existsByHealthId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/search/existsByHealthId" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthId ""}})
require "http/client"
url = "{{baseUrl}}/v1/search/existsByHealthId"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthId\": \"\"\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}}/v1/search/existsByHealthId"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthId\": \"\"\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}}/v1/search/existsByHealthId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/search/existsByHealthId"
payload := strings.NewReader("{\n \"healthId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/search/existsByHealthId HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"healthId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/search/existsByHealthId")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/search/existsByHealthId"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthId\": \"\"\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 \"healthId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/search/existsByHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/search/existsByHealthId")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthId\": \"\"\n}")
.asString();
const data = JSON.stringify({
healthId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/search/existsByHealthId');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/existsByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/search/existsByHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":""}'
};
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}}/v1/search/existsByHealthId',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/search/existsByHealthId")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/search/existsByHealthId',
headers: {
authorization: '{{apiKey}}',
'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({healthId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/existsByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthId: ''},
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}}/v1/search/existsByHealthId');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthId: ''
});
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}}/v1/search/existsByHealthId',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/search/existsByHealthId';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/search/existsByHealthId"]
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}}/v1/search/existsByHealthId" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/search/existsByHealthId",
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([
'healthId' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/search/existsByHealthId', [
'body' => '{
"healthId": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/search/existsByHealthId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/search/existsByHealthId');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/search/existsByHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/search/existsByHealthId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthId\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/search/existsByHealthId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/search/existsByHealthId"
payload = { "healthId": "" }
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/search/existsByHealthId"
payload <- "{\n \"healthId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/search/existsByHealthId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthId\": \"\"\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/v1/search/existsByHealthId') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/search/existsByHealthId";
let payload = json!({"healthId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/search/existsByHealthId \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthId": ""
}'
echo '{
"healthId": ""
}' | \
http POST {{baseUrl}}/v1/search/existsByHealthId \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthId": ""\n}' \
--output-document \
- {{baseUrl}}/v1/search/existsByHealthId
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["healthId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/search/existsByHealthId")! 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
Search users with a mobile number.
{{baseUrl}}/v1/search/searchByMobile
HEADERS
Authorization
{{apiKey}}
BODY json
{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/search/searchByMobile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/search/searchByMobile" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:gender ""
:mobile ""
:name ""
:yearOfBirth ""}})
require "http/client"
url = "{{baseUrl}}/v1/search/searchByMobile"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/search/searchByMobile"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\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}}/v1/search/searchByMobile");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/search/searchByMobile"
payload := strings.NewReader("{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/search/searchByMobile HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/search/searchByMobile")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/search/searchByMobile"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\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 \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/search/searchByMobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/search/searchByMobile")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}")
.asString();
const data = JSON.stringify({
gender: '',
mobile: '',
name: '',
yearOfBirth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/search/searchByMobile');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/searchByMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', mobile: '', name: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/search/searchByMobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","mobile":"","name":"","yearOfBirth":""}'
};
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}}/v1/search/searchByMobile',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "gender": "",\n "mobile": "",\n "name": "",\n "yearOfBirth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/search/searchByMobile")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/search/searchByMobile',
headers: {
authorization: '{{apiKey}}',
'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({gender: '', mobile: '', name: '', yearOfBirth: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/search/searchByMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {gender: '', mobile: '', name: '', yearOfBirth: ''},
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}}/v1/search/searchByMobile');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
gender: '',
mobile: '',
name: '',
yearOfBirth: ''
});
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}}/v1/search/searchByMobile',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {gender: '', mobile: '', name: '', yearOfBirth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/search/searchByMobile';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"gender":"","mobile":"","name":"","yearOfBirth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"gender": @"",
@"mobile": @"",
@"name": @"",
@"yearOfBirth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/search/searchByMobile"]
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}}/v1/search/searchByMobile" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/search/searchByMobile",
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([
'gender' => '',
'mobile' => '',
'name' => '',
'yearOfBirth' => ''
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/search/searchByMobile', [
'body' => '{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/search/searchByMobile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gender' => '',
'mobile' => '',
'name' => '',
'yearOfBirth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gender' => '',
'mobile' => '',
'name' => '',
'yearOfBirth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/search/searchByMobile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/search/searchByMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/search/searchByMobile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/search/searchByMobile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/search/searchByMobile"
payload = {
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/search/searchByMobile"
payload <- "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/search/searchByMobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\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/v1/search/searchByMobile') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"gender\": \"\",\n \"mobile\": \"\",\n \"name\": \"\",\n \"yearOfBirth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/search/searchByMobile";
let payload = json!({
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/search/searchByMobile \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}'
echo '{
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
}' | \
http POST {{baseUrl}}/v1/search/searchByMobile \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "gender": "",\n "mobile": "",\n "name": "",\n "yearOfBirth": ""\n}' \
--output-document \
- {{baseUrl}}/v1/search/searchByMobile
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"gender": "",
"mobile": "",
"name": "",
"yearOfBirth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/search/searchByMobile")! 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
Add tag against HealthId.
{{baseUrl}}/v1/ha/tags
HEADERS
Authorization
{{apiKey}}
BODY json
{
"healthId": "",
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/ha/tags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"healthId\": \"\",\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/ha/tags" {:headers {:authorization "{{apiKey}}"}
:content-type :json
:form-params {:healthId ""
:tags {}}})
require "http/client"
url = "{{baseUrl}}/v1/ha/tags"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"healthId\": \"\",\n \"tags\": {}\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}}/v1/ha/tags"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
Content = new StringContent("{\n \"healthId\": \"\",\n \"tags\": {}\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}}/v1/ha/tags");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"healthId\": \"\",\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/ha/tags"
payload := strings.NewReader("{\n \"healthId\": \"\",\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "{{apiKey}}")
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/v1/ha/tags HTTP/1.1
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"healthId": "",
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/ha/tags")
.setHeader("authorization", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"healthId\": \"\",\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/ha/tags"))
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"healthId\": \"\",\n \"tags\": {}\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 \"healthId\": \"\",\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/ha/tags")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/ha/tags")
.header("authorization", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"healthId\": \"\",\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
healthId: '',
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/ha/tags');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: '', tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/ha/tags';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":"","tags":{}}'
};
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}}/v1/ha/tags',
method: 'POST',
headers: {
authorization: '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "healthId": "",\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"healthId\": \"\",\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/ha/tags")
.post(body)
.addHeader("authorization", "{{apiKey}}")
.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/v1/ha/tags',
headers: {
authorization: '{{apiKey}}',
'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({healthId: '', tags: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: {healthId: '', tags: {}},
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}}/v1/ha/tags');
req.headers({
authorization: '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
healthId: '',
tags: {}
});
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}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
data: {healthId: '', tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/ha/tags';
const options = {
method: 'POST',
headers: {authorization: '{{apiKey}}', 'content-type': 'application/json'},
body: '{"healthId":"","tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"healthId": @"",
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/ha/tags"]
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}}/v1/ha/tags" in
let headers = Header.add_list (Header.init ()) [
("authorization", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"healthId\": \"\",\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/ha/tags",
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([
'healthId' => '',
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"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}}/v1/ha/tags', [
'body' => '{
"healthId": "",
"tags": {}
}',
'headers' => [
'authorization' => '{{apiKey}}',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/ha/tags');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'healthId' => '',
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'healthId' => '',
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/ha/tags');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'authorization' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/ha/tags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": "",
"tags": {}
}'
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/ha/tags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"healthId": "",
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"healthId\": \"\",\n \"tags\": {}\n}"
headers = {
'authorization': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/v1/ha/tags", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/ha/tags"
payload = {
"healthId": "",
"tags": {}
}
headers = {
"authorization": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/ha/tags"
payload <- "{\n \"healthId\": \"\",\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/ha/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"healthId\": \"\",\n \"tags\": {}\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/v1/ha/tags') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.body = "{\n \"healthId\": \"\",\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/ha/tags";
let payload = json!({
"healthId": "",
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".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}}/v1/ha/tags \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--data '{
"healthId": "",
"tags": {}
}'
echo '{
"healthId": "",
"tags": {}
}' | \
http POST {{baseUrl}}/v1/ha/tags \
authorization:'{{apiKey}}' \
content-type:application/json
wget --quiet \
--method POST \
--header 'authorization: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "healthId": "",\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/v1/ha/tags
import Foundation
let headers = [
"authorization": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"healthId": "",
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/ha/tags")! 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()
DELETE
Delete tag against HealthId.
{{baseUrl}}/v1/ha/tags
HEADERS
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/ha/tags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/ha/tags" {:headers {:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/ha/tags"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/v1/ha/tags"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/ha/tags");
var request = new RestRequest("", Method.Delete);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/ha/tags"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/v1/ha/tags HTTP/1.1
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/ha/tags")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/ha/tags"))
.header("authorization", "{{apiKey}}")
.method("DELETE", 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}}/v1/ha/tags")
.delete(null)
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/ha/tags")
.header("authorization", "{{apiKey}}")
.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('DELETE', '{{baseUrl}}/v1/ha/tags');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/ha/tags';
const options = {method: 'DELETE', headers: {authorization: '{{apiKey}}'}};
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}}/v1/ha/tags',
method: 'DELETE',
headers: {
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/ha/tags")
.delete(null)
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/ha/tags',
headers: {
authorization: '{{apiKey}}'
}
};
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: 'DELETE',
url: '{{baseUrl}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/ha/tags');
req.headers({
authorization: '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/v1/ha/tags',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/ha/tags';
const options = {method: 'DELETE', headers: {authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/ha/tags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/ha/tags" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/ha/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/v1/ha/tags', [
'headers' => [
'authorization' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/ha/tags');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/ha/tags');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/ha/tags' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/ha/tags' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'authorization': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/v1/ha/tags", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/ha/tags"
headers = {"authorization": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/ha/tags"
response <- VERB("DELETE", url, add_headers('authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/ha/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/v1/ha/tags') do |req|
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/ha/tags";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/v1/ha/tags \
--header 'authorization: {{apiKey}}'
http DELETE {{baseUrl}}/v1/ha/tags \
authorization:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/ha/tags
import Foundation
let headers = ["authorization": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/ha/tags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
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 list of Tags against HealthID.
{{baseUrl}}/v1/ha/tags
HEADERS
X-Token
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/ha/tags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-token: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/ha/tags" {:headers {:x-token ""
:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/ha/tags"
headers = HTTP::Headers{
"x-token" => ""
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/ha/tags"),
Headers =
{
{ "x-token", "" },
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/ha/tags");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-token", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/ha/tags"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "")
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/ha/tags HTTP/1.1
X-Token:
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/ha/tags")
.setHeader("x-token", "")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/ha/tags"))
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/tags")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/ha/tags")
.header("x-token", "")
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/tags');
xhr.setRequestHeader('x-token', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/ha/tags',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/ha/tags';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
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}}/v1/ha/tags',
method: 'GET',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/ha/tags")
.get()
.addHeader("x-token", "")
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/ha/tags',
headers: {
'x-token': '',
authorization: '{{apiKey}}'
}
};
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}}/v1/ha/tags',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/ha/tags');
req.headers({
'x-token': '',
authorization: '{{apiKey}}'
});
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}}/v1/ha/tags',
headers: {'x-token': '', authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/ha/tags';
const options = {method: 'GET', headers: {'x-token': '', authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-token": @"",
@"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/ha/tags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/ha/tags" in
let headers = Header.add_list (Header.init ()) [
("x-token", "");
("authorization", "{{apiKey}}");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/ha/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}",
"x-token: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/ha/tags', [
'headers' => [
'authorization' => '{{apiKey}}',
'x-token' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/ha/tags');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/ha/tags');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-token' => '',
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/ha/tags' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-token", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/ha/tags' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = {
'x-token': "",
'authorization': "{{apiKey}}"
}
conn.request("GET", "/baseUrl/v1/ha/tags", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/ha/tags"
headers = {
"x-token": "",
"authorization": "{{apiKey}}"
}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/ha/tags"
response <- VERB("GET", url, add_headers('x-token' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/ha/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = ''
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/ha/tags') do |req|
req.headers['x-token'] = ''
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/ha/tags";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-token", "".parse().unwrap());
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/ha/tags \
--header 'authorization: {{apiKey}}' \
--header 'x-token: '
http GET {{baseUrl}}/v1/ha/tags \
authorization:'{{apiKey}}' \
x-token:''
wget --quiet \
--method GET \
--header 'x-token: ' \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/ha/tags
import Foundation
let headers = [
"x-token": "",
"authorization": "{{apiKey}}"
]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/ha/tags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 a list of districts in a given State as per LGD.
{{baseUrl}}/v1/ha/lgd/districts
HEADERS
Authorization
{{apiKey}}
QUERY PARAMS
stateCode
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/ha/lgd/districts?stateCode=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/ha/lgd/districts" {:headers {:authorization "{{apiKey}}"}
:query-params {:stateCode ""}})
require "http/client"
url = "{{baseUrl}}/v1/ha/lgd/districts?stateCode="
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/ha/lgd/districts?stateCode="),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/ha/lgd/districts?stateCode=");
var request = new RestRequest("", Method.Get);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/ha/lgd/districts?stateCode="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/ha/lgd/districts?stateCode= HTTP/1.1
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/ha/lgd/districts?stateCode=")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/ha/lgd/districts?stateCode="))
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/lgd/districts?stateCode=")
.get()
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/ha/lgd/districts?stateCode=")
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/lgd/districts?stateCode=');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/ha/lgd/districts',
params: {stateCode: ''},
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/ha/lgd/districts?stateCode=';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
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}}/v1/ha/lgd/districts?stateCode=',
method: 'GET',
headers: {
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/ha/lgd/districts?stateCode=")
.get()
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/ha/lgd/districts?stateCode=',
headers: {
authorization: '{{apiKey}}'
}
};
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}}/v1/ha/lgd/districts',
qs: {stateCode: ''},
headers: {authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/ha/lgd/districts');
req.query({
stateCode: ''
});
req.headers({
authorization: '{{apiKey}}'
});
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}}/v1/ha/lgd/districts',
params: {stateCode: ''},
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/ha/lgd/districts?stateCode=';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/ha/lgd/districts?stateCode="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/ha/lgd/districts?stateCode=" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/ha/lgd/districts?stateCode=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/ha/lgd/districts?stateCode=', [
'headers' => [
'authorization' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/ha/lgd/districts');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'stateCode' => ''
]);
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/ha/lgd/districts');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'stateCode' => ''
]));
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/ha/lgd/districts?stateCode=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/ha/lgd/districts?stateCode=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'authorization': "{{apiKey}}" }
conn.request("GET", "/baseUrl/v1/ha/lgd/districts?stateCode=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/ha/lgd/districts"
querystring = {"stateCode":""}
headers = {"authorization": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/ha/lgd/districts"
queryString <- list(stateCode = "")
response <- VERB("GET", url, query = queryString, add_headers('authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/ha/lgd/districts?stateCode=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/ha/lgd/districts') do |req|
req.headers['authorization'] = '{{apiKey}}'
req.params['stateCode'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/ha/lgd/districts";
let querystring = [
("stateCode", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/v1/ha/lgd/districts?stateCode=' \
--header 'authorization: {{apiKey}}'
http GET '{{baseUrl}}/v1/ha/lgd/districts?stateCode=' \
authorization:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'authorization: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/v1/ha/lgd/districts?stateCode='
import Foundation
let headers = ["authorization": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/ha/lgd/districts?stateCode=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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 a list of states as per LGD.
{{baseUrl}}/v1/ha/lgd/states
HEADERS
Authorization
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/ha/lgd/states");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/ha/lgd/states" {:headers {:authorization "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/v1/ha/lgd/states"
headers = HTTP::Headers{
"authorization" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/ha/lgd/states"),
Headers =
{
{ "authorization", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/ha/lgd/states");
var request = new RestRequest("", Method.Get);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/ha/lgd/states"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/ha/lgd/states HTTP/1.1
Authorization: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/ha/lgd/states")
.setHeader("authorization", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/ha/lgd/states"))
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/lgd/states")
.get()
.addHeader("authorization", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/ha/lgd/states")
.header("authorization", "{{apiKey}}")
.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}}/v1/ha/lgd/states');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/ha/lgd/states',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/ha/lgd/states';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
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}}/v1/ha/lgd/states',
method: 'GET',
headers: {
authorization: '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/ha/lgd/states")
.get()
.addHeader("authorization", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/ha/lgd/states',
headers: {
authorization: '{{apiKey}}'
}
};
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}}/v1/ha/lgd/states',
headers: {authorization: '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/ha/lgd/states');
req.headers({
authorization: '{{apiKey}}'
});
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}}/v1/ha/lgd/states',
headers: {authorization: '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/ha/lgd/states';
const options = {method: 'GET', headers: {authorization: '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/ha/lgd/states"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
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}}/v1/ha/lgd/states" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/ha/lgd/states",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/ha/lgd/states', [
'headers' => [
'authorization' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/ha/lgd/states');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/ha/lgd/states');
$request->setRequestMethod('GET');
$request->setHeaders([
'authorization' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/ha/lgd/states' -Method GET -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/ha/lgd/states' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'authorization': "{{apiKey}}" }
conn.request("GET", "/baseUrl/v1/ha/lgd/states", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/ha/lgd/states"
headers = {"authorization": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/ha/lgd/states"
response <- VERB("GET", url, add_headers('authorization' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/ha/lgd/states")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/ha/lgd/states') do |req|
req.headers['authorization'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/ha/lgd/states";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("authorization", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/ha/lgd/states \
--header 'authorization: {{apiKey}}'
http GET {{baseUrl}}/v1/ha/lgd/states \
authorization:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'authorization: {{apiKey}}' \
--output-document \
- {{baseUrl}}/v1/ha/lgd/states
import Foundation
let headers = ["authorization": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/ha/lgd/states")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
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()