Error Source Platform:Cannot read properties of undefined (reading 'type')

Hi Team,

We are invoking get contact API in freshsales.
Its working fine in localhost.
But after publishing, we are getting the below error message:

errorSource:“PLATFORM”
response:“Cannot read properties of undefined (reading ‘type’)”
status:500

request method:
“getContact”: {
“schema”: {
“method”: “GET”,
“protocol”: “https”,
“host”: “<%= iparam.domain %>”,
“path”: “/crm/sales/api/contacts/<%= context.contactId %>?include=contact_status”,
“headers”: {
“Authorization”: “Token token=<%= iparam.apiKey %>”,
“Content-Type”: “application/json”
}
}
},

@Freddy, your thoughts on this?

@Bene_Immanuel, It seems PavithraSelvaraj is encountering an issue with the ‘getContact’ API for freshsales. The API works well in their local environment but throws an error after publishing.

Error:

errorSource: "PLATFORM"
response: "Cannot read properties of undefined (reading 'type')"
status: 500

The error suggests an issue with accessing a property of an undefined object. This might occur if there is a missing or improperly defined variable or parameter in the deployed environment compared to the local environment.

Possible solutions to explore:

  1. Double-check if all the required variables (iparams) such as domain and apiKey are provided and configured correctly in the deployed environment.
  2. Verify whether the context.contactId is properly passed and available in the deployed environment.
  3. Ensure that there are no discrepancies between the local and deployed codes. For example, ensure they are in sync and all changes are pushed to the deployed environment.

If the error still persists after trying these solutions, it might require further investigation regarding the specific code implementation and configuration.

1 Like

Hi @PavithraSelvaraj,

Were you able to fix the issue with the insights provided by Freddy?

Thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.