---
agentTools:
  projectIndex: https://fix-pay.readme.io/llms.txt
---

# Retornar Timeline Assinatura

Retorna a linha do tempo de uma assinatura.

## Retornar Timeline Assinatura

Retorna uma lista com a linha do tempo das alterações realizadas em uma assinatura.

## Como implementar:

Primeiramente, é necessário passar o token da sessão do estabelecimento no header "Authorization". Esse token é disponibilizado através do Suporte. Os contatos estão disponibilizados em nossa página <a href="https://fixpay.com.br/atendimento/" target="_blank">Fix Pay</a>.

## Exemplo:

Agora, veremos um exemplo da requisição feita em JavaScript e seu resultado.

```javascript Request
const options = {
  method: 'GET',
  headers: {
    accept: 'application/json',
    Authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc3VhcmlvSWQiOjQwMiwiZXhwIjoxNzA5MTI5NzYzLCJpc3MiOiJBdXRoU2VydmljZSJ9.nbT4cJE_myXaoN4wqKUsjQsv-i9LcIFM22PkJaDY5Yw'
  }
};

fetch('https://apis.fixpay.com.br/v1/signature/timeline/137/7', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

O retorno da requisição é um JSON contendo dados relevantes, como podemos ver a seguir.

```javascript Response
{
    "data": [
        {
            "id": 13,
            "descricao": "ADESÃO REALIZADA",
            "assinatura_id": 7,
            "estabelecimento_id": 1000,
            "grupo_id": 123,
            "usuario_id": 0,
            "sign_usuario_id": 0,
            "created_at": "2022-03-18T18:09:23.160233Z",
            "updated_at": "2022-03-18T18:09:23.160234Z"
        },
        {
            "id": 12,
            "descricao": "ASSINATURA CRIADA",
            "assinatura_id": 7,
            "estabelecimento_id": 1000,
            "grupo_id": 123,
            "usuario_id": 605,
            "sign_usuario_id": 0,
            "created_at": "2022-03-17T15:40:56.732658Z",
            "updated_at": "2022-03-17T15:40:56.732659Z"
        }
    ]
}
```

## Testar rota

Abaixo, você poderá testar a rota em produção, passando os valores nos parâmetros conforme sua descrição e tipo. Na lateral direita da tela, você poderá ver o código da requisição em várias linguagens diferentes e sua resposta. Além disso, na parte de resposta da requisição, você poderá ver todos os possíveis retornos gerados pela rota.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Timeline Assinatura",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://apis.fixpay.com.br/v1/signature/timeline"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/{groupId}/{signatureId}": {
      "get": {
        "summary": "Retornar Timeline Assinatura",
        "description": "Retorna a linha do tempo de uma assinatura.",
        "operationId": "timeline-assinatura",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "description": "Id do grupo. Ex.: 123",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "signatureId",
            "in": "path",
            "description": "Id da assinatura. Ex.: 123",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Token gerado no momento em que o usuário realiza o login no portal. Formato: eyXXXXXXXXXXXXXXXXXXXXXXXXXXXXw0",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"data\": [\n        {\n            \"id\": 13,\n            \"descricao\": \"ADESÃO REALIZADA\",\n            \"assinatura_id\": 7,\n            \"estabelecimento_id\": 1000,\n            \"grupo_id\": 123,\n            \"usuario_id\": 0,\n            \"sign_usuario_id\": 0,\n            \"created_at\": \"2022-03-18T18:09:23.160233Z\",\n            \"updated_at\": \"2022-03-18T18:09:23.160234Z\"\n        },\n        {\n            \"id\": 12,\n            \"descricao\": \"ASSINATURA CRIADA\",\n            \"assinatura_id\": 7,\n            \"estabelecimento_id\": 1000,\n            \"grupo_id\": 123,\n            \"usuario_id\": 605,\n            \"sign_usuario_id\": 0,\n            \"created_at\": \"2022-03-17T15:40:56.732658Z\",\n            \"updated_at\": \"2022-03-17T15:40:56.732659Z\"\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 13,
                            "default": 0
                          },
                          "descricao": {
                            "type": "string",
                            "example": "ADESÃO REALIZADA"
                          },
                          "assinatura_id": {
                            "type": "integer",
                            "example": 7,
                            "default": 0
                          },
                          "estabelecimento_id": {
                            "type": "integer",
                            "example": 1000,
                            "default": 0
                          },
                          "grupo_id": {
                            "type": "integer",
                            "example": 123,
                            "default": 0
                          },
                          "usuario_id": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "sign_usuario_id": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2022-03-18T18:09:23.160233Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2022-03-18T18:09:23.160234Z"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"error\": \"Nenhum registro encontrado para essa assinatura!\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Nenhum registro encontrado para essa assinatura!"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63b5dc6c22296400167ee328:63b6b9cfa5db7a007ab93cb5"
}
```