• 0
Sign in to follow this  
Milardov

Obtener preguntas / retrieve questions

Question

Hola,

 Estoy tratando de obtener las preguntas de un item, pero al querer ejecutar este código me sale el siguiente error:

 

Hi,

 I'm trying to get all the questions from an specific item, but when I try to execute this piece of code I get the following error message:

<?php
    $params = array('access_token' => $_SESSION['access_token']);
    $result = $meli->get('/questions/search?item=ITEMID', $params);
    echo '<pre>';
    print_r($result);
    echo '</pre>';
?>
Array
(
    [body] => stdClass Object
        (
            [message] => You can't access this resource without access token
            [error] => unauthorized
            [status] => 401
            [cause] => Array
                (
                )

        )

    [httpCode] => 401
)

Estoy logueado en la API (usando el método auth), ya que también puedo hacer preguntas sin problemas, asi que no creo que el problema sea el token. Qué estoy haciendo mal?. Gracias.

 

I'm already logged in (using the auth method), so I don't think that the token should be the problem. What am I doing wrong?. Thanks.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

hummm

 

I always input the 'seller' => $_SESSION['aegseytwetewte'] in params

 

But I think that you don't load the session

Put a line:

 
    echo '<pre>';
    print_r($params);
    echo '</pre>';

Share this post


Link to post
Share on other sites
  • 0

Hi Milardov, please check the documentation for the Questions Tutorial and if you still have specific doubts I'll try to clear it up for you. If you search questions by Item you don't need an access token because is public information, so there shouldn't be any trouble.

You can see some examples of how to get the questions in the last section of our API Directory.

Share this post


Link to post
Share on other sites
  • 0

Hi ! 

 

I have the same problem and I can't get the questions using the new methods...

In the example posted in the tutorial it says that to get the total, you should make a call like this:

 

https://api.mercadolibre.com/items/MLV421672596/contacts/questions?date_from=2014-08-01T00:00:00.000-03:00&date_to=2014-08-02T23:59:59.999

 

And for the details like this:

 

https://api.mercadolibre.com/items/MLV421672596/contacts/questions/search?date_from=2014-08-01T00:00:00.000-03:00&date_to=2014-08-02T23:59:59.999

 

(Just adding the /search)

 

But it does not work, it does always return total 0 when you make the call for the details..

 

Any suggestion?

 

Thanks !

Share this post


Link to post
Share on other sites
  • 0

Yes but for some items it is requesting the access token and even if I pass it, it does not work.

 

If I don't pass the token it says:

 

"You can't access this resource without access token"

 

If I pass a valid token it says:

 

"You can't access this resource without correct access token"

 

If i pass an invalid token it says:

 

"invalid_token"

 

 

For example, for this item:

 

https://api.mercadolibre.com/questions/search?item_id=MLV421672596&access_token=APP_USR-928604158353929-101713-680cdc8d1981453fd9cc61b527e65131__G_N__-161279935

 

 

 

Am I missing something?

 

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