npm package: @plasma-platform/service-tickets
Description: Tickets Service API
Author: Template Monster
Latest version: 0.2.3

![version](https://badgen.net/npm/v/@plasma-platform/service-discounts)
![nextVersion](https://badgen.net/npm/v/@plasma-platform/service-discounts/next)
![downloads](https://badgen.net/npm/dt/@plasma-platform/service-discounts)
![license](https://badgen.net/npm/license/@plasma-platform/service-discounts)
![dependency](https://badgen.net/npm/dependents/@plasma-platform/service-discounts)  

* * *

[Full documentation](https://templatemonster.gitlab.io/PlasmaPlatform/Frontend/plasma-platform/?path=/story/plasma-platform-sdk--service-discounts)  
install:  
`npm i @plasma-platform/service-discounts -S`  

# Short documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [TicketsService](#ticketsservice)
    -   [Parameters](#parameters)
    -   [messages](#messages)
    -   [getChatRooms](#getchatrooms)
        -   [Examples](#examples)
    -   [createExternalTicket](#createexternalticket)
        -   [Parameters](#parameters-1)
        -   [Examples](#examples-1)
    -   [getExternalTickets](#getexternaltickets)
        -   [Parameters](#parameters-2)
        -   [Examples](#examples-2)
    -   [addEscalateToDispute](#addescalatetodispute)
        -   [Parameters](#parameters-3)
        -   [Examples](#examples-3)
    -   [refundDispute](#refunddispute)
        -   [Parameters](#parameters-4)
        -   [Examples](#examples-4)
    -   [changeStateDispute](#changestatedispute)
        -   [Parameters](#parameters-5)
        -   [Examples](#examples-5)
    -   [createNewDispute](#createnewdispute)
        -   [Parameters](#parameters-6)
        -   [Examples](#examples-6)
    -   [createNewPostToDispute](#createnewposttodispute)
        -   [Parameters](#parameters-7)
        -   [Examples](#examples-7)
    -   [getDisputeInfoForAgent](#getdisputeinfoforagent)
        -   [Parameters](#parameters-8)
        -   [Examples](#examples-8)
    -   [getDisputesInfoCreator](#getdisputesinfocreator)
        -   [Parameters](#parameters-9)
        -   [Examples](#examples-9)
    -   [getDisputesForAuthor](#getdisputesforauthor)
        -   [Parameters](#parameters-10)
        -   [Examples](#examples-10)
    -   [getDisputesMe](#getdisputesme)
        -   [Parameters](#parameters-11)
        -   [Examples](#examples-11)
    -   [getPostsById](#getpostsbyid)
        -   [Parameters](#parameters-12)
        -   [Examples](#examples-12)
    -   [agentStartWatchDispute](#agentstartwatchdispute)
        -   [Parameters](#parameters-13)
        -   [Examples](#examples-13)
    -   [agentStopWatchDispute](#agentstopwatchdispute)
        -   [Parameters](#parameters-14)
        -   [Examples](#examples-14)
    -   [addNoteToDispute](#addnotetodispute)
        -   [Parameters](#parameters-15)
        -   [Examples](#examples-15)
    -   [removeNoteFromDispute](#removenotefromdispute)
        -   [Parameters](#parameters-16)
        -   [Examples](#examples-16)
    -   [addTagsToDispute](#addtagstodispute)
        -   [Parameters](#parameters-17)
        -   [Examples](#examples-17)
    -   [removeTagsFromDispute](#removetagsfromdispute)
        -   [Parameters](#parameters-18)
        -   [Examples](#examples-18)
    -   [getCustomerSupportStatistics](#getcustomersupportstatistics)
        -   [Parameters](#parameters-19)
        -   [Examples](#examples-19)
-   [defaultAutoTrim](#defaultautotrim)

## TicketsService

Tickets Micro Service API

### Parameters

-   `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** service url

### messages

Object with class service messages

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### getChatRooms

Chats - Request chat rooms list of the department

#### Examples

```javascript
To use
(async () => {
  const TicketsService = new TicketsService(url);
  const result = await TicketsService.getChatRooms();
})();
```

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** array of posts

### createExternalTicket

Create external ticket

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.subject` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value of the subject field for this ticket
    -   `params.comment` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Ticket comment
    -   `params.group` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Ticket group/department
    -   `params.userEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The original recipient e-mail address of the ticket
    -   `params.userName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The original recipient name of the ticket
    -   `params.tags` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Tags for tickets
    -   `params.ticketFields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Custom fields for the ticket. Must contain key value. Key stands for field names
    -   `params.attachments` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** Ticket attachments files
    -   `params.userIp` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User IP
    -   `params.referrer` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Referer
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].keyStorage] - Key Storage S3
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileName] - File Name
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileSize] - File Size
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileType] - File mime-type

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createExternalTicket({
    id: 123,
    content: 'Test escalate',
  });
})();
```

### getExternalTickets

Create external ticket

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.subject` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value of the subject field for this ticket
    -   `params.comment` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Ticket comment
    -   `params.group` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Ticket group/department
    -   `params.userEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The original recipient e-mail address of the ticket
    -   `params.userName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The original recipient name of the ticket
    -   `params.ticketFields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Custom fields for the ticket. Must contain key value. Key stands for field names
    -   `params.attachments` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** Ticket attachments files
    -   `params.userIp` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User IP
    -   `params.referrer` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Referer
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].keyStorage] - Key Storage S3
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileName] - File Name
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileSize] - File Size
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileType] - File mime-type

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getExternalTickets({
    id: 123,
    content: 'Test escalate',
  });
})();
```

### addEscalateToDispute

Add escalate to dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.contents` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** content of escalate
    -   `params.isRefundedByAuthor` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** for escalate by author
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** for escalate expands
    -   `params.attachments` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** Attachments
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].keyStorage] - Key Storage S3
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileName] - File Name
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileSize] - File Size
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileType] - File mime-type

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.addEscalateToDispute({
    id: 123,
    contents: 'Test escalate',
  });
})();
```

### refundDispute

Refund for dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.refundDispute({
    id: 123,
    contents: 'Test escalate',
  });
})();
```

### changeStateDispute

Change state

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.state` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** state of dispute

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.changeStateDispute({
    id: 123,
    state: 12,
  });
})();
```

### createNewDispute

Create new dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.subject` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** subject
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** subject
    -   `params.authorUserId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Author User Id
    -   `params.authorName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Author Name
    -   `params.contents` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Content
    -   `params.fields` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** CustomFields
        -   `params.fields.productId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Product Id
        -   `params.fields.orderId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Order Id
        -   `params.fields.productName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Product Name
        -   `params.fields.clientName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Client Name
        -   `params.fields.propertyValueTypeId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Product property value type Id
    -   `params.attachments` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** Attachments
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].keyStorage] - Key Storage S3
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileName] - File Name
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileSize] - File Size
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileType] - File mime-type

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createNewDispute({
    id: 123,
    state: 12,
  });
})();
```

### createNewPostToDispute

Create new post to dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.contents` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Content of disputes post
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** expand of disputes post
    -   `params.attachments` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** Attachments
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].keyStorage] - Key Storage S3
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileName] - File Name
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileSize] - File Size
-   `String` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \[].fileType] - File mime-type

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createNewPostToDispute({
    id: 123,
    state: 12,
  });
})();
```

### getDisputeInfoForAgent

Dispute information for Agent

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.fields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputeInfoForAgent({
    id: 123,
    fields: 'creator,
  });
})();
```

### getDisputesInfoCreator

Dispute information which creator

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.fields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesInfoCreator({
    id: 123,
    fields: 'creator,
  });
})();
```

### getDisputesForAuthor

Dispute information which creator

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** expands divided by comma (e.g. "free,wp")
    -   `params.tags` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** array of tags id divided by comma (e.g. "free,wp")
    -   `params.ids` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** array of ids disputes divided by comma (e.g. "1,2,5")
    -   `params.text` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Search query
    -   `params.aggregations` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** aggregations array of tags id divided by comma
    -   `params.fields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.
    -   `params.conditions` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** find all disputes with given conditions urlEncode(JSON).
    -   `params.sort` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** defines on which fields to sort (e.g. ?sort=id,-createdAt)
    -   `params.perPage` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** max items per one page (20 by default, 50 is max size)
    -   `params.page` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** page number to view
    -   `params.departmentId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Id
    -   `params.departmentNickname` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Nickname
    -   `params.departmentEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Email
    -   `params.creatorId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Id
    -   `params.creatorNickname` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Nickname
    -   `params.creatorEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Email

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesForAuthor({
    id: 123,
    fields: 'creator,
  });
})();
```

### getDisputesMe

Disputes which creator

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** expands divided by comma (e.g. "free,wp")
    -   `params.tags` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** array of tags id divided by comma (e.g. "free,wp")
    -   `params.ids` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** array of ids disputes divided by comma (e.g. "1,2,5")
    -   `params.text` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Search query
    -   `params.aggregations` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** aggregations array of tags id divided by comma
    -   `params.fields` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.
    -   `params.conditions` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** find all disputes with given conditions urlEncode(JSON).
    -   `params.sort` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** defines on which fields to sort (e.g. ?sort=id,-createdAt)
    -   `params.perPage` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** max items per one page (20 by default, 50 is max size)
    -   `params.page` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** page number to view
    -   `params.departmentId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Id
    -   `params.departmentNickname` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Nickname
    -   `params.departmentEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Department Email
    -   `params.creatorId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Id
    -   `params.creatorNickname` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Nickname
    -   `params.creatorEmail` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** User Creator Email

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesMe({
    id: 123,
    fields: 'creator,
  });
})();
```

### getPostsById

Posts for ticket or dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** List of fields for return. Add creator, department, operators for show additional info.
    -   `params.page` **Integer** page of posts
    -   `params.perPage` **Integer** per-page to count of 1 page
    -   `params.sort` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** sort posts

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getPostsById({
    id: 123,
    fields: 'creator,
  });
})();
```

### agentStartWatchDispute

Start watch dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.agentStartWatchDispute({
    id: 123,
  });
})();
```

### agentStopWatchDispute

Stop watch dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.agentStopWatchDispute({
    id: 123,
  });
})();
```

### addNoteToDispute

Create new post to dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.contents` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Content of disputes note
    -   `params.expand` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** expand of disputes note
    -   `params.type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 1 - author, 2 - agent
    -   `params.userId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** users id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.addNoteToDispute({
    id: 123,
    state: 12,
  });
})();
```

### removeNoteFromDispute

Create new post to dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.noteId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** notes id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.removeNoteFromDispute({
    id: 123,
    state: 12,
  });
})();
```

### addTagsToDispute

Add new tags to dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.tags` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** disputes tags

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.addTagsToDispute({
    id: 123,
    state: 12,
  });
})();
```

### removeTagsFromDispute

Remove tags from dispute

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** disputes id
    -   `params.tags` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** disputes tags

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.removeTagsFromDispute({
    id: 123,
    state: 12,
  });
})();
```

### getCustomerSupportStatistics

Get customer support statistics

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.authorId` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** author id

#### Examples

```javascript
(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v2/', token);
  const request = await service.getCustomerSupportStatistics({
    authorId: '1519369,
  });
})();
```

## defaultAutoTrim

Object with class service messages

Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)