Recent searches
No recent searches
OAuth, setting parameters to request data from external app.
Posted Apr 28, 2022
Hi,
I am trying to call an external app API.
I found on your documentation two types of setting on manifest.json.
"parameters": [
{
"name": "token",
"type": "oauth" or "text"
}
what is the deference between text and oauth, when you use text? oauth?
secondly, when I configure this parameters, is it necessary to input this token, which i may create it on Postman? If i didn't pas this parameter would the application create token by using my settings "Client_id, client_secret etc"?
Last question, according to what i read, I understood about OAuth flow that an Authorization request should be created with Post request and passing ClientID and Client secret... should be post to grant the token, I found on your documentation that you send the request of Get, you are not requesting the token before you get the data, What if that saved token which you pass it in header is expired. please clarify.
Last question, according to what i read, I understood about OAuth flow that an Authorization request should be created with Post request and passing ClientID and Client secret... should be post to grant the token, I found on your documentation that you send the request of Get, you are not requesting the token before you get the data, What if that saved token which you pass it in header is expired. please clarify.
Thank you,
Samer
Samer
0
8
8 comments
Eric Nelson
The oAuth parameter is a controlled type that you need to use if you want oauth to function correctly. We cover this in our documentation here. You shouldn't be inputting the token in advance, the application will create and store this.
Lastly our "get" example is just showing how to call an endpoint that uses oauth. The authorization flow uses a POST to handle the auth. You can read about that here.
Thanks!
0
Samer Kokeh
Thank you for your post, I hope you keep following my post.
However, When i read your document here I think there is some mistake in your code if you check it.
You can see headers parameters, it's not correct, I think Authorization it should be capital letter.
Can you tell me exactly please, what are the parameters i should use in my manifest?
and how to use my call in my main.js?
0
Samer Kokeh
FYI, i used in manifest.json
And in my main.js
0
Tipene Hughes
It appears that the code sample in the link you provided is slightly incorrect, unfortunately. As you mentioned, the parameter "authorization" should be capitalized as well as double quoted, but also you'll want to replace "Oauth" with "Bearer". Here's an example of how that should look:
I'll be sure to have our documentation team updated the provided sample. If you have any more issues, feel free to reach out!
Tipene
0
samer
Hi Tipene,
Thank you for information, but I still have a problem. Please if you want to open a ticket let it's ok.
FYI, I already request a ticket and still no body answer me.
However, I updated my Code as you mentioned it succeeded and keep working for 1hour or less and after 1 hour, when it's need to refresh the token, it's stop getting the data and an error raised as bellow:
0
samer
FYI, whenever I Open my App Settings. I can see that it's Authenticated
and when I click on Reauthorise with D365, i don't have any error and after i click Update, the application run again without any trouble for only 1 hour.
Please Advice or open a ticket for support.
Kind Regards,
Samer
0
Eric Nelson
I'll be assisting with you through the ticket that you opened up to help resolve this issue. Look forward to working with you via that!
Thanks,
0
Milos
Was this resolved and how, since I'm facing exact same issue after 1 hour...
0