Consult questions/answers¶
Retrieve question by ID¶
This endpoint allows the seller to retrieve a question/answer using the id
as a reference.
Required scope
Value | Description |
---|---|
services:questions-seller:read |
Allows the use of write/update APIs. |
Request parameters
Field | Type | Description | Required |
---|---|---|---|
id |
string | Key to identify the Question | Yes |
Request:
curl -X 'GET' \
'https://services.magalu.com/v0/questions/{id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
Response:
{
"id": "630e3bbc950b052e8724491a",
"status": "NEW",
"subject": {
"id": "id-001",
"type": "offer",
"extra": {
"name": "Camiseta",
"description": "Camiseta gola v na cor verde",
"url_img": "https://www.magazineluiza.com/camiseta-gola-v_imagem.jpg",
"url": "https://www.magazineluiza.com/camiseta-gola-v"
},
"custom_fields": [
{
"name": "Cor",
"value": "Verde"
}
],
"identifiers": [
{
"name": "openapi",
"value": "a11d50a5-31c1-4e9d-bbe3-27a59f944508",
"reference": " "
}
]
},
"question": {
"message": "Quais as outras cores?",
"when_at": "2023-06-27T18:56:28.445Z",
"owner": {
"name": "Fluano da Silva (cliente)",
"external_id": "cli-001"
},
"product": {
"sku": "sku-123",
"description": "description - 01"
}
},
"answer": {
"message": "Temos em três cores azul, amarelo e vermelho.",
"external_id": "resposta-01",
"owner": {
"name": "Joseph Climber",
"external_id": "j.climber"
},
"moderation": {
"status": "NOT_MODERATED",
"when_at": "2023-06-27T18:56:28.445Z",
"block_rules": []
}
}
}
Return code
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
Retrieve questions by filters¶
This endpoint allows the seller to retrieve a collection of questions/answers using filters as a reference.
Required scope
Value | Description |
---|---|
services:questions-seller:read |
Allows the use of write/update APIs. |
Query parameters
Field | Type | Description | Required |
---|---|---|---|
_limit |
number | Determines the number of records to be returned. Default value 10. | No |
_offset |
number | Reference record position, from there the next N records will be returned. Default value 0. | No |
status |
String | Message status, can be the following values: WAITING_RESPONSE, REJECTED_RESPONSE, APPROVED. | No |
answer.external_id |
String | External system identifier that correlates with the response | No |
answer.owner.external_id |
String | Response author's external system identifier | No |
Request:
curl -X 'GET' \
'https://services.magalu.com/v0/questions' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
Response:
{
"meta": {
"page": {
"limit": 20,
"offset": 150,
"max_limit": 100
},
"links": {
"previous": "?_offset=130&_limit=20",
"next": "?_offset=170&_limit=20",
"self": "?_offset=150&_limit=20"
}
},
"results": [
{
"id": "630e3bbc950b052e8724491a",
"status": "NEW",
"subject": {
"id": "id-001",
"type": "offer",
"extra": {
"name": "Camiseta",
"description": "Camiseta gola v na cor verde",
"url_img": "https://www.magazineluiza.com/camiseta-gola-v_imagem.jpg",
"url": "https://www.magazineluiza.com/camiseta-gola-v"
},
"custom_fields": [
{
"name": "Cor",
"value": "Verde"
}
],
"identifiers": [
{
"name": "openapi",
"value": "a11d50a5-31c1-4e9d-bbe3-27a59f944508",
"reference": "https://api-internal.magalu.com/v0/portfolios/skus/a11d50a5-31c1-4e9d-bbe3-27a59f944508"
}
]
},
"question": {
"message": "Quais as outras cores?",
"when_at": "2023-06-27T18:56:28.445Z",
"owner": {
"name": "Fluano da Silva (cliente)",
"external_id": "cli-001"
},
"product": {
"sku": "sku-123",
"description": "description - 01"
}
},
"answer": {
"message": "Temos em três cores azul, amarelo e vermelho.",
"external_id": "resposta-01",
"owner": {
"name": "Joseph Climber",
"external_id": "j.climber"
},
"moderation": {
"status": "NOT_MODERATED",
"when_at": "2023-06-27T18:56:28.445Z",
"block_rules": []
}
}
}
]
}
Return code
Status code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |