Forum Discussion
Ingest data form a rest API with Oauth2
Hello, sorry for the late answer...I still have trouble with ClientId and SecretId, I am not sure where and how to put them in the process.
Hi MylenePBI - Thanks for using Fabric Community,
Inorder to understand how to use client_id and client_secret in your case, please follow below screenshot -
1. Connection - Add your base URL here.
2. Relative URL - Add your relative URL here.
3. Body (Main point) - Can add your client_id and client_secret here in json format
{
"grant_type":"client_credentials",
"client_id":"abcdefg",
"client_secret":"123ghy456"
}
4. Header: Add Content-Type : application/json
Hope this is helpful. In case of any queries please feel free.
- Anonymous2 years agoNot applicable
Hello MylenePBI ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .- MylenePBI2 years agoHelper I
Hello, I've tried your solution, but I always have the same problem "unsupported media type".
I am not sure what I do is ok. I have several Url:
- 1 base Url
- 1 authorization URL (base+relative)
- 1 token URL (base+relative)
- 1 URL where I call the data.
Currently I succeed in getting the data when I pass directly the token (that I get from postman) to the call with the last URL.
I have tried to follow what you have said to get the token in fabric data factory: Connect to the base URL, add the token relative URL, add client id, client seret, username and password to the body, add Content-type Json-application in the header, use POST method, but I always have this answer.
Error code2108Failure typeUser configuration issueDetails{"ErrorMessage":"Unsupported Media Type"}My connexion to the base url is a web2 connexion with anonymous authentication. Could you please help?- Anonymous2 years agoNot applicable
Hi MylenePBI ,
The error code 2108 indicates an Unsupported Media Type error. This error occurs when the Content-Type header of the request does not match the media type of the content being sent.
For example, if you are sending JSON data in the body of the request, but the Content-Type header is set to application/x-www-form-urlencoded, the server will reject the request with an Unsupported Media Type error.
To fix this error, you need to make sure that the Content-Type header matches the media type of the content being sent. For example, if you are sending JSON data, the Content-Type header should be set to application/json.
Can you please share few screenshots and details of your implemenation so that I can guide you better?
Note: Try to hide sensitive information in case if any.
Further Queries:
Do you require authorization URL (base+relative) inorder to use token URL (base+relative) and get the token?
As I understand -
token URL (base+relative) --> token (passing) ---> URL (where I call the data) --> data as response