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

Hi Team,
We have suddenly hit a roadblock due to the error mentioned in the subject line.
Please note this app is in production and we are getting this error suddenly today onwards.
“errorSource”:“PLATFORM”,“response”:“Cannot read properties of undefined (reading ‘type’)”,“status”:500

Requests.json:
“getChangeDetails”: {
“schema”: {
“method”: “GET”,
“protocol”: “https”,
“host”: “<%= iparam.FreshserviceDomain %>.freshservice.com”,
“path”: “/api/v2/changes/<%= context.id %>”,
“headers”: {
“Authorization”: “Basic <%= encode(iparam.apiKey) %>”,
“Content-Type”: “application/json”
}
},
“options”: {
“isOAuth”: true

  }
},

Code snippet:
var tkt_id = change_id.substring(change_id.indexOf(‘-’) + 1);
let changeDetails = await $request.invokeTemplate(‘getChangeDetails’, {
context: { “id”: tkt_id }
});
Kindly note this is a deployed and running code and suddenly stopped working with this error. This is one of the requests which has stopped working. Similarly all of them are not working.
Has there been any changes for the request method?

App ID: 84248

Hey @shrikini,

Welcome to the Freshworks Developer Community! :tada:

I see that the template is for Freshservice API and this is authenticated with API Key so you can remove the options or change isOAuth to false.

Hi @zach_jones_noel ,
Thank you for the response.
Can you please provide more details around it. This was a working production code till yesterday.
Also the error is :
“errorSource”:“PLATFORM”,“response”:“Cannot read properties of undefined (reading ‘type’)”,“status”:500

Is there any other property we need to add ?

Also we have third party APIs in the requests.json as follows:
“buildPostGCPMULTIAPI”: {
“schema”: {
“method”: “POST”,
“protocol”: “https”,
“host”: “<%= iparam.gcpBuildURL %>”,
“path”: “/<%= context.urlPath %>”,
“headers”: {
“X-API-Key”: “<%= iparam.GCPApiKey %>”,
“Content-Type”: “application/json”
}
},
“options”: {
“isOAuth”: true
}
},
“splunkLogPostAPI”: {
“schema”: {
“method”: “POST”,
“protocol”: “https”,
“host”: “<%= iparam.splunkLogURL %>.splunkcloud.com:443”,
“path”: “/services/collector/event”,
“headers”: {
“Authorization”: “Basic <%= encode(iparam.splunkUsername + ‘:’ + iparam.splunkPassword) %>”,
“Content-Type”: “application/json”
}
},
“options”: {
“isOAuth”: true

    }
  }

All these configs do we need to take off the isOAuth property ?

Hi @shrikini,

Yea I don’t see the templates using OAuth access_token so you can change option to -

“options”: {
    “isOAuth”: false
}

HI @zach_jones_noel ,
Thanks once again, but can you please provide more details around the error.
Especially since the requests.json hasnt been changed since being deployed to production.

Hey @shrikini,

Ideally, isOAuth: true on local or production should be used only when using OAuth for request templates.
https://freshworks.dev/docs/app-sdk/v2.3/freshdesk/advanced-interfaces/request-method/oauth/

Let me DM you for details of the app for further debugging with an engineer.