Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
GITBOOK-1175: Omnichannel - custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
rachana-visavadiya authored and gitbook-bot committed Nov 26, 2023
1 parent be1ee17 commit 2288dfb
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 161 deletions.
8 changes: 4 additions & 4 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@
* [Get Available Departments by Unit ID](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-departments/get-available-departments-by-unit-id.md)
* [Get Departments by Unit ID](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-departments/get-departments-by-unit-id.md)
* [Livechat Custom Field](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/README.md)
* [Send a Livechat custom field](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/send-a-livechat-custom-field.md)
* [Send an array of Livechat custom fields](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/send-an-array-of-livechat-custom-fields.md)
* [List livechat custom fields](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/list-livechat-custom-fields.md)
* [Get info about a custom field](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/get-info-about-a-custom-field.md)
* [Send Custom Field Value](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/send-custom-field-value.md)
* [Send Array of Custom Field Values](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/send-an-array-of-livechat-custom-fields.md)
* [Get Livechat Custom Fields](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/get-livechat-custom-fields.md)
* [Get Custom Field Information](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/custom-fields/get-custom-field-information.md)
* [Livechat Audio Video Calls](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/README.md)
* [Start Call](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-start-call.md)
* [Update Call Status](reference/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-update-call-status.md)
Expand Down
6 changes: 3 additions & 3 deletions reference/api/rest-api/endpoints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ From version 0.50.0 and on, you can call the methods using `dm` instead of `im`.

| Url | Short Description | Details Page |
| ----------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `livechat/custom.field` | Sends a custom field | [Link](omnichannel/livechat-endpoints/custom-fields/send-a-livechat-custom-field.md) |
| `livechat/custom.field` | Sends a custom field | [Link](omnichannel/livechat-endpoints/custom-fields/send-custom-field-value.md) |
| `livechat/custom.fields` | Sends an array of custom field | [Link](omnichannel/livechat-endpoints/custom-fields/send-an-array-of-livechat-custom-fields.md) |
| `livechat/custom-fields` | Retrieves a list of omnichannel custom fields | [Link](omnichannel/livechat-endpoints/custom-fields/list-livechat-custom-fields.md) |
| `livechat/custom-fields/:_id` | Retrieves info about a custom field | [Link](omnichannel/livechat-endpoints/custom-fields/get-info-about-a-custom-field.md) |
| `livechat/custom-fields` | Retrieves a list of omnichannel custom fields | [Link](omnichannel/livechat-endpoints/custom-fields/get-livechat-custom-fields.md) |
| `livechat/custom-fields/:_id` | Retrieves info about a custom field | [Link](omnichannel/livechat-endpoints/custom-fields/get-custom-field-information.md) |

#### Livechat Message

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Get Custom Field Information

Get details about a specific custom field.

<table><thead><tr><th width="163">HTTP Method</th><th width="332">URL</th><th>Requires Auth</th></tr></thead><tbody><tr><td><code>GET</code></td><td><code>/api/v1/livechat/custom-fields/:_id</code></td><td><a href="../../../authentication-endpoints/">yes</a></td></tr></tbody></table>

{% hint style="info" %}
Permission required: `view-l-room`
{% endhint %}

## Path Variables

