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

Latest commit

 

History

History
97 lines (78 loc) · 2.69 KB

File metadata and controls

97 lines (78 loc) · 2.69 KB

Create SLA Policy

HTTP MethodURLRequires Auth
POSTapi/v1/livechat/slayes

{% hint style="info" %} Permission required: manage-livechat-sla {% endhint %}

Body Parameters

KeyExampleDescription
name*grandThe name of the SLA policy.
description*sla descriptionThe SLA description.
dueTimeInMinutes*4The SLA due time.

Example Call

curl --location 'http://localhost:3000/api/v1/livechat/sla' \
--header 'X-Auth-Token: q2zjkgQt_OmYaBY4nEp50-r7yUAqVIoAqgo0jjBIws5' \
--header 'X-User-Id: rYhzFRd2QZjNwAAXX' \
--header 'Content-Type: application/json' \
--data '{
    "name": "Optimum",
    "description": "OPtimum SLA",
    "dueTimeInMinutes": 4
}'

Example Response

Success

{
    "sla": {
        "name": "Optimum",
        "description": "Optimum SLA",
        "dueTimeInMinutes": 4,
        "_id": "641db89a7718f90c810429cc"
    },
    "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.
  • No Permission: This occurs when the authenticated user doesn't have manage-livechat-sla permission.
  • Invalid Parameter: Occurs when a required parameter is not passed.
  • Duplicate: When an SLA is created having the same name or dueTimeInMinutes as an existing SLA.

{% tabs %} {% tab title=" Authorization" %}

{
    "status": "error",
    "message": "You must be logged in to do this."
}

{% endtab %}

{% tab title="No Permission" %}

{
    "success": false,
    "error": "error-not-authorized"
}

{% endtab %}

{% tab title="Invalid Parameter" %}

{
    "success": false,
    "error": "must have required property 'name' [invalid-params]",
    "errorType": "invalid-params"
}

{% endtab %}

{% tab title="Duplicate" %}

{
    "success": false,
    "error": "error-duplicated-sla"
}

{% endtab %} {% endtabs %}

Change Log

Version Description
6.0.0 Added