Skip to content

Commit

Permalink
Merge pull request #205 from zammad/private/rs/sla
Browse files Browse the repository at this point in the history
Add rest api documentation for slas endpoint.
  • Loading branch information
MrGeneration committed Nov 10, 2021
2 parents d0816bc + b5a0ffd commit 98933e8
Show file tree
Hide file tree
Showing 2 changed files with 199 additions and 0 deletions.
198 changes: 198 additions & 0 deletions api/sla.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
Service-Level Agreements (SLA)
******************************

List
====

Required permission: ``admin.sla``

``GET``-Request sent: ``/api/v1/slas``

Response:

.. code-block:: json
:force:
# HTTP-Code 200 Ok
[
{
"id":2,
"calendar_id":1,
"name":"new sla",
"first_response_time":120,
"response_time":null,
"update_time":120,
"solution_time":120,
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"updated_by_id":3,
"created_by_id":3,
"created_at":"2021-11-10T12:54:39.368Z",
"updated_at":"2021-11-10T12:54:39.368Z"
}
]
Show
====

Required permission: ``admin.sla``

``GET``-Request sent: ``/api/v1/slas/{id}``

Response:

.. code-block:: json
:force:
# HTTP-Code 200 Ok
{
"id":2,
"calendar_id":1,
"name":"new sla",
"first_response_time":120,
"response_time":null,
"update_time":120,
"solution_time":120,
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"updated_by_id":3,
"created_by_id":3,
"created_at":"2021-11-10T12:54:39.368Z",
"updated_at":"2021-11-10T12:54:39.368Z"
}
Create
======

Required permission: ``admin.sla``

``POST``-Request sent: ``/api/v1/slas``

.. code-block:: json
{
"name":"new sla",
"first_response_time":"120",
"response_time":"",
"update_time":"120",
"solution_time":"120",
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"calendar_id":"1",
}
Response:

.. code-block:: json
:force:
# HTTP-Code 201 Created
{
"id":2,
"calendar_id":1,
"name":"new sla",
"first_response_time":120,
"response_time":null,
"update_time":120,
"solution_time":120,
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"updated_by_id":3,
"created_by_id":3,
"created_at":"2021-11-10T12:54:39.368Z",
"updated_at":"2021-11-10T12:54:39.368Z"
}
Update
======

Required permission: ``admin.sla``

``PUT``-Request sent: ``/api/v1/slas/{id}``

.. code-block:: json
{
"name":"update sla",
"first_response_time":"120",
"response_time":"",
"update_time":"120",
"solution_time":"120",
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"calendar_id":"1",
"id":2
}
Response:

.. code-block:: json
:force:
# HTTP-Code 200 Ok
{
"id":2,
"calendar_id":1,
"name":"update sla",
"first_response_time":120,
"response_time":null,
"update_time":120,
"solution_time":120,
"condition":{
"ticket.state_id":{
"operator":"is",
"value":"2"
}
},
"updated_by_id":3,
"created_by_id":3,
"created_at":"2021-11-10T12:54:39.368Z",
"updated_at":"2021-11-10T13:02:52.053Z"
}
Delete
======

Required permission: ``admin.sla``

.. danger:: **⚠ This is a permanent removal**

Please note that removing SLA configurations cannot be undone.

``DELETE``-Request sent: ``/api/v1/slas/{id}``

Response:

.. code-block:: json
:force:
# HTTP-Code 200 Ok
{}
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ The Zammad documentation consists of three parts:
/api/user
/api/organization
/api/group
/api/sla
/api/ticket
/api/notification
/api/object
Expand Down

0 comments on commit 98933e8

Please sign in to comment.