-
Upgrading custom app from 2.2 to 3.0 where iparams.html file has API get call called before installing the app.
-
As
client.request.get
is deprecated. so updated toclient.request.invokeTemplate
In iparams.js
async function getTaskTypes() {
return await client.request.invokeTemplate('getTaskTypesAPI', {
context: { fdUrl: getBaseUrl(), apiKey: apiKey() },
});
}
In request.json:
"getTaskTypesAPI": {
"schema": {
"method": "GET",
"protocol": "https",
"host": "<%= context.fdUrl %>",
"path": "/crm/sales/api/selector/sales_activity_entity_types",
"headers": {
"Authorization": "Basic <%= context.apiKey %>",
"Content-Type": "application/json"
}
}
}
- The base URL and API key are updated by the user and we need to call API with these values and verify the account before installing
- After updating, getting below error
{
"status": 400,
"headers": {},
"response": "runtime validation failed.",
"errors": [
{
"message": "must not contain protocol: https://<client>-sanbox.myfreshworks.com",
"instancePath": "/schema/host"
}
],
"errorSource": "APP",
"attempts": 1
}
Are there any sample apps where this has been achieved in 3.0 or any solution for the above error would be very much appreciated