I am currently working on developing an app using Freshdesk CLI, and I have encountered an issue regarding the usage of contextual data in third-party API calls. I hope someone here can provide some guidance or insights to help me resolve this problem.
According to the Freshdesk CLI documentation, I can declare template variables that are populated with contextual data passed through the runtime API when invoking the request template.
It is essential to ensure that the variableName used in the template matches the context variable name provided when invoking the request template through the runtime API. Unfortunately, I have found that only the variable named id seems to work successfully, while other variable names do not produce the desired results.
I have attempted to use different variable names to pass contextual data to my third-party API calls, but any name other than id causes the runtime API call to fail.
I would greatly appreciate any assistance or suggestions from the Freshdesk community regarding this issue. Has anyone else encountered a similar problem when using Freshdesk CLI? Are there any workarounds or alternative approaches that could help me incorporate contextual data correctly into my third-party API calls?
Here, I used orderId when making the request as well as in the requests json file and API is not working but if I use just id then it will work. I don’t know the reason.
Anyways, I have managed to create API snapshots with just using id.
That should not be the case. As long as variable name in requests.json matches with JSON key sent in context in request.invokeTemplate() it should get substituted.
What is the error you see when you change orderId to id?
Is it that only in this template id is not working as expected but the same app with a different template with id works (this should not be the case) or in different apps it works?