Version: 3.0 - runtime validation failed : must not contain protocol in settings page

  • 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 to client.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

Hi @Kiran,

Greetings!

Could you please check whether the URL passed as fdUrl in the context has protocols like HTTP or HTTPS?

I guess removing that would fix the issue.

Thank you.

Thanks Benny,
The issue was fixed after removing the protocol from the settings page. This app is an old app that we are upgrading to the latest version. Protocol was required in the old version and it was removed in the latest.

1 Like

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