Skip to content

Trace

Retrieve a list of traces

Returns all available traces.

Note

This endpoint implements pagination, sorting and filters. To learn more, refer to Make paginated requests and query parameters.

Required scope

Value Description
open:trace:read Allow list traces

Query parameters

Field Type Description Required
code string Returns all traces by code No
severity string Returns all traces by severity value No
origin.context string Returns all traces by context value No
origin.resource string Returns all traces by resource value No

Sort parameters

Field Description Required
created_at Sort trace by creation date. No
sent_at Sort trace by date the processing was sent. No

Request:

curl -X 'GET' \
  'https://api.magalu.com/v0/traces' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Response:

{
  "meta": {
    ...
  },
  "results": [
    {
        "code": "ABC123",
        "message": "Publicado com sucesso com o ID 123456789",
        "severity": "INFO",
        "created_at": "2022-06-15T14:25:37Z",
        "origin": {
            "context": "portfolios",
            "resource": "prices"
        }
    }
  ]
}

Return code

Note

For more information about status code see Return code.

Code Description
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
422 Unprocessable Entity
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout

Retrieve a trace

Return a specific trace

Required scope

Value Description
open:trace:read Allow list traces

URL parameters

Field Type Description Required
id uuid Trace identifier Yes

Request:

curl -X 'GET' \
  'https://api.magalu.com/v0/traces/{id}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Response:

{
  "id": "0cbc45a4-d463-4973-ae00-201f982ca3bb",
  "code": "ABC123",
  "message": "Publicado com sucesso com o ID 123456789",
  "severity": "INFO",
  "extras": {},
  "channel": {
    "id": "3f042852-3efc-4d47-97f8-f94989c7b0bc"
  },
  "reference": "https://api.magalu.com/v0/portfolios/prices/630855f0-b586-4726-9c89-741fe35356c6",
  "created_at": "2022-06-15T14:25:37Z",
  "origin": {
    "context": "portfolios",
    "resource": "prices"
  },
  "sent_at": "2022-06-15T14:25:37Z"
}

Return code

Note

For more information about status code see Return code.

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 NotFound
422 Unprocessable Entity
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout