Node.js / Creatio API / $value parameter
Back to Collection Items
var os = require('os');
if (os.platform() == 'win32') {
if (os.arch() == 'ia32') {
var chilkat = require('@chilkat/ck-node21-win-ia32');
} else {
var chilkat = require('@chilkat/ck-node21-win64');
}
} else if (os.platform() == 'linux') {
if (os.arch() == 'arm') {
var chilkat = require('@chilkat/ck-node21-arm');
} else if (os.arch() == 'x86') {
var chilkat = require('@chilkat/ck-node21-linux32');
} else {
var chilkat = require('@chilkat/ck-node21-linux64');
}
} else if (os.platform() == 'darwin') {
if (os.arch() == 'arm64') {
var chilkat = require('@chilkat/ck-node21-mac-m1');
} else {
var chilkat = require('@chilkat/ck-node21-macosx');
}
}
function chilkatExample() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
var http = new chilkat.Http();
var success;
http.SetRequestHeader("ForceUseSession","true");
http.SetRequestHeader("BPMCSRF","{{BPMCSRF}}");
var sbResponseBody = new chilkat.StringBuilder();
success = http.QuickGetSb("https://myserver.com/0/ServiceModel/EntityDataService.svc/Collection1Collection(guid'Id')/Field1/$value",sbResponseBody);
if (success == false) {
console.log(http.LastErrorText);
return;
}
console.log("Response status code = " + http.LastStatus);
console.log(sbResponseBody.GetAsString());
}
chilkatExample();
Curl Command
curl -X GET
-H "ForceUseSession: true"
-H "BPMCSRF: {{BPMCSRF}}"
https://myserver.com/0/ServiceModel/EntityDataService.svc/Collection1Collection(guid'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/ServiceModel/EntityDataService.svc/{{CollectionName1}}Collection(guid'{{ObjectId1}}')/{{FieldName1}}/$value",
"host": [
"{{BaseURI}}"
],
"path": [
"0",
"ServiceModel",
"EntityDataService.svc",
"{{CollectionName1}}Collection(guid'{{ObjectId1}}')",
"{{FieldName1}}",
"$value"
]
},
"description": "Request for getting a field value of an object collection instance by Id via the [$value](https://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/#requestingapropertysrawvalueusingvalue) parameter."
},
"response": [
{
"name": "[200] Gets a field value",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "ForceUseSession",
"type": "text",
"value": "true"
},
{
"key": "BPMCSRF",
"type": "text",
"value": "{{BPMCSRF}}"
}
],
"url": {
"raw": "https://myserver.com/0/ServiceModel/EntityDataService.svc/EmployeeCollection(guid'c31c7862-fe33-4a13-9bbc-0943fa08fd02')/Name/$value",
"protocol": "https",
"host": [
"myserver",
"com"
],
"path": [
"0",
"ServiceModel",
"EntityDataService.svc",
"EmployeeCollection(guid'c31c7862-fe33-4a13-9bbc-0943fa08fd02')",
"Name",
"$value"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Content-Type",
"value": "text/plain;charset=utf-8"
},
{
"key": "Server",
"value": "Microsoft-IIS/10.0"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "DataServiceVersion",
"value": "1.0;"
},
{
"key": "X-AspNet-Version",
"value": "4.0.30319"
},
{
"key": "X-Powered-By",
"value": "ASP.NET"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "Date",
"value": "Thu, 09 Apr 2020 11:18:51 GMT"
},
{
"key": "Content-Length",
"value": "14"
}
],
"cookie": [
],
"body": "William Walker"
}
]
}