PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 6/12/2017 11:56 AM by  Will Strohl
Using API
 1 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages









--
6/11/2017 10:23 AM
    Hi!

    I just learned about HCC yesterday. The extensive API connection makes the product very interesting, especially compared to NOP Commerce. Unfortunately, I still have [b]some problems with the API[/b].

    An example:
    When I try to update a product, I do not get back a ProductDTO object , but only the error message:
    "Error SendRequest: The remote server returned an error: (500) Internal server error. System | At Hotcakes.CommerceDTO.v1.Client.RestHelper.SendRequest (String serviceUrl, String method, String data, WebProxy proxy, Int32 timeout) \ r \ n at Hotcakes.CommerceDTO.v1.Client.RestHelper.SendWithData [T] (String uri , String method, String data)"

    [b]Nevertheless the product is updated on the server !!![/b]

    Here is the sample code:

    var apiResponse = proxy.ProductsFindBySku("5702015876889");
    if (apiResponse.Errors.Count == 0)
    {
    if (apiResponse.Content != null)
    {
    ProductDTO product = apiResponse.Content;
    product.LongDescription = "Dies ist ein Test 2";
    product.MetaKeywords = "LEGO, Spielzeug, Baustein";
    ApiResponse productUpdateResponse = proxy.ProductsUpdate(product);
    if (productUpdateResponse.Errors.Count == 0)
    {
    Console.WriteLine($"{product.Sku} - Update OK");
    }
    else
    {
    Console.WriteLine($"{product.Sku} - {productUpdateResponse.Errors[0].Description}");
    }
    }
    }

    Greetings from Germany
    Carsten





    Veteran Member






    --
    6/12/2017 11:56 AM
    Hello:

    Could you please confirm the version of Hotcakes API you're trying to use to get this result?
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes
    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: