# Listar bloqueios de agenda

GET https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda

Retorna os bloqueios de agenda do consultório com os profissionais vinculados.

Uso comum:
- sincronizar indisponibilidades;
- alimentar agendas externas;
- bloquear horários em integrações de atendimento.

Exemplo de uso:
```http
GET {{base_url}}/simplificav2/bloqueio_agenda?q={"ativo":"S"}
Authorization: Bearer {{bearer_token}}
Accept: application/json
```


Reference: https://docs.simplificagestao.com.br/api-reference/consultorio/list-bloqueio-agenda

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi-simplifica
  version: 1.0.0
paths:
  /simplificav2/bloqueio_agenda:
    get:
      operationId: list-bloqueio-agenda
      summary: Listar bloqueios de agenda
      description: >
        Retorna os bloqueios de agenda do consultório com os profissionais
        vinculados.


        Uso comum:

        - sincronizar indisponibilidades;

        - alimentar agendas externas;

        - bloquear horários em integrações de atendimento.


        Exemplo de uso:

        ```http

        GET {{base_url}}/simplificav2/bloqueio_agenda?q={"ativo":"S"}

        Authorization: Bearer {{bearer_token}}

        Accept: application/json

        ```
      tags:
        - subpackage_consultorio
      parameters:
        - name: offset
          in: query
          description: Quantos registros pular antes de começar a resposta.
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: >
            Quantidade máxima de registros por resposta.


            Observação:

            - informe `limit` explicitamente quando quiser controlar a
            quantidade por resposta.
          required: false
          schema:
            type: integer
        - name: q
          in: query
          description: >
            Filtro opcional para restringir, combinar ou ordenar os resultados.


            Se você não enviar `q`, o endpoint retorna a listagem padrão daquele
            recurso.


            Quando precisar filtrar, o `q` recebe um JSON no padrão FilterObject
            do ORDS.


            Regras práticas:

            - comece testando o endpoint sem filtro;

            - use os nomes de coluna publicados naquele endpoint;

            - use sempre o nome do campo exatamente como ele aparece no schema
            do endpoint;

            - `offset` e `limit` não entram dentro do `q`;

            - em clientes HTTP fora do Postman, o conteúdo normalmente precisa
            ser enviado URL-encoded;

            - no Postman, prefira informar o valor na aba `Params`.


            Operadores úteis:

            - `$or`

            - `$between`

            - `$orderby`

            - `$date`

            - `$ne`, `$lt`, `$lte`, `$gt`, `$gte`

            - `$instr`, `$ninstr`

            - `$notnull`


            Exemplos legíveis:

            - `{"id":162472}`

            - `{"ativo":"S"}`

            - `{"receita_recorrente_id":{"$notnull":null}}`

            - `{"status":"ABERTO","$orderby":{"data_vencimento":"ASC"}}`

            -
            `{"criado_em":{"$between":[{"$date":"2026-03-01T00:00:00Z"},{"$date":"2026-03-31T23:59:59Z"}]}}`


            Os mesmos exemplos prontos para URL:

            - `%7B%22id%22%3A162472%7D`

            - `%7B%22ativo%22%3A%22S%22%7D`

            -
            `%7B%22receita_recorrente_id%22%3A%7B%22%24notnull%22%3Anull%7D%7D`

            -
            `%7B%22status%22%3A%22ABERTO%22%2C%22%24orderby%22%3A%7B%22data_vencimento%22%3A%22ASC%22%7D%7D`

            -
            `%7B%22criado_em%22%3A%7B%22%24between%22%3A%5B%7B%22%24date%22%3A%222026-03-01T00%3A00%3A00Z%22%7D%2C%7B%22%24date%22%3A%222026-03-31T23%3A59%3A59Z%22%7D%5D%7D%7D`
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: |
            Token privado usado para consultar dados da plataforma.

            Como usar:
            - obtenha o token privado da sua empresa;
            - envie `Authorization: Bearer SEU_TOKEN_PRIVADO`;
            - não use `x-api-key` neste módulo.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Coleção paginada de bloqueios de agenda.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BloqueioAgendaCollectionResponse'
        '400':
          description: Requisição inválida ou filtro `q` malformado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemJson'
        '401':
          description: Token ausente, inválido ou expirado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemJson'
        '500':
          description: Erro inesperado no ORDS ou na camada SQL/PLSQL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemJson'
servers:
  - url: https://gestao.simplificagestao.com.br/ords/gestao
  - url: >-
      https://gd341ff411ca4b6-dbdevsimplificav2.adb.sa-saopaulo-1.oraclecloudapps.com/ords/gestao
components:
  schemas:
    CollectionMetaItemsItems:
      type: object
      properties: {}
      title: CollectionMetaItemsItems
    Link:
      type: object
      properties:
        rel:
          type: string
        href:
          type: string
      description: >-
        Estrutura ilustrativa de links de navegação do ORDS. O valor de `href`
        muda conforme o endpoint consultado.
      title: Link
    BloqueioAgenda:
      type: object
      properties:
        id:
          type: integer
        data_inicio:
          type: string
        data_fim:
          type: string
        hora_inicio:
          type: string
        hora_fim:
          type: string
        ic_domingo:
          type: string
        ic_segunda:
          type: string
        ic_terca:
          type: string
        ic_quarta:
          type: string
        ic_quinta:
          type: string
        ic_sexta:
          type: string
        ic_sabado:
          type: string
        titulo:
          type: string
        descricao:
          type: string
        todos_profissionais:
          type: string
        profissionais_ids:
          type: string
        profissionais:
          type: string
        empresa_id:
          type: integer
        ativo:
          type: string
        criado_em:
          type: string
        criado_por:
          type: string
        alterado_em:
          type: string
        alterado_por:
          type: string
      title: BloqueioAgenda
    BloqueioAgendaCollectionResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BloqueioAgenda'
        hasMore:
          type: boolean
        limit:
          type: integer
        offset:
          type: integer
        count:
          type: integer
        links:
          type: array
          items:
            $ref: '#/components/schemas/Link'
      required:
        - items
        - hasMore
        - limit
        - offset
        - count
      title: BloqueioAgendaCollectionResponse
    ProblemJson:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        type:
          type: string
        instance:
          type: string
      title: ProblemJson
  securitySchemes:
    SimplificaPrivateBearer:
      type: http
      scheme: bearer
      description: |
        Token privado usado para consultar dados da plataforma.

        Como usar:
        - obtenha o token privado da sua empresa;
        - envie `Authorization: Bearer SEU_TOKEN_PRIVADO`;
        - não use `x-api-key` neste módulo.

```

## SDK Code Examples

```python
import requests

url = "https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://gestao.simplificagestao.com.br/ords/gestao/simplificav2/bloqueio_agenda")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```