> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/editran-connect-v3.3/api/v2/contacts.md).

# Contactos

## 1. Descripción

API para consultar y gestionar contactos.

### Operaciones disponibles

* Obtener lista de contactos

***

## 2. Obtener lista de contactos

### 2.1. Información general

**Método:** `GET`\
**URL:** `https://<tu_servidor>/integration/v2/contacts` **Descripción:** Obtiene una lista paginada de contactos, con la posibilidad de filtrar por un contacto específico mediante su identificador. La respuesta incluye información detallada de cada contacto, como canales asociados, códigos remotos e IPs remotas.\
Esta operación requiere autenticación y está restringida a ciertos roles de usuario.

### 2.2. Cabeceras

```http
accept: application/json
Authorization: Bearer <token>
```

### 2.3. Parámetros

| Parámetro | Tipo   | Obligatorio | Descripción                           | Valor por defecto |
| --------- | ------ | ----------- | ------------------------------------- | ----------------- |
| contactId | string | No          | Filtrar por identificador de contacto |                   |
| page      | int    | Sí          | Número de página                      | 1                 |
| size      | int    | Sí          | Tamaño de página                      | 1                 |

### 2.4. Ejemplo de petición

```bash
curl -X 'GET' \
  'https://<tu_servidor>/integration/v2/contacts?page=1&size=10&contactId=123e4567-e89b-12d3-a456-426614174000' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJBdXRob3JpemF0...'
```

### 2.5. Seguridad

#### Autenticación

* Esta operación requiere autenticación mediante un token JWT válido.
* El token debe ser incluido en la cabecera `Authorization` con el formato `Bearer <token>`.

#### Roles autorizados

| Código                   | Descripción                        |
| ------------------------ | ---------------------------------- |
| ROLE\_GLOBALADMIN        | Administrador Global               |
| ROLE\_ADMIN              | Administrador                      |
| ROLE\_ADVOPERATOR        | Operador Avanzado                  |
| ROLE\_OPERATOR           | Operador                           |
| ROLE\_CONTROLATOR        | Controlador                        |
| ROLE\_ADMINFF            | Administrador de Firma             |
| ROLE\_ADMINCONTROLATORFF | Administrador Controlador de Firma |

### 2.6. Respuestas

#### Códigos de estado

| Código | Descripción                |
| ------ | -------------------------- |
| 200    | Operación exitosa          |
| 401    | No autorizado              |
| 403    | Prohibido                  |
| 500    | Error interno del servidor |

#### Respuesta 200 OK

Devuelve un objeto paginado con la lista de contactos.

**Estructura**

```json
{
  "totalPages": 1073741824,
  "totalElements": 9007199254740991,
  "size": 1073741824,
  "content": [
    {
      "id": "string",
      "name": "string",
      "version": "string",
      "os": "string",
      "channels": [
        "string"
      ],
      "remoteCodes": [
        {
          "id": "string",
          "code": "string",
          "name": "string"
        }
      ],
      "remoteIPs": [
        {
          "id": "string",
          "ipAddress": "string",
          "port": 1073741824
        }
      ],
      "contactInfo": [
        {
          "id": "string",
          "name": "string",
          "lastName": "string",
          "secondLastName": "string",
          "email": "string",
          "phone": "string",
          "mobile": "string",
          "address": "string",
          "ocupation": "string"
        }
      ]
    }
  ],
  "number": 1073741824,
  "sort": {
    "empty": true,
    "sorted": true,
    "unsorted": true
  },
  "numberOfElements": 1073741824,
  "first": true,
  "last": true,
  "pageable": {
    "offset": 9007199254740991,
    "sort": {
      "empty": true,
      "sorted": true,
      "unsorted": true
    },
    "paged": true,
    "unpaged": true,
    "pageSize": 1073741824,
    "pageNumber": 1073741824
  },
  "empty": true
}
```

**Datos de paginación**

| Campo            | Descripción                             |
| ---------------- | --------------------------------------- |
| totalPages       | Número total de páginas                 |
| totalElements    | Número total de elementos               |
| size             | Tamaño de página                        |
| number           | Página actual                           |
| first            | Indica si es la primera página          |
| last             | Indica si es la última página           |
| numberOfElements | Número de elementos en la página actual |
| empty            | Indica si la página está vacía          |

**Contenido**

| Campo   | Descripción        |
| ------- | ------------------ |
| content | Lista de contactos |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.editran.onesait.com/documentacion-editran/editran-connect-v3.3/api/v2/contacts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
