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;
var queryParams = new chilkat.JsonObject();
queryParams.UpdateString("FreeText","ut dolore");
queryParams.UpdateString("Direction","Submitted");
queryParams.UpdateString("DateTimeIssuedFrom","1997-06-27T10:04:59.938Z");
queryParams.UpdateString("DateTimeIssuedTo","1997-06-27T10:04:59.938Z");
queryParams.UpdateString("DateTimeReceivedFrom","1997-06-27T10:04:59.938Z");
queryParams.UpdateString("DateTimeReceivedTo","1997-06-27T10:04:59.938Z");
queryParams.UpdateString("DocumentTypeCode","ut dolore");
queryParams.UpdateString("DocumentTypeVersion","ut dolore");
queryParams.UpdateString("ReceiverName","ut dolore");
queryParams.UpdateString("ReceiverRegisterationNumber","ut dolore");
queryParams.UpdateString("PosSerialNumber","ut dolore");
queryParams.UpdateString("SubmissionChannel","POS");
queryParams.UpdateString("SortBy","None");
queryParams.UpdateString("SortDir","None");
queryParams.UpdateInt("PageNo",63021623);
queryParams.UpdateInt("PageSize",63021623);
// Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>";
// resp: HttpResponse
var resp = http.QuickRequestParams("GET","https://domain.com/api/v1/receipts/search",queryParams);
if (http.LastMethodSuccess == false) {
console.log(http.LastErrorText);
return;
}
console.log(resp.StatusCode);
console.log(resp.BodyStr);
}
chilkatExample();
Curl Command
curl -G -d "FreeText=ut%20dolore"
-d "Direction=Submitted"
-d "DateTimeIssuedFrom=1997-06-27T10%3A04%3A59.938Z"
-d "DateTimeIssuedTo=1997-06-27T10%3A04%3A59.938Z"
-d "DateTimeReceivedFrom=1997-06-27T10%3A04%3A59.938Z"
-d "DateTimeReceivedTo=1997-06-27T10%3A04%3A59.938Z"
-d "DocumentTypeCode=ut%20dolore"
-d "DocumentTypeVersion=ut%20dolore"
-d "ReceiverName=ut%20dolore"
-d "ReceiverRegisterationNumber=ut%20dolore"
-d "PosSerialNumber=ut%20dolore"
-d "SubmissionChannel=POS"
-d "SortBy=None"
-d "SortDir=None"
-d "PageNo=63021623"
-d "PageSize=63021623"
-H "Authorization: Bearer <access_token>"
https://domain.com/api/v1/receipts/search
Postman Collection Item JSON
{
"name": "7. Search Receipts",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{generatedAccessToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{apiBaseUrl}}/api/v1/receipts/search?FreeText=ut dolore&Direction=Submitted&DateTimeIssuedFrom=1997-06-27T10:04:59.938Z&DateTimeIssuedTo=1997-06-27T10:04:59.938Z&DateTimeReceivedFrom=1997-06-27T10:04:59.938Z&DateTimeReceivedTo=1997-06-27T10:04:59.938Z&DocumentTypeCode=ut dolore&DocumentTypeVersion=ut dolore&ReceiverName=ut dolore&ReceiverRegisterationNumber=ut dolore&PosSerialNumber=ut dolore&SubmissionChannel=POS&SortBy=None&SortDir=None&PageNo=63021623&PageSize=63021623",
"host": [
"{{apiBaseUrl}}"
],
"path": [
"api",
"v1",
"receipts",
"search"
],
"query": [
{
"key": "FreeText",
"value": "ut dolore"
},
{
"key": "Direction",
"value": "Submitted"
},
{
"key": "DateTimeIssuedFrom",
"value": "1997-06-27T10:04:59.938Z"
},
{
"key": "DateTimeIssuedTo",
"value": "1997-06-27T10:04:59.938Z"
},
{
"key": "DateTimeReceivedFrom",
"value": "1997-06-27T10:04:59.938Z"
},
{
"key": "DateTimeReceivedTo",
"value": "1997-06-27T10:04:59.938Z"
},
{
"key": "DocumentTypeCode",
"value": "ut dolore"
},
{
"key": "DocumentTypeVersion",
"value": "ut dolore"
},
{
"key": "ReceiverName",
"value": "ut dolore"
},
{
"key": "ReceiverRegisterationNumber",
"value": "ut dolore"
},
{
"key": "PosSerialNumber",
"value": "ut dolore"
},
{
"key": "SubmissionChannel",
"value": "POS"
},
{
"key": "SortBy",
"value": "None"
},
{
"key": "SortDir",
"value": "None"
},
{
"key": "PageNo",
"value": "63021623"
},
{
"key": "PageSize",
"value": "63021623"
}
]
}
},
"response": [
]
}