curl -X PATCH "https://api.example.com/api/app/travel-services/bulk" \
-H "Content-Type: application/json" \
-H "X-Tenant: <X-Tenant>" \
-d '[
{
"id": 0,
"input": {
"notes": "string",
"state": "Draft",
"stateChangeReason": "string",
"items": {},
"forceStatusChange": true,
"exemptionIds": [
0
],
"exemptionDocumentExpiryDates": {}
}
}
]' const response = await fetch ( `https://api.example.com/api/app/travel-services/bulk` , {
method: 'PATCH' ,
headers: { 'Content-Type' : 'application/json' },
body: JSON . stringify ([
{
"id" : 0 ,
"input" : {
"notes" : "string" ,
"state" : "Draft" ,
"stateChangeReason" : "string" ,
"items" : {},
"forceStatusChange" : true ,
"exemptionIds" : [
0
],
"exemptionDocumentExpiryDates" : {}
}
}
])
});
const data = await response. json (); import requests
response = requests.request(
"PATCH" ,
"https://api.example.com/api/app/travel-services/bulk" ,
json = [
{
"id" : 0 ,
"input" : {
"notes" : "string" ,
"state" : "Draft" ,
"stateChangeReason" : "string" ,
"items" : {},
"forceStatusChange" : True ,
"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 , "PATCH" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '[
{
"id": 0,
"input": {
"notes": "string",
"state": "Draft",
"stateChangeReason": "string",
"items": {},
"forceStatusChange": true,
"exemptionIds": [
0
],
"exemptionDocumentExpiryDates": {}
}
}
]' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "PATCH" , "https://api.example.com/api/app/travel-services/bulk" , strings. NewReader ( `[
{
"id": 0,
"input": {
"notes": "string",
"state": "Draft",
"stateChangeReason": "string",
"items": {},
"forceStatusChange": true,
"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 ( "PATCH" , HttpRequest.BodyPublishers. ofString ( "[ \n { \n \" id \" : 0, \n \" input \" : { \n \" notes \" : \" string \" , \n \" state \" : \" Draft \" , \n \" stateChangeReason \" : \" string \" , \n \" items \" : {}, \n \" forceStatusChange \" : true, \n \" exemptionIds \" : [ \n 0 \n ], \n \" exemptionDocumentExpiryDates \" : {} \n } \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 :: Patch . new (uri)
request[ "Content-Type" ] = "application/json"
request. body = "[ \n { \n \" id \" : 0, \n \" input \" : { \n \" notes \" : \" string \" , \n \" state \" : \" Draft \" , \n \" stateChangeReason \" : \" string \" , \n \" items \" : {}, \n \" forceStatusChange \" : true, \n \" exemptionIds \" : [ \n 0 \n ], \n \" exemptionDocumentExpiryDates \" : {} \n } \n } \n ]"
response = http. request (request)
puts response. body ⧉