Manage questions & answers
Contents:
→Search questions ↳Questions received by a seller ↳Questions received on an item ↳Questions made by a user on an item ↳Questions by ID →Attributes description →Allowed methods →Ask questions →Answer questions →Response time →Parameters description →Get questions detail →Delete questions →Questions blacklist →Send users to questions blacklist →Get questions blacklist →Remove a user from blacklist →How to be aware of a question? →Receiving a notification →Error codes reference →Visits by announcement
Search questions
There are a few ways to search questions.
Questions received by a seller
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/search?seller_id=$SELLER_ID
Questions received on an item
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/search?item=$ITEM_ID
How to order?
To order the results you can add the following query params:
sort_fields: allows sorting the search results by one or more specific fields. Accepts the item_id, seller_id, from_id, and date_created fields separated by commas.
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/search?seller_id=$SELLER_ID&sort_fields=item_id,date_created
sort_types: permite establecer si el ordenamiento de los campos establecidos en sort_fields será de forma ASC o DESC.
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/search?seller_id=$SELLER_ID&sort_fields=item_id,date_created&sort_types=ASC,DESC
Questions made by a user on an item
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/search?item=$ITEM_ID&from=$CUST_ID
Questions by ID
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/$QUESTION_ID
Attributes description
seller_id: Product seller's ID id: Question ID
text: Question text
status: Question status
Possibles values:
- unanswered:The question has not been answered yet
- answered:The question was not answered
- closed_unanswered:The product is closed and the question has never been answered
- under_review:Both product and question are under review
item_id: ID of the question-related product
date_created: Question creation date
answer: Seller's answer
text: Answer text
status: Answer status
Possible values:
- active: The answer is available
- disabled: The answer was disabled.
- date_created: Answer creation date.
Great! Now you know the aspects to take into account in terms of questions. Have a look at the available actions based on question 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 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d '{
"text":"Test question.",
"item_id":"MLA608007087"
}' https://api.mercadolibre.com/questions
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 -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 'https://api.mercadolibre.com/questions/search?item_id=ITEM_ID'
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 'Authorization: Bearer $ACCESS_TOKEN' -H ""Content-Type: application/json"" -d '{
"question_id": 3957150025,
"text":"Test answer..."
}' https://api.mercadolibre.com/answers
Response time
The new “response time” resource calculates the time in minutes it takes a seller to answer a query. It can be in 3 periods:
- Monday to Friday from 9 am to 6 pm (weekdays_working_hours).
- Monday to Friday from 6 pm to 12 am (weekdays_extra_hours).
- Saturday and Sunday (weekend).
Moreover, it shows the forecasted sales percentage a seller can have if he/she answers in less than 1 hour, viewing the percentage in the “sales_percent_increase” field.
The average is considered for each of the above periods, considering the last 14 days of questions and using the first question a buyer asked about an item.
Unanswered questions will be considered responded when calculating the response time, 1 week maximum.
Example: If one question remains unanswered for 4 days, it will consider that it took 4 days and the following day, 5 days, to answer a question.
For the “total” data from the past 14 days without periods will be considered. This also includes questions from 12 am to 9 am that do not fall into any of the periods viewed by the cutoff.
Call:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/questions/response_time
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/1111111/questions/response_time
Response:
{
"user_id": 1111111,
"total": {
"response_time": 22
},
"weekend": {
"response_time": 8,
"sales_percent_increase": null
},
"weekdays_working_hours": {
"response_time": 8,
"sales_percent_increase": null
},
"weekdays_extra_hours": {
"response_time": 72,
"sales_percent_increase": 10
}
}
Parameters description
user_id: ID of queried seller.
total: The seller's average response time, without considering time bands.
weekend: The seller's average response time on weekends.
weekdays_working_hours: The seller's average response time at business hours on business days (Monday to Friday, from 9 am to 6 pm).
weekdays_extra_hours: The seller's average response time out of business hours on business days (Monday to Friday, from 6 pm to 12 am).
sales_percent_increase: the sales percentage that might be increased if response times improve; provided that, response_time is over 60 in any segment, except for Total that does not have this parameter.
{
"message": "Response time not found for user id: 276274936",
"error": "not_found",
"status": 404,
"cause": []
}
Get questions detail
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/questions/3957150025
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. Note: To answer or ask questions, the maximum number of characters is 2,000.
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 -H 'Authorization: Bearer $ACCESS_TOKEN' 'https://api.mercadolibre.com/questions/${question_id}'
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 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"user_id": blocked user id
}'
https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist
Get questions blacklist
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 'https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist'
Remove a user from blacklist
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' 'https://api.mercadolibre.com/users/$SELLER_ID/questions_blacklist/$USER_ID'
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
Mercado Libre 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. | Can not 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. |
Visits by announcement
To consult as visits by announcement, use or article about or Resource Visits.
Next topic: Manage sales.