# Capturando ID das Mesas e Estágios

{% hint style="danger" %}
Informamos que a API v1 foi **DESCONTINUADA.**

Para proporcionar uma melhor experiência ao usuário, lançamos a API v2, que traz melhorias tecnológicas, otimizações e novas rotas.&#x20;

Para mais detalhes e acesso à documentação oficial da API v2, [clique aqui.](https://api.tiflux.com/api/v2/#overview)
{% endhint %}

Veja abaixo o método em nossa **API** para criar ticket em determinada mesa com estágio específico.<br>

<figure><img src="https://2304813967-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LCU_zijA4r4IkDIJyZG%2Fuploads%2F3CkNUXK7KkFBOpYeM98u%2Fimage.png?alt=media&#x26;token=9ae2b385-ad52-4df6-b8ad-25cd5ece718f" alt=""><figcaption></figcaption></figure>

Para que isso seja possível, precisamos informar o **código da mesa** e o **código do estágio** dessa mesa.

1. Para pegar o código da mesa, entre nas configurações desta mesa, na URL fica localizado o ID da mesa.<br>

   <figure><img src="https://2304813967-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LCU_zijA4r4IkDIJyZG%2Fuploads%2Fz8T18U2eVb3MKuXqHUPJ%2Fimage.png?alt=media&#x26;token=54223c23-a324-4f84-874f-14e6729716b0" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Esse código é um identificador **único.**
{% endhint %}

2. Agora, para pegar o código dos estágios, ainda na configuração da mesa, pressione a tecla F12 (ou botão direito na tela, inspecionar), localize e selecione a aba "Network"

<figure><img src="https://2304813967-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LCU_zijA4r4IkDIJyZG%2Fuploads%2FKuqmNy9m8CMrUElA5WQw%2Fimage.png?alt=media&#x26;token=cda39099-ca04-4f02-a641-a75413a7b914" alt=""><figcaption></figcaption></figure>

3. Feito isto, clique na aba da mesa "Estágio", algumas linhas serão carregadas na aba "Network"

<figure><img src="https://2304813967-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LCU_zijA4r4IkDIJyZG%2Fuploads%2FTHqdXf6iO80NaDsOpI2P%2Fimage.png?alt=media&#x26;token=8bdf8a24-6ef4-4ea4-a6a4-2007d2942285" alt=""><figcaption></figcaption></figure>

4. Clique na linha **desk\_stages.json**<br>

   <figure><img src="https://2304813967-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LCU_zijA4r4IkDIJyZG%2Fuploads%2FB5Bz5FZeUNFpEAgVxU3f%2Fimage.png?alt=media&#x26;token=e7c34352-b247-48b0-a78f-f50f7a169f21" alt=""><figcaption></figcaption></figure>
5. Copie estes dados e repasse para o desenvolvedor responsável.

```
{
  "stages": [
    {
      "id": 125940,
      "name": "N1",
      "max_time": 4,
      "desk_id": 21876,
      "next_stage_id": null,
      "created_at": "2021-06-10T09:34:33.411-03:00",
      "updated_at": "2021-06-10T09:34:33.411-03:00",
      "first_stage": false,
      "last_stage": false,
      "organization_id": 6454,
      "active": true,
      "index": 2,
      "deletable": true,
      "possible_stages": [],
      "next_stage": null,
      "in_procedures": [
        {
          "id": 20218,
          "name": "E-mail Exames",
          "description": "E-mail Exames",
          "_type": "1",
          "email_template_id": 377966,
          "email_to": "{TICKET_PERSON_MAIL}",
          "field_name": null,
          "field_to": null,
          "organization_id": 6454,
          "created_at": "2021-06-11T15:51:38.348-03:00",
          "updated_at": "2021-06-11T15:51:38.348-03:00",
          "desk_id": null,
          "client_id": null,
          "place_id": null,
          "equipment_id": null,
          "fields": [
            {
              "target_field": "",
              "new_value": "",
              "type": "text"
            }
          ],
          "services_catalogs_item_id": null,
          "services_catalogs_area_id": null,
          "services_catalog_id": null,
          "requestor_email": null,
          "equipment_group_id": null
        }
      ],
      "out_procedures": [
        {
          "id": 20296,
          "name": "E-mail avaliação",
          "description": "E-mail avaliação",
          "_type": "1",
          "email_template_id": 375178,
          "email_to": "{TICKET_PERSON_MAIL}",
          "field_name": null,
          "field_to": null,
          "organization_id": 6454,
          "created_at": "2021-06-17T15:15:28.900-03:00",
          "updated_at": "2021-06-17T15:15:28.900-03:00",
          "desk_id": null,
          "client_id": null,
          "place_id": null,
          "equipment_id": null,
          "fields": [
            {
              "target_field": "",
              "new_value": "",
              "type": "text"
            }
          ],
          "services_catalogs_item_id": null,
          "services_catalogs_area_id": null,
          "services_catalog_id": null,
          "requestor_email": null,
          "equipment_group_id": null
        }
      ],
      "technical_groups": []
    }
  ],
  "first_stage": {
    "id": 125939,
    "name": "first_stage_name",
    "max_time": 4,
    "desk_id": 21876,
    "next_stage_id": null,
    "created_at": "2021-06-10T09:34:33.361-03:00",
    "updated_at": "2021-06-10T09:34:33.361-03:00",
    "first_stage": true,
    "last_stage": false,
    "organization_id": 6454,
    "active": true,
    "index": 1,
    "deletable": true,
    "possible_stages": [
      {
        "id": 125940,
        "name": "N1",
        "max_time": 4,
        "desk_id": 21876,
        "next_stage_id": null,
        "created_at": "2021-06-10T09:34:33.411-03:00",
        "updated_at": "2021-06-10T09:34:33.411-03:00",
        "first_stage": false,
        "last_stage": false,
        "organization_id": 6454,
        "active": true,
        "index": 2,
        "deletable": true
      }
    ],
    "next_stage": null,
    "in_procedures": [],
    "out_procedures": [],
    "technical_groups": []
  },
  "last_stage": {
    "id": 125941,
    "name": "last_stage_name",
    "max_time": 4,
    "desk_id": 21876,
    "next_stage_id": null,
    "created_at": "2021-06-10T09:34:33.481-03:00",
    "updated_at": "2021-06-10T09:34:33.481-03:00",
    "first_stage": false,
    "last_stage": true,
    "organization_id": 6454,
    "active": true,
    "index": 3,
    "deletable": true,
    "possible_stages": [],
    "next_stage": null,
    "in_procedures": [],
    "out_procedures": [],
    "technical_groups": []
  }
}
```
