Validation Error 400 "while substituting the templates"

MY ISSUE:
1- I am facing the validation error 400 on HTTP get request , but if i update or Installing app first time it validate successful and then when i go back to settings to view my configuration and want to update it validates failed. This happening on internal API (e.g https://api.freshchat.com/v2/channels) & any 3rd party API.

2- It works on my local environment , In fact i hit multiple times my validation process after and before the installation it works perfectly.

1- Image Attached that shows console error.

MY TRIES:
1- I visit community for the solution i got multiple answers on same issue. I tried, but unfortunately didn’t get the positive response.

2- Also run in INCOGNITO to avoiding cache but issue still persists.

My CODE:
Same request method goes with 3rd party API & issue persists on both API’s.
var url = https://api.freshchat.com/v2/channels;
let options = {
headers: {
“Authorization”: Bearer ${fcToken},
“Content-Type”: “application/json”
}
};

1 Like

Hi @Furqan_Mehboob,
Good Day!
Have you whitelisted the domain? and due to security issue we blocked the template literal parsing in body, you are allowed to use only in header.

I hope it helps :slight_smile:
Thanks

2 Likes

Hi @Santhosh
Thanks for quick reply

I already have whitelisted domains as mentioned in the article here is my domains list
“whitelisted-domains”: [
https://api.messagemedia.com”,
“https://*.freshchat.com”,
https://staging-fcmessagemedia.codupcloud.com”,
https://fcmessagemedia.codupcloud.com”,
https://codupio1.freshchat.com
]

& i tried your mentioned solution of template literal parsing and fix it but unfortunately error 400 still persists,I am not having any post request to send body so here is my GET request code.

       var url = 'https://api.freshchat.com/v2/channels';
            let options = {
                headers: {
                    "Authorization": `Bearer ${fcToken}`,
                    "Content-Type": "application/json"
                }
            };
            client.request.get(url, options).then(*********

I would like to let you know this is my market place app so please try your best to help me out quickly that would be highly appreciated.

3 Likes

Hi @Furqan_Mehboob,
Possible can you please share me the app Zip, I will investigate what is wrong with that and get back to you at the earliest

Thanks
Santhosh

1 Like

@Furqan_Mehboob Could you please share your iparams file contents?

Here is the app zip.

1 Like

@Santhosh @arshath.h
Have you found my drive link?

1 Like

@Furqan_Mehboob,
I am investigating it, please allow some time and I will get back to you
Thanks

2 Likes

@Furqan_Mehboob,
I tried with your code and I am not able to reproduce this issue from our side,
I request you to book a call with us on Calendly - Freshworks Developer Relations to debug further.
CC: @Raviraj @Saif

Thanks,
Santhosh

2 Likes

Hi @Santhosh

Can you please reschedule the call or any other way for the solution because issue still persists.

Thanks.

@Furqan_Mehboob,
You can reschedule it via Calendly - Freshworks Developer Relations

Thanks