npm package: @one-view/pd-oneview-cs-chat-box-types
Description: backend for cs-chat-box 1vU plugin
Latest version: 0.0.23


FORMAT: 1A
VERSION: 1.0.0
HOST: https://api.pd-oneview.net/cs-chat-box

# pd-oneview-cs-chat-box

backend for cs-chat-box 1vU plugin





## get template list v2 [/v2/templates{?search,language,page,pageSize,orderCode,geid,expandPlaceholders}]
get list of general template

+ Parameters
    + search (string, required) - subset of words to search template label
    + language (Language, optional) - template language, supports multiple languages seperated by comma.
        + Default: `eng`
    + page (int32, optional) - page number
        + Default: 1
    + pageSize (int32, optional) - number of records per page
        + Default: 20
    + expandPlaceholders (boolean, optional) - flag to expand placeholder
    + geid (string, optional) - order global entity id
    + orderCode (string, optional) - order code id

+ Attributes (TemplateList)

### get template list v2 [GET]

+ Request

    + Headers

            Authorization: bearer token

+ Response 200 (application/json)
    + Attributes (TemplateList)

+ Response 400 (application/json)
    + Attributes (Error_400)

+ Response 403 (application/json)
    + Attributes (Error_403)

+ Response 404 (application/json)
    + Attributes (Error_404)

+ Response 500 (application/json)
    + Attributes (Error_500)

## get suggested template list [/v2/suggested-templates{?language,ticketId,orderCode,page,pageSize,geid,expandPlaceholders}]
get list of general template

+ Parameters
    + ticketId (string, required) - the ticket id
    + language (Language, optional) - template language.
        + Default: `eng`
    + orderCode (string, optional) - orders number of the ticket
    + page (int32, optional) - page number
        + Default: 1
    + pageSize (int32, optional) - number of records per page
        + Default: 20
    + expandPlaceholders (boolean, optional) - flag to expand placeholder
    + geid (string, optional) - order global entity id

+ Attributes (TemplateList)

### get suggested template [GET]

+ Request

    + Headers

            Authorization: bearer token

+ Response 200 (application/json)
    + Attributes (TemplateList)

+ Response 400 (application/json)
    + Attributes (Error_400)

+ Response 403 (application/json)
    + Attributes (Error_403)

+ Response 404 (application/json)
    + Attributes (Error_404)

+ Response 500 (application/json)
    + Attributes (Error_500)


# Data Structures

## int32 (number)
## int64 (number)

## `error_object` (object)
+ status (string) - HTTP status code for this problem, expressed as a string value
+ title (string) - short, human-readable unique summary of the problem (not localized)

## `Error` (object)
+ errors (array[error_object])

## `Error_401` (object)
+ errors (array)
    + error_object
        + `status`: `401` (string)
        + `title`: `not authorize` (string)

## `Error_404` (object)
+ errors (array)
    + error_object
        + `status`: `404` (string)
        + `title`: `not found` (string)

## `Error_403` (object)
+ errors (array)
    + error_object
        + `status`: `403` (string)
        + `title`: `forbidden` (string)

## `Error_400` (object)
+ errors (array)
    + error_object
        + `status`: `400` (string)
        + `title`: `bad request` (string)

## `Error_500` (object)
+ errors (array)
    + error_object
        + `status`: `500` (string)
        + `title`: `internal server error` (string)

## AgentInfo
+ id                : `f4b8f8e5-365a-4ed1-a122-0f4ba1afef44` (string, required) - agent id
+ name              : `somename` (string) - agent name
+ email             : `foobar@foodpanda.com` (string) - agent email
+ status            : `online` (string) - agent status
+ statusAlias       : `online` (string) - agent status alias
+ lastLoginTime     : `2012-12-11 08:52:31 +0000 UTC` (string) - time at which agent login last time
+ updatedAt         : `2012-12-11 08:52:31 +0000 UTC` (string) - time at which agent status updated
+ agentTimeInStatus : 1572499999 (int64) - duration of current agent status

## Room
+ accessKeys (object) - access keys
+ agentJwt          : `token` (string) - agent jwt
+ agentJwtID        : `token` (string) - agent jwt ID
+ id                : `id` (string) - chat room id
+ name              : `roomname` (string) - chat room name
+ subscriptionToken : `token` (string) - token for room subscription
+ status (RoomStatus) -  room status
+ entityId          : `FP_SG` (string) - global entity id

## MessageHistory
+ sort_id: 0 (int64) - message sort id
+ content: "event" (string) - message content
+ type: "event" (string) - message type
+ event: "join" (string) - message event
+ created_at: "2020-03-25T05:06:54.190Z" (timestamp) - time created
+ sender: "cust_name" (string) - message sender
+ access: "*" (string) - message access

## MessageHistories
+ data (array[MessageHistory], fixed-type)
+ count : 1 (int64) - number of messages

## TemplateList
+ list (array[Template]) - list of template

## Template
+ id (string, required) - id of text template
+ identifier (string, required) - identifier of text template can be username or ccr
+ label (string) - label of text template
+ template (string) - template in text

## TemplateTag
+ key (string, required) - key of tag
+ value (string) - value of tag

## Placeholders
+ list (array[Placeholder], required, fixed-typed) - list of placeholders

## Placeholder
+ key (string, required) - key of the placeholder
+ value (object, required) - value of the placeholder

## RoomStatus (enum)
+ `OPEN`
+ `CLOSED`

## TemplateType (enum)
+ `general-template`
+ `ccr-template`

## Language (enum)
+ `eng`
+ `cmn`
+ `tha`
+ `urd`
+ `mya`
+ `khm`
+ `lao`
+ `ben`
+ `jpn`
+ `msa`
+ `yue`

## Vertical (enum)
+ `restaurants`
+ `flowers`
+ `groceries`
+ `cosmetics`
+ `health_supplements`
+ `pharmacies`
+ `pets`
+ `drinks`
+ `cross_vertical`
+ `electronics`
+ `baby_supplies`
+ `furniture`
+ `bags_and_luggage`
+ `toys`
+ `optics`
+ `courier_business`
+ `shop`
+ `coffee`
+ `courier`
+ `cash`
+ `darkstores`