• 0
Milardov

Problem asking a question

Question

Hello,

 I'm trying to ask a question in a specific article using the PHP-SDK class. I'm already logged in ML and I have my access_token, but I get a 505 error. Here is the piece of code where I'm stucked at:

 

    $params = array(
      'text' => 'this is a test',
      'item_id' => 'MLAMYID'
    );
    $url = 'https://api.mercadolibre.com.ar/questions/?access_token='.$_SESSION['access_token'];
    echo var_dump($meli->post($url, null, $params));

 

 Any suggestions? is there something I'm doing wrong? maybe my curl configuration?

 Regards.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi, the curl for make a question should be:

curl -i -X POST -H "Content-Type: application/json" -d '{
"text":"Do you have these shoes in red?",
"item_id":"MLA123456"
}'
https://api.mercadolibre.com/questions/?access_token=$ACCESS_TOKEN

check the example of how make a post on the php-sdk: 

 

https://github.com/mercadolibre/php-sdk/blob/master/examples/example_list_item.php

 

something like this:

$questions = array( 
"text" => "Do you have these shoes in red?",
"item_id" => "MLA123456"
);

print_r($meli->post('/questions', $questions, array('access_token' => $token));

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