# Trengo

> Manage support tickets and look up conversations, contacts, teams and calls.

App · 19 actions. Web page: https://docs.lodol.com/docs/integrations/trengo

## Actions

### Assign ticket

Assign ticket in Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id
- Type (`type`, text, required): Assignment type: `team` or `user`. One of: `team`, `user`.
- Person (`person_id`, number): The user id, required if type is `user`
- Assigned team (`assigned_team_id`, number): The team id, required if type is `team`
- Note (`note`, text): Optional assignment note

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### Attach label

Attach label in Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id
- Label (`label_id`, number, required): The label id

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### Close ticket

Close ticket in Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id
- Ticket result ID (`ticket_result_id`, number): Apply an optional ticket result

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### Create ticket

Create ticket in Trengo.

**Inputs**

- Channel ID (`channel_id`, number, required): The channel id
- Contact ID (`contact_id`, text, required): The contact id
- Subject (`subject`, text): Optional subject

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "id": 1,
    "status": "example"
  }
}
```

### Detach label

Detach label in Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id
- Label (`label_id`, number, required): The label id

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### Get contact

Get contact from Trengo.

**Inputs**

- Contact ID (`contact_id`, number, required): The contact id
- Include (`include`, text): Eager load relations (available: notes)

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "custom_field_data": {
      "stock_no": "example"
    },
    "email": "example",
    "id": 1,
    "name": "example",
    "phone": {},
    "updated_at": "example"
  }
}
```

### Get ticket

Get ticket from Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "closed_at": "example",
    "contact_id": 1,
    "created_at": "example",
    "custom_field_values": [
      {
        "custom_field_id": 1,
        "field_name": "example",
        "value": "example"
      }
    ],
    "id": 1,
    "status": "example",
    "subject": "example",
    "team_id": 1,
    "user_id": 1
  }
}
```

### Get ticket message

Get ticket message from Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket ID
- Message ID (`message_id`, number, required): The message ID

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### List calls

List calls from Trengo.

**Inputs**

- Page (`page`, number): Optional, used to fetch the desired page. At least 1. Default: `1`.
- Statuses (`statuses`, list): Optional, calls will be filtered to match one of the statuses given in this field. Valid values are: `RINGING`, `IN_PROGRESS`, `COMPLETED`, `MISSED`, `VOICEMAIL`, `QUEUED`, `FAILED`, `STATUS_IVR`
- Per page (`per_page`, number): This can used to configure the number of items per page (1-100). At least 1. Default: `50`.

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### List contacts

List contacts from Trengo.

**Inputs**

- Page (`page`, number): The current page. At least 1. Default: `1`.
- Term (`term`, text): Search term to find a contact (works on email, phone number and name)
- Include (`include`, list): Optional additional data for a contact to be included in the response. Currently supported include items: *lastInteraction*

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "name": "example"
      }
    ],
    "links": {
      "next": "example"
    }
  }
}
```

### List labels

List labels from Trengo.

**Inputs**

- Page (`page`, text): Pagination

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "name": "example"
      }
    ],
    "links": {
      "next": "example"
    }
  }
}
```

### List quick replies

List quick replies from Trengo.

**Inputs**

- Type (`type`, text): Filter by type (`SMS` [deprecated], `MESSAGING`, `EMAIL`)

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```

### List teams

List teams from Trengo.

**Inputs**

- Page (`page`, text): Pagination

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "name": "example"
      }
    ],
    "links": {
      "next": "example"
    }
  }
}
```

### List ticket counts

List ticket counts from Trengo.

**Inputs**

- Channels (`channels`, list): Ids of channels to include in aggregates
- Labels (`labels`, list): Ids of labels to include in aggregates
- Users (`users`, list): Ids of users to include in aggregates

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "channels": {
      "9467708": 1,
      "9468021": 1,
      "9468531": 1
    },
    "labels": {
      "413": 1,
      "418": 1,
      "424": 1,
      "428": 1
    },
    "statuses": {
      "assigned": 1,
      "open": 1
    },
    "users": {
      "1": 1,
      "2016914": 1
    }
  }
}
```

### List ticket messages

List ticket messages from Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id
- Page (`page`, number): Pagination. At least 1.

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "agent": {},
        "body_type": "TEXT",
        "contact": {},
        "created_at": "example",
        "file_caption": "example",
        "file_name": "example",
        "id": 1,
        "message": "example",
        "referral": {},
        "ticket_id": 1,
        "type": "INBOUND",
        "updated_at": "example"
      }
    ],
    "links": {
      "first": "example",
      "last": "example",
      "next": "example",
      "prev": "example"
    },
    "meta": {
      "current_page": 1,
      "from": 1,
      "path": "example",
      "per_page": 1,
      "to": 1
    }
  }
}
```

### List tickets

List tickets from Trengo.

**Inputs**

- Page (`page`, number): Pagination page. At least 1. Default: `1`.
- Status (`status`, text): Filter by status (`OPEN`, `ASSIGNED`,`CLOSED`,`INVALID`). One of: `OPEN`, `ASSIGNED`, `CLOSED`, `INVALID`.
- Contact ID (`contact_id`, number): Filter by a contact id
- Users (`users`, list): Filter by one or more user ids
- Channels (`channels`, list): Filter by one or more channels ids
- Labels (`labels`, list): Filter by one or more label ids
- Last message type (`last_message_type`, text): Filter by the last message type (`INBOUND`,`OUTBOUND`). One of: `INBOUND`, `OUTBOUND`.
- Sort (`sort`, text): Orders by last messages at, 'date' orders at oldest first. One of: `-date`, `date`. Default: `-date`.
- Updated at gt (`updated_at_gt`, date and time): Filter by updated at (greater than)

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "id": 1,
        "name": "example",
        "status": "example",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    }
  }
}
```

### List users

List users from Trengo.

**Inputs**

- Page (`page`, text): Pagination
- Sort (`sort`, text): Sort users by a specific column. Allowed options are `id` (default), `first_name`, `last_name`, `created_at`. One of: `id`, `first_name` (First name), `last_name` (Last name), `created_at` (Created at).

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "name": "example"
      }
    ],
    "links": {
      "next": "example"
    }
  }
}
```

### List voice channels

List voice channels from Trengo.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "id": 1,
        "phone": "example",
        "title": "example"
      }
    ]
  }
}
```

### Reopen ticket

Reopen ticket in Trengo.

**Inputs**

- Ticket ID (`ticket_id`, number, required): The ticket id

**Outputs**

- `data` (object): The response from Trengo.

**Example output**

```json
{
  "data": {}
}
```
