Need help to make requests to Freshdesk Account

I have tried to make requests wether with axios or with the request method but I couldn’t make it work. I decided to create a new serverless app to start over.At first I made an axios request and tested it with the external event and it worked but when I installed in my Freshdesk account it didn’t work .
I would like you to suggest me what type of request is more efficient for me to use.
The request that i would like to create as a try would be a GET method.

manifest.json:


iparam.json :

server.js:

Thanks in advance.

Hey @Mariam_Akif,

The snippets shared with respect to the serverless app doesn’t show any API invocation either with axios or request method happening.

I would like you to suggest me what type of request is more efficient for me to use.

Can you please elaborate as to what you are trying to build and what’s not working as expected?

You can take a look at GitHub - freshworks-developers/request-method-samples: Sample codes to demonstrate making API calls using Request Method for samples on how to use Request method in the app.

Hi,
Thank you for answering. I published another post where I was trying to make an axios request but it didn’t work, so in this new app I just wanted to ask you which type of request os more efficient for my app. I am trying to create an app that will consist on storing tickets in another platform. Right now I am doing a simple GET request to see if it works.

manifest.json update:
image

Error:

Hi @Mariam_Akif ,

For request method usage, kindly refer to this example I hope you will find this helpful.

Furthermore, when it comes to passing Authorization with Basic, it should be used as follow

let apikey = `<%= encode(iparam.f_api_key) %>`
...
'Authorization': 'Basic ' + apikey,

which, based on the screenshot is currently being used as

let apikey = `<% encode(iparam.f_api_key) %>`
// missing "=" symbol

Optionally you can use it directly

Authorization: `Basic <%= encode(iparam.f_api_key) %>`

Regards,
Thakur

Hello @Thakur_Ganeshsingh ,

Thank you for your answer. I have added the = symbol and now I do receive a response. However, it asks me to log in first in order to receive the data that i wan’t. The same message appeared me when trying the request Postman and I resolved it by using the Basic authorization. How can I solve it in the code?

Kind Regards.

RESPONSE:

Code:

Solution in postman:


Apparently the problem comes from the apikey. If i write it manually, it works. But I want to receive the apikey from the iparm.json. I don’t see where is the error:


(already tried with <%= encode(iparms.f_apikey)%>)

image

Solution!!
I had to add the args.