Announcement

Collapse
No announcement yet.

Categories request returns Unauthorized

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Categories request returns Unauthorized

    I have been using the 3DCart .net API package to set up interactions with my 3dcart store. I am successfully pulling orders and products using this method. I am now trying to pull a list of product categories - the purpose is to use the information to load new products via the API.

    When I run this code, it returns "Response status code does not indicate success: 401 (Unauthorized)." I cannot determine why. I have tried several iterations - my expectation is the code below will pull all categories. Maybe someone can spot the issue.

    Thanks


    DCartRestAPIClient.RestAPIActions ACT = new DCartRestAPIClient.RestAPIActions();

    ACT.HttpHost = "http://apirest.3dcart.com/3dCartWebAPI/v";
    ACT.ServiceVersion = "1";
    ACT.PrivateKey = "xxxxx";
    ACT.Token = "xxxxx";
    ACT.SecureURL = "xxxxx-com.3dcartstores.com";
    ACT.ContentType = "application/json";
    ACT.ID = 0;
    ACT.Type = "Categories";
    ACT.RecordsGetLimit = 0;

    DCartRestAPIClient.RecordInfo RI = new DCartRestAPIClient.RecordInfo();

    try
    {
    RI = ACT.GetRecords();
    }
    catch (Exception ex)
    {

    }

  • #2
    Super simple solution...took a long time to come to me...

    Needed to enable access to the categories in the developer portal.

    Comment

    Working...
    X