Please help with the queries posted below:
We were able to call the API with $request.
As per our requirement, after calling 1st api with JSON request, we are supposed to do the following in the same serverless app (server.js file) only:
- Make a call to a 2nd API URL with GET request. (This we will be achieve with the documentation) .
- Now the 2nd API (mentioned in point 1), does not return JSON response. It does a URL redirection to our application(we can let them know to which URL to redirect) and appends a “AUTHORIZATION CODE”, in the url like this: ?code=&scope=
So our Main Requirement is to get the Authorize Code from the callback URL.This has to be done in server.js only which is invoked on TicketCreation.
Can you please suggest how we can achieve this? Would be really helpful if you could provide a sample like before.
In continuation of the above question, if we are to provide a redirection URL of our app to the API which we are calling, what would be the URL of our serverless app? It is understood that it is server.js is invoked during onTicketCreation, so does this type of app have any URL of its own, which we can use for this redirection purpose and read the TOKEN from text appended to the URL?