For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

unsupported_grant_type

Hi

I am trying to test connectivity for my WebSocket API application (what I need https://github.com/Refinitiv-API-Samples/Example.WebSocketAPI.Python.TRNA/blob/master/notebook/mrn_realtime_news_notebook_app.ipynb).


The command I am trying:

curl --data-urlencode "grant_type=password&takeExclusiveSignOnControl=True&scope=trapi&username=GE-myusername&password=mypassword" -X POST -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -v https://api.refinitiv.com:443/auth/oauth2/v1/token


The response I have is {"error":"unsupported_grant_type" }.

I appreciate if you can help me to resolve this issue.


Thanks

Vera

treprdp-apiwebsocketsrrto
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @Vera Ekimenko

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Hello @Vera Ekimenko,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

Upvotes
Accepted
24.6k 54 17 14

Hello @Vera Ekimenko

Could you please try with the following curl command?

curl --location --request POST 'https://api.refinitiv.com/auth/oauth2/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer ' \
--data-urlencode 'username=<Username/Machine ID>' \
--data-urlencode 'password=<Password>' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'scope=trapi' \
--data-urlencode 'takeExclusiveSignOnControl=true' \
--data-urlencode 'client_id=<App Key>'

I noticed that your curl command does not contain the client_id parameter as well.

The Refinitiv Real-Time Optimized (formerly known as ERT in Cloud) uses RDP APIs authentication. I suggest you check the following resources about RDP authentications:

Alternatively, you may use the Postman collection to verify your RDP/Machine ID credentials.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 1

Hi Wasin


Thank you for a prompt response. I have generated client_id using this https://emea1.apps.cp.thomsonreuters.com/apps/AppkeyGenerator

The Product is 'DEVPORTALUNQUALIFIEDCONTACTS.VERAEKIMENKO' which is not what my organisation is using (TRNA).


When I am trying to post a request from your Postman collection 'Authentication/Get Access Token' with the values set in RDP Env Starter environment (usename, password, client_id generated above) I have an error:

{

"error": "access_denied",

"error_description": "Invalid username or password."

}


How to get the correct client_id?

Thank you

Vera


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 1

Hi Wasin


Update: I have tried your curl command and it works with my client_id :). I'll try it with my app and post if I have any issues. Thank you for your help.


Thank you

Vera Ekimenko

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.6k 54 17 14

Hello @Vera Ekimenko

The Curl and Postman results should be identical with the same credentials. I suggest you check the Postman setting guide in the RDP Postman tutorial.


variables.png (26.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.