Ruby / APPIA API / FETCH ESCROWS
Back to Collection Items
require 'chilkat'
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
http = Chilkat::CkHttp.new()
# Use this online tool to generate code from sample JSON: Generate Code to Create JSON
# The following JSON is sent in the request body.
# {
# "trans_amount": 3000,
# "trans_name": "mobile phone",
# "details": "buying and selling"
# }
json = Chilkat::CkJsonObject.new()
json.UpdateInt("trans_amount",3000)
json.UpdateString("trans_name","mobile phone")
json.UpdateString("details","buying and selling")
# Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>")
sbRequestBody = Chilkat::CkStringBuilder.new()
json.EmitSb(sbRequestBody)
# resp is a CkHttpResponse
resp = http.PTextSb("GET","https://domain.com/escrow/",sbRequestBody,"utf-8","application/json",false,false)
if (http.get_LastMethodSuccess() == false)
print http.lastErrorText() + "\n";
exit
end
print resp.get_StatusCode().to_s() + "\n";
print resp.bodyStr() + "\n";
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
-d '{
"trans_amount": 3000,
"trans_name": "mobile phone",
"details": "buying and selling"
}'
https://domain.com/escrow/
Postman Collection Item JSON
{
"name": "FETCH ESCROWS",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{auth}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"trans_amount\": 3000,\n \"trans_name\": \"mobile phone\",\n \"details\": \"buying and selling\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}/escrow/",
"host": [
"{{url}}"
],
"path": [
"escrow",
""
]
}
},
"response": [
]
}