@plasma-platform/service-tickets
v0.2.3
Published
Tickets Service API
Downloads
8
Readme
Full documentation
install:npm i @plasma-platform/service-discounts -S
Short documentation
Table of Contents
- TicketsService
- Parameters
- messages
- getChatRooms
- createExternalTicket
- getExternalTickets
- addEscalateToDispute
- refundDispute
- changeStateDispute
- createNewDispute
- createNewPostToDispute
- getDisputeInfoForAgent
- getDisputesInfoCreator
- getDisputesForAuthor
- getDisputesMe
- getPostsById
- agentStartWatchDispute
- agentStopWatchDispute
- addNoteToDispute
- removeNoteFromDispute
- addTagsToDispute
- removeTagsFromDispute
- getCustomerSupportStatistics
- defaultAutoTrim
TicketsService
Tickets Micro Service API
Parameters
url
string service url
messages
Object with class service messages
Type: Object
getChatRooms
Chats - Request chat rooms list of the department
Examples
To use
(async () => {
const TicketsService = new TicketsService(url);
const result = await TicketsService.getChatRooms();
})();
Returns Object array of posts
createExternalTicket
Create external ticket
Parameters
params
Objectparams.subject
String The value of the subject field for this ticketparams.comment
String Ticket commentparams.group
String Ticket group/departmentparams.userEmail
String The original recipient e-mail address of the ticketparams.userName
String The original recipient name of the ticketparams.tags
String Tags for ticketsparams.ticketFields
String Custom fields for the ticket. Must contain key value. Key stands for field namesparams.attachments
Array<Object>? Ticket attachments filesparams.userIp
String User IPparams.referrer
String Referer
String
String [].keyStorage] - Key Storage S3String
String [].fileName] - File NameString
String [].fileSize] - File SizeString
String [].fileType] - File mime-type
Examples
(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
Objectparams.subject
String The value of the subject field for this ticketparams.comment
String Ticket commentparams.group
String Ticket group/departmentparams.userEmail
String The original recipient e-mail address of the ticketparams.userName
String The original recipient name of the ticketparams.ticketFields
String Custom fields for the ticket. Must contain key value. Key stands for field namesparams.attachments
Array<Object>? Ticket attachments filesparams.userIp
String User IPparams.referrer
String Referer
String
String [].keyStorage] - Key Storage S3String
String [].fileName] - File NameString
String [].fileSize] - File SizeString
String [].fileType] - File mime-type
Examples
(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
ObjectString
String [].keyStorage] - Key Storage S3String
String [].fileName] - File NameString
String [].fileSize] - File SizeString
String [].fileType] - File mime-type
Examples
(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
Examples
(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
Examples
(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
ObjectString
String [].keyStorage] - Key Storage S3String
String [].fileName] - File NameString
String [].fileSize] - File SizeString
String [].fileType] - File mime-type
Examples
(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
ObjectString
String [].keyStorage] - Key Storage S3String
String [].fileName] - File NameString
String [].fileSize] - File SizeString
String [].fileType] - File mime-type
Examples
(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
Examples
(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
Examples
(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
Objectparams.expand
String expands divided by comma (e.g. "free,wp")params.tags
String array of tags id divided by comma (e.g. "free,wp")params.ids
String array of ids disputes divided by comma (e.g. "1,2,5")params.text
String Search queryparams.aggregations
String aggregations array of tags id divided by commaparams.fields
String List of fields for return. Add creator, department, operators for show additional info.params.conditions
String find all disputes with given conditions urlEncode(JSON).params.sort
String defines on which fields to sort (e.g. ?sort=id,-createdAt)params.perPage
String max items per one page (20 by default, 50 is max size)params.page
String page number to viewparams.departmentId
String Department Idparams.departmentNickname
String Department Nicknameparams.departmentEmail
String Department Emailparams.creatorId
String User Creator Idparams.creatorNickname
String User Creator Nicknameparams.creatorEmail
String User Creator Email
Examples
(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
Objectparams.expand
String expands divided by comma (e.g. "free,wp")params.tags
String array of tags id divided by comma (e.g. "free,wp")params.ids
String array of ids disputes divided by comma (e.g. "1,2,5")params.text
String Search queryparams.aggregations
String aggregations array of tags id divided by commaparams.fields
String List of fields for return. Add creator, department, operators for show additional info.params.conditions
String find all disputes with given conditions urlEncode(JSON).params.sort
String defines on which fields to sort (e.g. ?sort=id,-createdAt)params.perPage
String max items per one page (20 by default, 50 is max size)params.page
String page number to viewparams.departmentId
String Department Idparams.departmentNickname
String Department Nicknameparams.departmentEmail
String Department Emailparams.creatorId
String User Creator Idparams.creatorNickname
String User Creator Nicknameparams.creatorEmail
String User Creator Email
Examples
(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
Examples
(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
Examples
(async () => {
const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
const request = await service.agentStartWatchDispute({
id: 123,
});
})();
agentStopWatchDispute
Stop watch dispute
Parameters
Examples
(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
Examples
(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
Examples
(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
Examples
(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
Examples
(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
Examples
(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