Back to Collection Items
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
set http = CreateObject("Chilkat.Http")
' Use this online tool to generate code from sample JSON: Generate Code to Create JSON
' The following JSON is sent in the request body.
' {
' "companyName": "sample string 1",
' "companyPhone": "sample string 2",
' "withdrawEmail": "sample string 3",
' "withdrawByEmail": "sample string 4",
' "withdrawByPhone": "sample string 5",
' "withdrawByMail": "sample string 6",
' "withdrawAddressLine1": "sample string 7",
' "withdrawAddressLine2": "sample string 8",
' "withdrawCity": "sample string 9",
' "withdrawState": "sample string 10",
' "withdrawPostalCode": "sample string 11",
' "withdrawConsequences": "sample string 12",
' "withdrawOther": "sample string 13",
' "withdrawPhone": "sample string 14",
' "changeEmail": "sample string 15",
' "changeEmailOther": "sample string 16",
' "copyCostPerPage": "sample string 17",
' "copyRequestEmail": "sample string 18",
' "copyFeeCollectionMethod": "sample string 19",
' "custom": "sample string 20",
' "pdfId": "sample string 21",
' "enableEsign": "sample string 22",
' "useBrand": "sample string 23",
' "esignAgreement": "sample string 24",
' "esignText": "sample string 25",
' "allowCDWithdraw": "sample string 26",
' "mustAgreeToEsign": "sample string 27",
' "useConsumerDisclosureWithinAccount": "sample string 28"
' }
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.JsonObject")
set json = CreateObject("Chilkat.JsonObject")
success = json.UpdateString("companyName","sample string 1")
success = json.UpdateString("companyPhone","sample string 2")
success = json.UpdateString("withdrawEmail","sample string 3")
success = json.UpdateString("withdrawByEmail","sample string 4")
success = json.UpdateString("withdrawByPhone","sample string 5")
success = json.UpdateString("withdrawByMail","sample string 6")
success = json.UpdateString("withdrawAddressLine1","sample string 7")
success = json.UpdateString("withdrawAddressLine2","sample string 8")
success = json.UpdateString("withdrawCity","sample string 9")
success = json.UpdateString("withdrawState","sample string 10")
success = json.UpdateString("withdrawPostalCode","sample string 11")
success = json.UpdateString("withdrawConsequences","sample string 12")
success = json.UpdateString("withdrawOther","sample string 13")
success = json.UpdateString("withdrawPhone","sample string 14")
success = json.UpdateString("changeEmail","sample string 15")
success = json.UpdateString("changeEmailOther","sample string 16")
success = json.UpdateString("copyCostPerPage","sample string 17")
success = json.UpdateString("copyRequestEmail","sample string 18")
success = json.UpdateString("copyFeeCollectionMethod","sample string 19")
success = json.UpdateString("custom","sample string 20")
success = json.UpdateString("pdfId","sample string 21")
success = json.UpdateString("enableEsign","sample string 22")
success = json.UpdateString("useBrand","sample string 23")
success = json.UpdateString("esignAgreement","sample string 24")
success = json.UpdateString("esignText","sample string 25")
success = json.UpdateString("allowCDWithdraw","sample string 26")
success = json.UpdateString("mustAgreeToEsign","sample string 27")
success = json.UpdateString("useConsumerDisclosureWithinAccount","sample string 28")
' Adds the "Authorization: Bearer {{accessToken}}" header.
http.AuthToken = "{{accessToken}}"
http.SetRequestHeader "Accept","application/json"
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sbRequestBody = CreateObject("Chilkat.StringBuilder")
success = json.EmitSb(sbRequestBody)
' resp is a Chilkat.HttpResponse
Set resp = http.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/consumer_disclosure/{{langCode}}?include_metadata={{include_metadata}}",sbRequestBody,"utf-8","application/json",0,0)
If (http.LastMethodSuccess = 0) Then
outFile.WriteLine(http.LastErrorText)
WScript.Quit
End If
outFile.WriteLine(resp.StatusCode)
outFile.WriteLine(resp.BodyStr)
outFile.Close
Curl Command
curl -X PUT
-H "Accept: application/json"
-H "Authorization: Bearer {{accessToken}}"
-d '{
"companyName": "sample string 1",
"companyPhone": "sample string 2",
"withdrawEmail": "sample string 3",
"withdrawByEmail": "sample string 4",
"withdrawByPhone": "sample string 5",
"withdrawByMail": "sample string 6",
"withdrawAddressLine1": "sample string 7",
"withdrawAddressLine2": "sample string 8",
"withdrawCity": "sample string 9",
"withdrawState": "sample string 10",
"withdrawPostalCode": "sample string 11",
"withdrawConsequences": "sample string 12",
"withdrawOther": "sample string 13",
"withdrawPhone": "sample string 14",
"changeEmail": "sample string 15",
"changeEmailOther": "sample string 16",
"copyCostPerPage": "sample string 17",
"copyRequestEmail": "sample string 18",
"copyFeeCollectionMethod": "sample string 19",
"custom": "sample string 20",
"pdfId": "sample string 21",
"enableEsign": "sample string 22",
"useBrand": "sample string 23",
"esignAgreement": "sample string 24",
"esignText": "sample string 25",
"allowCDWithdraw": "sample string 26",
"mustAgreeToEsign": "sample string 27",
"useConsumerDisclosureWithinAccount": "sample string 28"
}'
https://domain.com/v2.1/accounts/{{accountId}}/consumer_disclosure/{{langCode}}?include_metadata={{include_metadata}}
Postman Collection Item JSON
{
"name": "Update Consumer Disclosure.",
"request": {
"method": "PUT",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"companyName\": \"sample string 1\",\n \"companyPhone\": \"sample string 2\",\n \"withdrawEmail\": \"sample string 3\",\n \"withdrawByEmail\": \"sample string 4\",\n \"withdrawByPhone\": \"sample string 5\",\n \"withdrawByMail\": \"sample string 6\",\n \"withdrawAddressLine1\": \"sample string 7\",\n \"withdrawAddressLine2\": \"sample string 8\",\n \"withdrawCity\": \"sample string 9\",\n \"withdrawState\": \"sample string 10\",\n \"withdrawPostalCode\": \"sample string 11\",\n \"withdrawConsequences\": \"sample string 12\",\n \"withdrawOther\": \"sample string 13\",\n \"withdrawPhone\": \"sample string 14\",\n \"changeEmail\": \"sample string 15\",\n \"changeEmailOther\": \"sample string 16\",\n \"copyCostPerPage\": \"sample string 17\",\n \"copyRequestEmail\": \"sample string 18\",\n \"copyFeeCollectionMethod\": \"sample string 19\",\n \"custom\": \"sample string 20\",\n \"pdfId\": \"sample string 21\",\n \"enableEsign\": \"sample string 22\",\n \"useBrand\": \"sample string 23\",\n \"esignAgreement\": \"sample string 24\",\n \"esignText\": \"sample string 25\",\n \"allowCDWithdraw\": \"sample string 26\",\n \"mustAgreeToEsign\": \"sample string 27\",\n \"useConsumerDisclosureWithinAccount\": \"sample string 28\"\n}"
},
"url": {
"raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/consumer_disclosure/{{langCode}}?include_metadata={{include_metadata}}",
"host": [
"{{baseUrl}}"
],
"path": [
"v2.1",
"accounts",
"{{accountId}}",
"consumer_disclosure",
"{{langCode}}"
],
"query": [
{
"key": "include_metadata",
"value": "{{include_metadata}}"
}
],
"variable": [
{
"key": "accountId",
"value": "{{accountId}}",
"type": "string"
},
{
"key": "langCode",
"value": "{{langCode}}",
"type": "string"
}
]
}
},
"response": [
]
}