curl -X POST "https://api.example.com/api/app/travel-services/bulk" \
-H "Content-Type: application/json" \
-H "X-Tenant: <X-Tenant>" \
-d '[
{
"serviceType": "Visa",
"providerName": "string",
"tripDocumentTypeKey": "string",
"personId": 0,
"serviceIntentKey": "string",
"tripId": 0,
"documentVersionId": 0,
"serviceTypeId": 0,
"dueDate": "2024-01-01",
"exemptionIds": [
0
],
"exemptionDocumentExpiryDates": {}
}
]' const response = await fetch ( `https://api.example.com/api/app/travel-services/bulk` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' },
body: JSON . stringify ([
{
"serviceType" : "Visa" ,
"providerName" : "string" ,
"tripDocumentTypeKey" : "string" ,
"personId" : 0 ,
"serviceIntentKey" : "string" ,
"tripId" : 0 ,
"documentVersionId" : 0 ,
"serviceTypeId" : 0 ,
"dueDate" : "2024-01-01" ,
"exemptionIds" : [
0
],
"exemptionDocumentExpiryDates" : {}
}
])
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api.example.com/api/app/travel-services/bulk" ,
json = [
{
"serviceType" : "Visa" ,
"providerName" : "string" ,
"tripDocumentTypeKey" : "string" ,
"personId" : 0 ,
"serviceIntentKey" : "string" ,
"tripId" : 0 ,
"documentVersionId" : 0 ,
"serviceTypeId" : 0 ,
"dueDate" : "2024-01-01" ,
"exemptionIds" : [
0
],
"exemptionDocumentExpiryDates" : {}
}
],
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api.example.com/api/app/travel-services/bulk" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '[
{
"serviceType": "Visa",
"providerName": "string",
"tripDocumentTypeKey": "string",
"personId": 0,
"serviceIntentKey": "string",
"tripId": 0,
"documentVersionId": 0,
"serviceTypeId": 0,
"dueDate": "2024-01-01",
"exemptionIds": [
0
],
"exemptionDocumentExpiryDates": {}
}
]' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "POST" , "https://api.example.com/api/app/travel-services/bulk" , strings. NewReader ( `[
{
"serviceType": "Visa",
"providerName": "string",
"tripDocumentTypeKey": "string",
"personId": 0,
"serviceIntentKey": "string",
"tripId": 0,
"documentVersionId": 0,
"serviceTypeId": 0,
"dueDate": "2024-01-01",
"exemptionIds": [
0
],
"exemptionDocumentExpiryDates": {}
}
]` ))
req.Header. Set ( "Content-Type" , "application/json" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://api.example.com/api/app/travel-services/bulk" ))
. header ( "Content-Type" , "application/json" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "[ \n { \n \" serviceType \" : \" Visa \" , \n \" providerName \" : \" string \" , \n \" tripDocumentTypeKey \" : \" string \" , \n \" personId \" : 0, \n \" serviceIntentKey \" : \" string \" , \n \" tripId \" : 0, \n \" documentVersionId \" : 0, \n \" serviceTypeId \" : 0, \n \" dueDate \" : \" 2024-01-01 \" , \n \" exemptionIds \" : [ \n 0 \n ], \n \" exemptionDocumentExpiryDates \" : {} \n } \n ]" ))
. build ();
HttpResponse< String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://api.example.com/api/app/travel-services/bulk" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Post . new (uri)
request[ "Content-Type" ] = "application/json"
request. body = "[ \n { \n \" serviceType \" : \" Visa \" , \n \" providerName \" : \" string \" , \n \" tripDocumentTypeKey \" : \" string \" , \n \" personId \" : 0, \n \" serviceIntentKey \" : \" string \" , \n \" tripId \" : 0, \n \" documentVersionId \" : 0, \n \" serviceTypeId \" : 0, \n \" dueDate \" : \" 2024-01-01 \" , \n \" exemptionIds \" : [ \n 0 \n ], \n \" exemptionDocumentExpiryDates \" : {} \n } \n ]"
response = http. request (request)
puts response. body ⧉