<table><thead><tr><th width="197">Key</th><th width="254">Example Value</th><th>Description</th></tr></thead><tbody><tr><td><code>_id</code><mark style="color:red;"><code>*</code></mark></td><td><code>address</code></td><td>The custom field ID.</td></tr></tbody></table>

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/livechat/custom-fields/address
```

## Example Response

```json
{
"customField": {
"_id": "address",
"label": "address",
"scope": "visitor",
"visibility": "visible",
"regexp": "",
"searchable": true,
"type": "input",
"required": false,
"defaultValue": "",
"options": "",
"public": true,
"_updatedAt": "2023-10-30T13:43:09.408Z",
"id": "address"
},
"success": true
}
```

## Change Log

| Version | Description |
| ------- | ----------- |
| 2.4.0 | Added |

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Get Livechat Custom Fields

Get a list of the Livechat custom fields.

<table><thead><tr><th width="163">HTTP Method</th><th width="332">URL</th><th>Requires Auth</th></tr></thead><tbody><tr><td><code>GET</code></td><td><code>/api/v1/livechat/custom-fields</code></td><td><a href="../../../authentication-endpoints/">yes</a></td></tr></tbody></table>

{% hint style="info" %}
Permission required: `view-l-room`
{% endhint %}

## Query Parameters

This endpoint supports the [#pagination](../../../../#pagination "mention") query parameters.

## Example Call

```powershell
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/livechat/custom-fields
```

## Example Response

```json
{
"customFields": [
{
"_id": "address",
"label": "address",
"scope": "visitor",
"visibility": "visible",
"regexp": "",
"searchable": true,
"type": "input",
"required": false,
"defaultValue": "",
"options": "",
"public": true,
"_updatedAt": "2023-10-30T13:43:09.408Z",
"id": "address"
}
],
"count": 1,
"offset": 0,
"total": 1,
"success": true
}
```

## Change Log

| Version | Description |
| ------- | ----------- |
| 2.2.0 | Added |

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
# Send an array of Livechat custom fields
# Send Array of Custom Field Values

| URL | Requires Auth | HTTP Method |
| -------------------------------- | ------------- | ----------- |
| `/api/v1/livechat/custom.fields` | `no` | `POST` |
Send an array of values for different custom fields.

## Example payload
<table><thead><tr><th width="163">HTTP Method</th><th width="332">URL</th><th>Requires Auth</th></tr></thead><tbody><tr><td><code>POST</code></td><td><code>/api/v1/livechat/custom.fields</code></td><td><code>no</code></td></tr></tbody></table>

```javascript
{
"token": "iNKE8a6k6cjbqWhWd",
"customFields": [{
"key": "address",
"value": "Rocket.Chat Avenue",
"overwrite": true
}]
}
```
## Body Parameters

<table><thead><tr><th width="215">Key</th><th width="225">Example Value</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code><mark style="color:red;"><code>*</code></mark></td><td><code>iNKE8a6k6cjbqWhWd</code></td><td>The visitor token.</td></tr><tr><td><code>customFields</code><mark style="color:red;"><code>*</code></mark></td><td><code>"customFields": [{ ... }] }</code></td><td>The object in which you must enter the custom field information.</td></tr><tr><td><code>key</code><mark style="color:red;"><code>*</code></mark></td><td><code>address</code></td><td>The custom field.</td></tr><tr><td><code>value</code><mark style="color:red;"><code>*</code></mark></td><td><code>Rocket.Chat Avenue</code></td><td>The value you want to set for the custom field.</td></tr><tr><td><code>overwrite</code><mark style="color:red;"><code>*</code></mark></td><td><code>true</code></td><td>Overwrite the value of the custom field.</td></tr></tbody></table>

## Example Call

```bash
```powershell
curl -X POST \
-H "Content-type:application/json" \
http://localhost:3000/api/v1/livechat/custom.fields \
-d '{"token": "iNKE8a6k6cjbqWhWd", "customFields": [{"key": "address", "value": "Rocket.Chat Avenue", "overwrite": true}]}'
-d '{"token": "iNKE8a6k6cjbqWhWd",
"customFields": [{
"key": "address",
"value": "Rocket.Chat Avenue",
"overwrite": true}]}'
```

## Example Result
## Example Response

```javascript
```json
{
"fields": [
{
Expand All @@ -46,5 +41,3 @@ curl -X POST \
| Version | Description |
| ------- | ----------- |
| 0.70.0 | Added |

##
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Send Custom Field Value

Send the value for a custom field.

<table><thead><tr><th width="163">HTTP Method</th><th width="332">URL</th><th>Requires Auth</th></tr></thead><tbody><tr><td><code>POST</code></td><td><code>/api/v1/livechat/custom.field</code></td><td><code>no</code></td></tr></tbody></table>

## Body Parameters

<table><thead><tr><th width="215">Key</th><th width="225">Example Value</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code><mark style="color:red;"><code>*</code></mark></td><td><code>iNKE8a6k6cjbqWhWd</code></td><td>The visitor token.</td></tr><tr><td><code>key</code><mark style="color:red;"><code>*</code></mark></td><td><code>address</code></td><td>The custom field.</td></tr><tr><td><code>value</code><mark style="color:red;"><code>*</code></mark></td><td><code>Rocket.Chat Avenue</code></td><td>The value you want to set for the custom field.</td></tr><tr><td><code>overwrite</code><mark style="color:red;"><code>*</code></mark></td><td><code>true</code></td><td>Overwrite the value of the custom field.</td></tr></tbody></table>

## Example Call

```powershell
curl -X POST \
-H "Content-type:application/json" \
http://localhost:3000/api/v1/livechat/custom.field \
-d '{"token": "iNKE8a6k6cjbqWhWd",
"key": "address",
"value": "Rocket.Chat Avenue",
"overwrite": true}'
```

## Example Response

```json
{
"field": {
"key": "address",
"value": "Rocket.Chat Avenue",
"overwrite": true
},
"success": true
}
```

## Change Log

| Version | Description |
| ------- | ----------- |
| 0.70.0 | Added |

0 comments on commit 2288dfb

Please sign in to comment.