# POST Consultar Cidade

#### **Introdução**

Retorna os dados de uma determinada cidade/UF informada.

---

##### ***Rota***

```css
/Endereco/Cidade
```

#### ***Authorization***

É necessário um token de autorização do tipo **Bearer Token**. O token deve ser fornecido da seguinte forma:

<table border="1" id="bkmrk-token-eyj..." style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>Token</td><td>eyJ...</td></tr></tbody></table>

##### ***Headers Request***

<table border="1" id="bkmrk-accept%3A-application%2F" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50.0477%;"></col><col style="width: 50.0477%;"></col></colgroup><tbody><tr><td>Accept:</td><td>application/json</td></tr><tr><td>Content-Type</td><td>application/json</td></tr></tbody></table>

#### **Detalhes da API**

Campos obrigatórios e seus respectivos tipos

---

##### ***Campos***

<table border="1" id="bkmrk-campo-tipo-descri%C3%A7%C3%A3o" style="border-collapse: collapse; width: 100%; height: 91.425px; border-width: 1px;"><colgroup><col style="width: 33.3651%;"></col><col style="width: 33.3651%;"></col><col style="width: 16.6826%;"></col><col style="width: 16.6826%;"></col></colgroup><thead><tr style="height: 29.6px;"><td style="height: 29.6px;">**<span class="sc-fzoXzr bUnOKm">Campo</span>**</td><td style="height: 29.6px;">**Tipo**</td><td>**Obrigatorio**</td><td style="height: 29.6px;">**Descrição**</td></tr></thead><tbody><tr style="height: 30.9125px;"><td style="height: 30.9125px;">`<span class="sc-fzoXzr bUnOKm">nomeCidade</span> `  
</td><td style="height: 30.9125px;">string</td><td>Sim</td><td style="height: 30.9125px;">Nome da cidade a ser consultada.</td></tr><tr style="height: 30.9125px;"><td style="height: 30.9125px;">`uf`  
</td><td style="height: 30.9125px;">string</td><td>Sim</td><td style="height: 30.9125px;">Unidade Federativa (sigla do estado).</td></tr></tbody></table>

##### ***Campos Opcionais***

<table border="1" id="bkmrk-campo-tipo-descri%C3%A7%C3%A3o-1" style="border-collapse: collapse; width: 100%; height: 59.2px;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><thead><tr style="height: 29.6px;"><td style="height: 29.6px;">**Campo**</td><td style="height: 29.6px;">**Tipo**</td><td style="height: 29.6px;">**Descrição**</td></tr></thead><tbody><tr style="height: 29.6px;"><td style="height: 29.6px;">Nenhum</td><td style="height: 29.6px;"> **-**</td><td style="height: 29.6px;">Não existem campos opcionais.</td></tr></tbody></table>

#### **Exemplo de Requisição e Resposta**

---

##### ***Body da Requisição***

<details id="bkmrk-body-%7B-%22nomecidade%22%3A"><summary>body</summary>

```json
{
  "nomeCidade": "São Paulo",
  "uf": "SP"
}
```

</details>##### **Ex*emplo de Request***

<details id="bkmrk-curl-curl---location"><summary>curl</summary>

```bash
curl --location 'https://app2-crefaz-api-external-stag.azurewebsites.net/api/Endereco/Cidade' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "nomeCidade": "São Paulo",
  "uf": "SP"
}'
```

</details>##### ***Exemplo de Response***

<details id="bkmrk-json-%7B-%22success%22%3A-tr"><summary>sucesso</summary>

```json
{
  "success": true,
  "data": [
    {
      "cidadeId": 5320,
      "cidadeNome": "São Paulo",
      "codigoIBGE": 3550308,
      "ufId": 25,
      "uf": "SP"
    }
  ],
  "errors": null
}
```

</details><details id="bkmrk-erro-%7B-%22success%22%3A-fa"><summary>erro</summary>

```json
{
  "success": false,
  "data": null,
  "errors": [
    "Nenhum registro encontrado!"
  ]
}
```

</details>##### ***<span class="Text__TextContainer-sc-1kqigik-0 dLPxIq" data-aether-id="aether-text" data-click="" data-testid="aether-text">Headers de Response (5)</span>***

<table border="1" id="bkmrk-key-value-content-ty" style="border-collapse: collapse; width: 100%; height: 177.6px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><thead><tr style="height: 29.6px;"><td style="height: 29.6px;">**Key**</td><td style="height: 29.6px;">**Value**</td></tr></thead><tbody><tr style="height: 29.6px;"><td style="height: 29.6px;"><div>**<span class="Text__TextContainer-sc-1kqigik-0 ecMirJ sc-fznXWL cEvDCP item-key" data-aether-id="aether-text" data-click="" data-testid="aether-text">Content-Type</span>**</div></td><td style="height: 29.6px;">application/json; charset=utf-8</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">**Date**</td><td style="height: 29.6px;">Fri, 04 Oct 2024 17:56:31 GMT

</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;"><div>**<span class="Text__TextContainer-sc-1kqigik-0 ecMirJ sc-fznXWL cEvDCP item-key" data-aether-id="aether-text" data-click="" data-testid="aether-text">Server</span>**</div></td><td style="height: 29.6px;">Kestrel</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">**Transfer-Encoding**</td><td style="height: 29.6px;">chunked</td></tr><tr style="height: 29.6px;"><td style="height: 29.6px;">**Request-Context**</td><td style="height: 29.6px;">appId=cid-v1:d0033e30-cc70-4961-9727-b7389fb39348</td></tr></tbody></table>