Developer Portal Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Product Taxonomy API WebRequest with 401


    Product Taxonomy API WebRequest with 401


    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?

    5 REPLIES 5
    Community Manager

    Re: Product Taxonomy API WebRequest with 401

    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 Smiley Happy

    I will work on your question and get back to you soon!


    Re: Product Taxonomy API WebRequest with 401

    Thank you ErginK, 

    I'm waiting for your answer Smiley Happy

    Addition to the username and password, I also provide the API Key in the header data as follows:

    objWebRequest.Headers.Add("APIKey: myAPIKeyHere");



    Community Manager

    Re: Product Taxonomy API WebRequest with 401

    Hi kodyaz, I am back Smiley Happy

    Did you see our Get Started page for this specific API?


    You will find information about authentication there.

    Does this maybe help?



    Re: Product Taxonomy API WebRequest with 401

    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");



    Community Manager

    Re: Product Taxonomy API WebRequest with 401

    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 Smiley Happy