08-07-2018 10:01 AM
Hello,
Thanks for providing these great APIs for developers and for building this developer community
I'm trying to consume the Product Taxonomy API and call for segments
Although I see it works without any problem in Try Out section, I could not make my web request work on my C# code
I'm using my email and password for Basic Authentication using ISO-8859-1 encoding as follows:
String uname = "myEmailAddress"; String pwd = "myPassword"; String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(uname + ":" + pwd)); objWebRequest.Headers.Add("Authorization: Basic " + encoded);
But I always get 401 response from the server
Could you please help me for authorization issues?
Solved! Go to Solution.
08-07-2018 12:08 PM
Hi kodyaz,
Thank you for the feedback and for your question.
Since we have just started with our community we will be continuously learning from each other and build up a network with all like-minded people. Therefore, great to see you here 🙂
I will work on your question and get back to you soon!
08-07-2018 02:09 PM
Thank you ErginK,
I'm waiting for your answer
Addition to the username and password, I also provide the API Key in the header data as follows:
objWebRequest.Headers.Add("APIKey: myAPIKeyHere");
08-08-2018 08:37 AM
Hi kodyaz, I am back 🙂
Did you see our Get Started page for this specific API?
https://developer.bosch.com/web/product-taxonomy/get-started
You will find information about authentication there.
Does this maybe help?
08-08-2018 02:27 PM
Thank you ErginK,
When I checked the page you have referred, though I have already read that page, I realized that I'm using wrong key name
Instead of using
objWebRequest.Headers.Add("KeyId: myKeyId");
I used below which caused the problem I experienced
objWebRequest.Headers.Add("APIKey: myKey");
Teşekkürler,
Eralper
08-09-2018 09:37 AM - edited 08-09-2018 09:38 AM
Hi Eralper,
Thank you for sharing your solution. I am sure others will benefit from that too.
I am happy that it works for you.
Tesekkürler 🙂