Giter VIP home page Giter VIP logo

net-sdk's Introduction

No longer maintained

[DEPRECATED] This repository is no longer maintained

From the first week of April 2021 we will stop maintaining our SDKs.

This project is not functional, the dependencies will not be updated to latest ones.

We recommend you read our documentation.

Mercado Libre Developers

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 for API Endpoints

All URIs are relative to https://api.mercadolibre.com

Class Method HTTP request Description
CategoriesApi CategoriesCategoryIdGet GET /categories/{category_id} Return by category.
CategoriesApi SitesSiteIdCategoriesGet GET /sites/{site_id}/categories Return a categories by site.
CategoriesApi SitesSiteIdDomainDiscoverySearchGet GET /sites/{site_id}/domain_discovery/search Predictor
ItemsApi ItemsIdGet GET /items/{id} Return a Item.
ItemsApi ItemsIdPut PUT /items/{id} Update a Item.
ItemsApi ItemsPost POST /items Create a Item.
ItemsHealthApi ItemsIdHealthActionsGet GET /items/{id}/health/actions Return item health actions by id.
ItemsHealthApi ItemsIdHealthGet GET /items/{id}/health Return health by id.
ItemsHealthApi SitesSiteIdHealthLevelsGet GET /sites/{site_id}/health_levels Return health levels.
OAuth20Api Auth GET /authorization Authentication Endpoint
OAuth20Api GetToken POST /oauth/token Request Access Token

Documentation for Models

Documentation for Authorization

oAuth2AuthCode

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://auth.mercadolibre.com.ar/authorization
  • Scopes:
    • read: Grants read access
    • write: Grants write access
    • offline_access: Grants read and write access, and adds the possibility to get a refresh token and stay authenticated as the user.

net-sdk's People

Contributors

aleml86 avatar diazmartin avatar phaael avatar tioborracho avatar xetorthio avatar zeusmode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

net-sdk's Issues

work with cbt?

i would like to know if this files works with cbt api mercadolibre?

Redirect to OAuth provider

Hi, i'm trying to make the authorization processes but when i call the method apiInstance.Auth(responseType, clientId, redirectUri); , passing all the parameters, like in the sample code, my application is not redirected to the ML authentication page.
If i a make a redirect with Response.Redirect(completed code below) all work fine.
Response.Redirect(string.Format("{0}response_type={1}&client_id={2}&redirect_uri={3}", baseUrl, response_type, client_id, redirect_uri));

I'm not logged in my ML account, and i have no user in the permission list of my app.

Thank for your support!

Logout

How can i clear ML cockies to the next time show me the ML login page?

Failure when generating DLL with C# VS2017

Hi friends.

When I try to compile the MeliLibTools DLL i've got 6 errors, in 'ApiClient.cs', lines 391, 395, 399, 462, 466 and 469.
Anyone can help me, please?
Thanks a lot.

App ID is long type not int

Hi im trying to use the SDK but this not works for me:
Meli m = new Meli(4940955135042863, "mysecretkey");
because i got an error cant convert from long to int

ItemsPost no esta funcionado

Hola,

Actualmente la documentación dentro de la plataforma de developers, comenta que para poder publicar un articulo, es necesario mandar "category_id" como tipo cadena, pero la librería solamente me permite mandarlo como tipo entero.

A su vez, el Titulo, solamente me permite mandar un dato del tipo entero, cuando es debería ser necesario mandarlo como tipo cadena.

Gracias por el soporte!

RestSharp Client Add Handler - Error

Every time I run the sample code I get a restsharp error

System.MethodAccessException: 'Error cuando el método 'MeliLibTools.Client.ApiClient.Exec(RestSharp.RestRequest, MeliLibTools.Client.IReadableConfiguration)' intentó obtener acceso al método 'RestSharp.RestClient.AddHandler(System.Func`1<RestSharp.Deserializers.IDeserializer>

URL de Allow a una APP hardcodeada a .com.ar

En la SDK de .NET, en el file Meli.cs hay un método que tiene hardcodeada la URL para direccionar a un usuario a dar el Allow a una APP, y está así:

public string GetAuthUrl (string redirectUri)
{

return "https://auth.mercadolibre.com.ar/authorization?response_type=code&client_id=" + ClientId + "&redirect_uri=" + HttpUtility.UrlEncode (redirectUri);

}

Si alguien de Brasil quiere usarla, la URL cambia a auth.mercadolivre.com.br para que la pantalla aprezca en portugués. Deberíamos proporcionar un parámetro adicional para el idioma y en base a eso retornar uno u otro idioma? O podríamos quizás ver el site en que la APP (ClientID) fue creada y si viene de MLB entonces cambiarle a la URL que corresponde?

Identify user

I have a system with access control where the User can log in mercadolibre, how do I connect this User to a token returned in the callback?

Naming conventions discussion

Hello,

Nice to see some activity in this project.

I'd be curious to see what the community thinks of the naming convention used to name methods the new version of the API.

IMHO it's not necessary to reflect in the method name the underlying HTTP verb and parameters.

For example:

  • The ItemsIdPut could be simply named UpdateItem(int id) reading the code it's obvious the method takes the ID, and the underlying PUT verb is an implementation detail as far consuming the API goes?
  • The same logic would apply to all the other methods:
    • CategoriesCategoryIdGet should be GetGategory(int id) (here Get would happen to match the HTTP verb but that would be a coincidence.
    • ItemsPost() would become CreateItem(Item item)
    • ...

Better yet, the API could be broken down into services per kind of entity retrieved. E.g. you'd have an you'd instanciate an ItemService, a CategoryService and each would have a set of Get, Update and Create methods...?

As an aside, if the current naming convention is deemed the better one, the GetToken method doesn't follow it.

Looking forward to read people's opinions.

about the Version

When will the official version be updated and will it continue to be maintained?

Desktop application support

We would like to use desktop application to list items on meradolibre, but with current authentication scheme I don't see how to implement it, because desktop application does not have well know endpoint, where api would redirect with authorization code, would it be possible to get example if this is possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.