delphiAx / Creatio API / $value parameter
Back to Collection Items
var
http: TChilkatHttp;
success: Integer;
sbResponseBody: TChilkatStringBuilder;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := TChilkatHttp.Create(Self);
http.SetRequestHeader('ForceUseSession','true');
http.SetRequestHeader('BPMCSRF','{{BPMCSRF}}');
sbResponseBody := TChilkatStringBuilder.Create(Self);
success := http.QuickGetSb('https://myserver.com/0/odata/Collection1(Id)/Field1/$value',sbResponseBody.ControlInterface);
if (success = 0) then
begin
Memo1.Lines.Add(http.LastErrorText);
Exit;
end;
Memo1.Lines.Add('Response status code = ' + IntToStr(http.LastStatus));
Memo1.Lines.Add(sbResponseBody.GetAsString());
Curl Command
curl -X GET
-H "ForceUseSession: true"
-H "BPMCSRF: {{BPMCSRF}}"
https://myserver.com/0/odata/Collection1(Id)/Field1/$value
Postman Collection Item JSON
{
"name": "$value parameter",
"request": {
"method": "GET",
"header": [
{
"key": "ForceUseSession",
"type": "text",
"value": "true"
},
{
"key": "BPMCSRF",
"type": "text",
"value": "{{BPMCSRF}}"
}
],
"url": {
"raw": "{{BaseURI}}/0/odata/{{CollectionName1}}({{ObjectId1}})/{{FieldName1}}/$value",
"host": [
"{{BaseURI}}"
],
"path": [
"0",
"odata",
"{{CollectionName1}}({{ObjectId1}})",
"{{FieldName1}}",
"$value"
]
},
"description": "Request for getting a field value of an object collection instance by Id via the $value parameter."
},
"response": [
{
"name": "[200] Gets a field value",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"type": "text",
"value": "application/json"
},
{
"key": "Content-Type",
"type": "text",
"value": "application/json; charset=utf-8"
},
{
"key": "ForceUseSession",
"type": "text",
"value": "true"
},
{
"key": "BPMCSRF",
"type": "text",
"value": "{{BPMCSRF}}"
}
],
"url": {
"raw": "https://myserver.com/0/odata/Employee(c31c7862-fe33-4a13-9bbc-0943fa08fd02)/Name/$value",
"protocol": "https",
"host": [
"myserver",
"com"
],
"path": [
"0",
"odata",
"Employee(c31c7862-fe33-4a13-9bbc-0943fa08fd02)",
"Name",
"$value"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Content-Type",
"value": "text/plain"
},
{
"key": "Expires",
"value": "-1"
},
{
"key": "Server",
"value": "Microsoft-IIS/10.0"
},
{
"key": "OData-Version",
"value": "4.0"
},
{
"key": "X-AspNet-Version",
"value": "4.0.30319"
},
{
"key": "X-Powered-By",
"value": "ASP.NET"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Date",
"value": "Wed, 26 Feb 2020 14:50:53 GMT"
},
{
"key": "Content-Length",
"value": "17"
}
],
"cookie": [
],
"body": "William Walker"
}
]
}