/net-sdk

MercadoLibre's .NET SDK

Primary LanguageC#

Mercado Libre Developers
MercadoLibre's .Net SDK

This is the official .Net SDK for MercadoLibre's Platform.[Beta]

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using MeliLibTools.MeliLibApi;
using MeliLibTools.Client;
using MeliLibTools.Model;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using MeliLibTools.MeliLibApi;
using MeliLibTools.Client;
using MeliLibTools.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.mercadolibre.com";
            var apiInstance = new CategoriesApi(config);
            var categoryId = categoryId_example;  // string | 

            try
            {
                // Return by category.
                apiInstance.CategoriesCategoryIdGet(categoryId);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling CategoriesApi.CategoriesCategoryIdGet: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation & Important notes

The URIs are relative to https://api.mercadolibre.com
All docs for the library are located here
Check out our examples codes in the folder examples
Don’t forget to check out our developer site