Aliases are shortcuts for long messages. By using aliases the agent does not need to enter, for instance, a long address of the company’s seat, while talking to a client. Instead, the agent can define the address alias and during the conversation (chat) the system will automatically swap the alias with the text assigned to it.

Downloading a list of aliases

All aliases can be downloaded using the API method [GET] aliases/index.

Sample query

 curl -H 'x-user-token=1234567890' -i https://app.ngchat.com/api/aliases/index

Sample server response

 {
 "status": 1,
 "aliases": [{
 "id": "9",
 "name": "dz",
 "text": "Dzi\u0119kujemy za rozmow\u0119",
 "domains": [{
 "address": "domain.com",
 "token": "eglwK",
 "uuid": "zvLkgOQRtw7qSGKgGuXTdtBUktx1Rf",
 "active_inactive": "1",
 "chatclient_id": "73",
 "visability": "1",
 "shops": null
 }]
 }, {
 "id": "14",
 "name": "Tomasz",
 "text": "Witamy na naszej stronie",
 "domains": [{
 "address": "domain.com",
 "token": "eglwK",
 "uuid": "zvLkgOQRtw7qSGKgGuXTdtBUktx1Rf",
 "active_inactive": "1",
 "chatclient_id": "73",
 "visability": "1",
 "shops": null
 }]
 }, {
 "id": "18",
 "name": "?",
 "text": "czy ma Pan jeszcze jakie\u015b pytania?",
 "domains": [{
 "address": "domain.com",
 "token": "eglwK",
 "uuid": "zvLkgOQRtw7qSGKgGuXTdtBUktx1Rf",
 "active_inactive": "1",
 "chatclient_id": "73",
 "visability": "1",
 "shops": null
 }]
 }]
}

Downloading an alias

A single alias can be downloaded using the API method [GET] aliases/getalias/:id.

Parameters:

  • id – alias id

Sample query

 curl -i https://app.ngchat.com/api/aliases/getalias/14

Sample server response

 { "status": 1,
 "id": "14",
 "name": "Tomasz",
 "text": "Witamy na naszej stronie",
 "domainsSelected": [{
 "address": "domain.com",
 "token": "eglwK",
 "uuid": "zvLkgOQRtw7qSGKgGuXTdtBUktx1Rf",
 "active_inactive": "1",
 "chatclient_id": "73",
 "visability": "1",
 "shops": null
 }]
}

Adding an alias

An alias can be added using the API method [POST] aliases/addalias.

Parameters:

  • name – alias name
  • text – the text which is to be assigned to the alias
  • domains – the ID of the domain to which the alias is to be assigned (typ: array)

Sample server response

 {"status":2,"content":"The alias has been added."}

Editing an alias

An alias can be edited using the API method [POST] alias/editalias.

Parameters:

     

    • id – alias ID
    • name – alias name
    • text – the text which is to be assigned to the alias
    • domains – the ID of the domain to which the alias is to be assigned (typ: array)

     

    Sample server response

     {"status":2,"content":"The alias has been updated"}

    Alias removal

    An alias can be removed using the API method [GET] aliases/delatealias/:id.

    Parameters:

    • id – Alias ID

    Sample query

     curl -i https://app.ngchat.com/api/aliases/deletealias/19

    Sample server response

     {"status":2,"content":"The alias has been deleted."}