# Locais

## Endpoints

* ### Lista de locais

**URL:** \<seuprojeto>.edgecontents.com/ds/api/site

**Método:** GET

**Autenticação:** Basic Auth

**Parâmetros de Consulta:**

| Parâmetro | Tipo | Obrigatório | Descrição   |
| --------- | ---- | ----------- | ----------- |
| id        | int  | Não         | ID do local |

**Exemplo de retorno:**

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "2": {
        "name": "Paulista Coporate",
        "internalid": "",
        "address": "Av. Paulista, 1636 - cj 1007 - Cerqueira César, São Paulo - SP, 01310-200",
        "lat": "-23,56091",
        "long": "-46,656217",
        "groups": [],
        "image": null,
        "site_images": [],
        "workhours": [
            {
                "weekday": "sáb",
                "open": "00:00:00",
                "close": "18:59:59"
            }
        ]
    },
    "6": {
        "name": "Parque Trianon",
        "internalid": "",
        "address": "Rua Peixoto Gomide, 949 - Cerqueira César, São Paulo - SP, 01409-001",
        "lat": "-23,5618172",
        "long": "-46,6577701",
        "groups": [],
        "image": null,
        "site_images": [],
        "workhours": [
            {
                "weekday": "sáb",
                "open": "17:56:09",
                "close": "06:56:15"
            },
            {
                "weekday": "dom",
                "open": "10:00:00",
                "close": "08:00:00"
            }
        ]
    }
}
</code></pre>

* ### Cadastro de locais

**URL:** \<seuprojeto>.edgecontents.com/ds/api/site/add

**Método:** POST

**Autenticação:** Basic Auth

**Corpo da Requisição:**

| Campo        | Tipo   | Obrigatório | Descrição          |
| ------------ | ------ | ----------- | ------------------ |
| name         | string | Sim         | Nome do local      |
| city         | int    | Sim         | ID da cidade       |
| internalid   | string | Não         | ID interno         |
| address      | string | Não         | Endereço           |
| abbreviation | string | Não         | Abreviação do nome |
| lat          | number | Não         | Latitude           |
| long         | number | Não         | Longitude          |
| description  | string | Não         | Descrição          |

**Exemplo de requisição:**

```postman_json
[
    {
        "name": "Novo Local 1",
        "city": 1,
        "address": "Av. Paulista, 1636"
    },
    {
        "name": "Novo Local 2",
        "city": 1,
        "abbreviation": "NL2",
        "internalid": "0001"
    }
]
```

**Exemplo de retorno:**

```json
{
    "successes": [
        {
            "id": "7",
            "name": "Novo Local 1"
        },
        {
            "id": "8",
            "name": "Novo Local 2"
        }
    ],
    "errors": []
}
```

* ### Edição de locais

**URL:** \<seuprojeto>.edgecontents.com/ds/api/site/update

**Método:** POST

**Autenticação:** Basic Auth

**Corpo da Requisição:**

| Campo        | Tipo   | Obrigatório | Descrição          |
| ------------ | ------ | ----------- | ------------------ |
| id           | int    | Sim         | ID do local        |
| name         | string | Não         | Nome do local      |
| city         | int    | Não         | ID da cidade       |
| internalid   | string | Não         | ID interno         |
| address      | string | Não         | Endereço           |
| abbreviation | string | Não         | Abreviação do nome |
| lat          | number | Não         | Latitude           |
| long         | number | Não         | Longitude          |
| description  | string | Não         | Endereço           |

**Exemplo de requisição:**

```postman_json
[
    {
        "id": 7,
        "description": "Nova descrição para o local.",
        "lat": -17.83859100000000,
        "long": -40.35159050000000
    }
]
```

**Exemplo de retorno:**

```json
{
    "successes": [
        {
            "id": "7",
            "name": "Novo Local 1"
        }
    ],
    "errors": []
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.edgecontents.com/edgecontents/apis/locais.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
