• Rashmi

    how can i get all available merchant name through API and than product of that merchant

  • Lakku Venkateswarlu

    I’m trying to run getvouchercodes, and its successful and getting output in XML format.
    How to get response in JSON format?

    • Hi Lakku

      The API gives response in XML & JSON formats. You have to pass appropriate headers in your request for getting the response in that format.

      Request Headers :

      For XML => Content-Type: application/xml
      For JSON => Content-Type: application/json

      I hope that helps. Thanks

      • Lakku Venkateswarlu

        Thank You for the information provided.
        Now I tried to call the API both from Code and the sandbox, but I didn’t get any voucher codes in the response.

        below is the response I got,

        But when I search in the, https://admin.optimisemedia.com/v2/VoucherCodes/Affiliate/SearchVoucherCodes.aspx, I can see vouchers available with the same search criteria.

        The API call worked fine both from my Java code and from Sandbox yesterday. I’m facing this problem from evening only.

        Could you please let me know, why I’m getting the empty response.

        • Anoop Kumar

          Hi Lakku

          What you pass in the category name?

          I think you are passing some string in category name, which is not exists on our database. If you are passing any category name in request, and if the category name exists on our DB then you will receive the data for that category otherwise you will not get any data.
          If you are not passing any string in category name then you will get data for all categories.
          So, please pass the correct category name or pass nothing for all categories.

  • bbirajdar

    I used the above code to get product feeds , but I am getting a response “StatusCode: 200, ReasonPhrase: ‘OK’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Transfer-Encoding: chunked Cache-Control: private Date: Sun, 15 Jan 2017 07:31:17 GMT Server: Microsoft-IIS/8.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Type: application/json; charset=utf-8 }” and not the product list…Am I doing something wrong?

    • bbirajdar

      It works now. Thanks to the help from OMG team members – Vineet , Kush and Monika

  • bbirajdar

    This works for me. The extra code I have to write to get the response as a JSON string is as follows –

    HttpResponseMessage result = GetServiceResult(url);
    var responseString = await result.Content.ReadAsStringAsync();
    var productList = JsonConvert.DeserializeObject(responseString);

    The RootObject C# is generated from a JSON to C# object converter found online.

    The feed is live on my Price Comparison Website http://www.LowestPriceIndia.com

  • Tech NiKia

    Hey!!

    Could Any Body Help Me In Integration Of Optimise API?
    My Email Is :- surajrccare@gmail.com
    Website:- http://www.shoppingwale.blogspot.com

    I Am Unable To Understand This
    Please Help Me.

  • Socialaddworld

    I am getting this error when i assign this Asp.net-C# code to my page load :-

    StatusCode: 403, ReasonPhrase: ‘Forbidden’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Transfer-Encoding: chunked Cache-Control: private Date: Mon, 12 Feb 2018 11:29:56 GMT Server: Microsoft-IIS/8.5 Content-Type: application/json; charset=utf-8 }

    Please help.

  • Maram Kiran Kumar

    In ASP.Net C#, Am always getting “The resource you are looking for was not found.” when am accessing getVoucherCodes

    • Anoop Kumar

      Hi Maram Kiran Kumar,

      Are you using the same api endpoint: https://api.omgpm.com/network/OMGNetworkApi.svc/v1.2.1/Affiliate/GetVoucherCodes

      • Maram Kiran Kumar

        yes am using same endpoint but with normal http protocol.

        • Anoop Kumar

          OK, that’s the problem. Please use https, http is no more supported.

          • Maram Kiran Kumar

            Thanks Anoop, now its working

          • Anoop Kumar

            Great, happy to helping you.

Translate »