Manage questions & answers

Questions are the way buyers can communicate to sellers on the Item details page before making a transaction, and therefore, the way you handle interaction at this stage will be decisive to make a successful sale.

Contents:

Search questions

There are a few ways to search questions.

Questions received by a seller

curl -X GET -H "Content-Type: application/json" 'https://api.mercadolibre.com/questions/search?seller_id={Seller_id}&access_token=$ACCESS_TOKEN'

Questions received on an item

curl -X GET -H "Content-Type: application/json" 'https://api.mercadolibre.com/questions/search?item={Item_id}&access_token=$ACCESS_TOKEN'

Questions made by a user on an item

curl -X GET -H "Content-Type: application/json" 'https://api.mercadolibre.com/questions/search?item={Item_id}&from={Cust_id}'&access_token=$ACCESS_TOKEN'

Questions by id

curl -X GET -H "Content-Type: application/json" 'https://api.mercadolibre.com/questions/{question_id}?access_token=$ACCESS_TOKEN'

Note: Bear in mind that if you query without an access token and the question status is DELETED or BANNED, you will get “question not found”



Let’s take a look at the attributes we’ll found on the Search Questions resource.

Attributes description

Attribute Description
id Question Id.
date_created Creation date.
item_id Item Id that the question belongs to.
seller_id Seller Id of the item.
status Question status. Possible values:
unanswered Question is not answered yet.
answered Question was answered.
closed_unanswered The item is closed and the question was never answered.
under_review The item is under review and the question too.
text Text of the question.
answer Answer from the seller to the question.
date_created Creation date.
status Status of the answer. Possible values: Active, Disabled
active Answer is active.
disabled The answer has been disabled.
text Text of the answer.

Great! now you know what aspects to have in mind about questions. Check what actions are available according to questions search.

Allowed methods

Method Description
GET /questions/:id Returns a question with that id.
POST /questions Creates a question on an item.
DELETE /questions/:id Deletes a question.
POST /answers/ POST an answer to a given question.
POST /my/questions/hidden Hide questions.

As you can see, you can search questions by item, by seller, by the user who made them and filter them by status or period. You can also search all your received questions and hide them if you want.

Ask questions

This is a very simple task. You only need to know the item_id and send it along with a text String on the Json body like in the following example:

curl -X POST -H "Content-Type: application/json" -d '{
   "text":"Test question.",
   "item_id":"MLA608007087"
}' https://api.mercadolibre.com/questions/MLA608007087?access_token=$ACCESS_TOKEN

Answer questions

When you have a large amount of items listed on MercadoLibre you’re probably gonna receive lots of questions so we recommend you develop a way to answer those questions in a semi-automatic way, where answers are suggested to operators basing on frequent keywords.
To do so, you need to know how to answer a question by API. This is gonna be easy.

First, let’s check all the questions you got on your item. Just make a question search by item like in the example:

curl 'https://api.mercadolibre.com/questions/search?item_id=ITEM_ID&access_token=XXXX'

You’ll see questions have a status, so you’ll probably gonna have to keep those under “unanswered” status.

Now let’s answer a single question:

curl -X POST -H ""Content-Type: application/json"" -d '{
	"question_id": 3957150025,
	"text":"Test answer..."
}' https://api.mercadolibre.com/answers?access_token=$ACCESS_TOKEN

Get questions detail

Example:

curl -X GET https://api.mercadolibre.com/questions/3957150025?access_token=$ACCESS_TOKEN

Response:

{
  "id": 3957150025,
  "answer": {
    "date_created": "2016-02-29T11:21:27.000-04:00",
    "status": "ACTIVE",
    "text": "Test answer..."
  },
  "date_created": "2016-02-29T11:19:42.000-04:00",
  "deleted_from_listing": false,
  "hold": false,
  "item_id": "MLA608007087",
  "seller_id": 202593498,
  "status": "ANSWERED",
  "text": "Test question.",
  "from": {
    "id": 207119838,
    "answered_questions": 1
  }
}

When working with questions is very useful to listen to Notifications since it enables you to have a real-time feed of events that occur regarding to them. Learn how to work with notifications.

Delete questions

If you have the need to delete a question an user made on your item just use the DELETE method with the question ID and the seller’s access token.
Example:

curl -X DELETE 'https://api.mercadolibre.com/questions/${question_id}?access_token=$ACCESS_TOKEN'

Response:

[
  "Question deleted."
]

Questions blacklist

Managing the question’s blacklist allows you to block users from asking questions on your items. Later on, you can remove them from the blacklist to allow questions.

This blacklist is user-based and the seller has full control over the list of users on it. Let’s see a few examples of thing you can do with it.

Send users to questions blacklist

curl -X POST -H "Content-Type: application/json" -d
'{
  "user_id": blocked user id
}'
https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist?access_token=$ACCESS_TOKEN

Get questions blacklist

curl -X GET 'https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist?access_token=$ACCESS_TOKEN '

Remove a user from blacklist

curl -X DELETE 'https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist/$USER_ID?access_token=$ACCESS_TOKEN'

Perfect, now you know everything there’s is to know about our question blacklist. We hope it comes handy if it’s needed.

How to be aware of a question?

A question on an item is an event that occurs on MercadoLibre’s side, so you’ll need to subscribe to our questions feed to be aware in real time when that event occurs.
First of all, we have to configure our application to be capable of getting notifications. This can be done by subscribing your application to questions notifications. Go to our Application Manager (http://applications.mercadolibre.com) and edit your application Notifications Settings. For more information about creating and configuring a new app, please check this guide.
You must choose a Callback URL: configure the public URL of your domain where you want to receive all the notifications from MercadoLibre. E.g.: “https://backend.soleorigami.com/notification”.

Also you need to specify which “topic” you will list, in this case you must select questions.
This configuration allows you to interact with MercadoLibre notifications. All the events regarding new questions will be notified to your callback URL.

Receiving a Notification

MercadoLibre will send you notifications through a POST message with information inside items body. The most important attribute in the message is the user_id which is related to the notification and second one is the resource. The resource is the element that has been updated or it has been created.

{
  "user_id": 1234,
  "resource": "/questions/139876",
  "topic": "questions",
  "received": "2011-10-19T16:38:34.425Z",
  "sent" : "2011-10-19T16:40:34.425Z",
}

After receiving the notification you must send an acknowledgment (ACK 200) to MercadoLibre in order to stop receiving the notification.
Check our Notifications tutorial to know further.

Error codes reference

Error Description Possible solution
invalid_questionThe question is invalid. Cannot answer question. The parameter question_id must be a integer number. (To search your question call the resource/questions/search).
invalid_post_bodyInvalid JSON. Valid attributes are: {0}. Invalid parameters. Expected parameters are question_id and text.



Next topic:
Manage sales.

Please rate this