CRM Typescript SDK | keyValues and keyModified fields in response object are empty
Node 18
ZohoCRM Typescript SDK 7.0.0
Hi, we are trying to add the @zohocrm/typescript-sdk-2.0 to our custom application so we can retrieve Contact and Account data from our CRM instance.
I've been able to successfully generate and authenticate using OAuth tokens, however the data being returned from the API is empty.
This is the code being used to make the request to the Contacts endpoint:
await ZohoClient.initialize();
const recordOperations = new RecordOperations();
const paramInstance: ParameterMap = new ParameterMap();
const fieldNames = ['First_Name', 'Last_Name', 'Email'];
await paramInstance.add(GetRecordsParam.FIELDS, fieldNames.toString());
await paramInstance.add(GetRecordsParam.PAGE, 1);
await paramInstance.add(GetRecordsParam.PER_PAGE, 1);
const response = await recordOperations.getRecords('Contacts', paramInstance);
return response.getObject();
And here is the result:
{
"id": null,
"result": {
"type": "data",
"data": {
"json": {
"keyModified": {},
"data": [
{
"keyValues": {},
"keyModified": {}
}
],
"info": {
"keyModified": {},
"perPage": 1,
"moreRecords": true,
"count": 1,
"page": 1
}
}
}
}
}
I've attached the log file which shows that the request was successful. I've also attached the resources file which shows that it's successfully obtained the Contact module and it's associated field names.
Event if I remove the paramInstance from the request the response is still the same.
Hoping someone can point me in the right direction as to why the response is empty please.