Error : client.request.invokeTemplate is not a function

Hi team,

I have been trying to figure out what the problem here is but I am unable to. Would be great if someone can help here.

I am trying to make a request from the installation page but I get this error.
“Uncaught TypeError: client.request.invokeTemplate is not a function” (attached screenshot)

I am trying to invoke the request this way :

client.request.invokeTemplate("getContactFields", {})
                    .then(function(data) {
                        fields = JSON.parse(data.response).fields;
                    }, function(error) {
                        //do something

I have declared the function in requests.json in the config folder:

        "getContactFields" : {
        "schema": {
        "method": "GET",
        "host": "",
        "path": "/crm/sales/api/settings/contacts/fields",
        "headers": {
            "Authorization": "Token token=<%= iparam.api_key %>",
            "Content-Type": "application/json"

I have declared this request in the manifest.json file as well.

"requests": {
    "getContactFields": {}

1 Like

Hey @Krutish_Kumar ,

Welcome to the Freshworks Developer Community! :tada:

client.request.invokeTemplate() is part of the client JS which is imported in front-end HTML files. You would have to migrate from

<script src=""></script>


<script src="{{{appclient}}}"></script>

You can see the migration guide docs - App code changes section which talks about this in the third point.

This should address the error. Let us know if this helped!

1 Like

Not the OP but this solution worked for me – Thank you!


Hey @Luke_Padawer,

Did you as well have trouble with client.request.invokeTemplate()?

Yes, I was getting the same error as OP but your solution was the answer for me.