• 0
Sign in to follow this  
Mario

Problemas con autenticación usando JS SDK

Question

Hola estoy tratando autenticarme usando JS pero estoy obteniendo el siguiente error.

 

403

"The User ID must match the consultant's"

 

 

El codigo que tengo es 

 

    //Return user data
    function getUserData(){
      MELI.get("/users/me",{},function(data){
        if(data[0] == 200){
          alert("User Data: "+data);
        } else {
          alert("User doesn't exist");
        }
      });
    }
 
    //Init the example
    function doExample(){
      
      MELI.init({
        client_id: 7581727170778734
      });
 
      MELI.getLoginStatus(function(status) {
        if(!status || !(status.state == "AUTHORIZED" || status.state == "IDENTIFIED")){
          MELI.login(getUserData);
        } else {
          getUserData();
        }
      });
    }
    </script>
 
 
En la app de mercado tengo
 
 
Alguna idea?
 
M.
 

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

yo tenia el mismo problema, solo le agregue el site_id que correspondia a mi aplicacion 
Ejemplo:

   MELI.init({  client_id: 7581727170778734,  site_id:'SITE' });
 
Y ya con eso se arreglo el problema 
 

Share this post


Link to post
Share on other sites
  • 0

I have the same error! Adding the site_id also throw error 403.

My code:

MELI.init({
  client_id: APP_ID,
  site_id:'MLU',
  xauth_protocol: "https://",
  xauth_domain: "secure.mlstatic.com",
  xd_url: "/org-img/sdk/xd-1.0.4.html"
});
 
MELI.login(function() {
 
       MELI.get("/users/me", {}, function(data) {
             console.log("data " + data);
      });
   
});

 

Complete Error:

jsonp1([403,{"message":"The User ID must match the consultant's","error":"forbidden","status":403,"cause":[]}]);

 

REQUEST URL GENERATED by the sdk:

https://api.mercadolibre.com/users/me?callback=jsonp1&_MELI_SDK_RANDOM=0.27768030109563513

 

Someone could help me with that?

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this