Skip to main content

Activity API

The Activity API manages comments and worklogs in Deepser. Activities are always linked to a parent entity through a model_alias and model_id pair, and can be accessed by all user roles. This section covers every available endpoint.

Activity entities are supported for the following models:

Model NameModel Alias
Operationdeep_service/operation
Accountdeep_crm/account
Devicedeep_asset/device
Quotedeep_sales/quote
Contractdeep_contract/contract
CIdeep_cmdb/ci

Retrieve a Single Activity

HTTP Method: GET

URL:


http://deepserhost/api/rest/activity/activity/[activity_id]?model_alias=[model_alias]&id=[model_id]

Required parameters:

  • activity_id (path) -- the ID of the activity to retrieve.
  • model_alias (query) -- the model the activity belongs to.
  • model_id (query) -- the ID of the parent model record.

Example request:


http://deepserhost/api/rest/activity/activity/234?model_alias=deep_service/operation&id=196


Example response:


{
"entity_id": 129,
"type": 1,
"description": null,
"portal_visibility": 0,
"frontend_visibility": 0,
"started_at": null,
"ended_at": null,
"duration": null,
"contract_id": 0,
"contract_line_id": 0,
"contract_line_qty": "0.0000",
"created_by": "admin",
"model_alias": "deep_service/operation",
"model_id": 90,
"status": null,
"formtemplate_id": 0,
"disable_routing": 0,
"updated_at": "2023-07-05 08:55:49",
"created_at": "2023-07-05 08:55:49"
}


Update an Activity

HTTP Method: PUT

URL:


http://deepserhost/api/rest/activity/activity/[activity_id]?model_alias=[model_alias]&id=[model_id]


Required parameters:

  • activity_id (path) -- the ID of the activity to update.
  • model_alias (query) -- the model the activity belongs to.
  • model_id (query) -- the ID of the parent model record.

Example request:


http://deepserhost/api/rest/activity/activity/234?model_alias=deep_service/operation&id=196


Example request body:


{
"description": "Test Description"
}



warning

Ensure that the JSON keys match the field codes of the entity. Unrecognized keys are silently ignored and the corresponding fields are not updated.

Example response:


{
"entity_id": 128,
"type": 2,
"description": "Test Description",
"portal_visibility": 0,
"frontend_visibility": 0,
"started_at": "2023-02-07 11:15:00",
"ended_at": "2023-02-07 12:30:00",
"duration": 4500,
"contract_id": 1,
"contract_line_id": 1,
"contract_line_qty": "0.0000",
"created_by": "demo.key.user",
"model_alias": "deep_service/operation",
"model_id": 90,
"status": 1,
"formtemplate_id": 45,
"disable_routing": 0,
"updated_at": "2023-07-05 08:28:45",
"created_at": "2023-02-07 11:34:00"
}



Create an Activity

HTTP Method: POST

URL:


http://deepserhost/api/rest/activity/activities?model_alias=[model_alias]&id=[model_id]


Required parameters:

  • model_alias (query) -- the model the activity belongs to.
  • model_id (query) -- the ID of the parent model record.

Example request:


http://deepserhost/api/rest/activity/activities?model_alias=deep_service/operation&id=196


Example request body:


{
"type": 1,
"description": "Test Description",
"portal_visibility": 0,
"frontend_visibility": 0
}



warning

Ensure that the JSON keys match the field codes of the entity. Only matching fields are populated; unrecognized keys are ignored.

Example response:


{
"type": 1,
"descritpion": "Test Description",
"portal_visibility": 0,
"frontend_visibility": 0,
"model_alias": "deep_service/operation",
"model_id": 90,
"created_by": "admin",
"created_at": "2023-07-05 09:00:30",
"updated_at": "2023-07-05 09:00:30",
"entity_id": 130
}



Delete an Activity

HTTP Method: DELETE

URL:


http://deepserhost/api/rest/activity/activity/234?model_alias=deep_service/operation&id=196


Required parameters:

  • activity_id (path) -- the ID of the activity to delete.
  • model_alias (query) -- the model the activity belongs to.
  • model_id (query) -- the ID of the parent model record.

Example request:


http://deepserhost/api/rest/activity/activities?model_alias=deep_service/operation&id=196


This method returns an empty response on success.

Retrieve Multiple Activities

HTTP Method: GET

URL:


http://deepserhost/api/rest/activity/activities/?model_alias=[model_alias]&id=[model_id]


Required parameters:

  • model_alias (query) -- the model the activities belong to.
  • model_id (query) -- the ID of the parent model record.

Example request:


http://deepserhost/api/rest/activity/activities/?model_alias=deep_service/operation&id=196


Example response:


{
"totalRecords": 7,
"items": [
{
"entity_id": 124,
"type": 1,
"description": "

Dear user, I kindly ask you to give us a date to get your computer.
The technician is available tomorrow at 2 pm or the day after tomorrow at 3 pm.

Thank you.

",
"portal_visibility": 1,
"frontend_visibility": 0,
"started_at": null,
"ended_at": null,
"duration": null,
"contract_id": 0,
"contract_line_id": 0,
"contract_line_qty": "0.0000",
"created_by": "admin.demo",
"model_alias": "deep_service/operation",
"model_id": 90,
"status": null,
"formtemplate_id": 44,
"disable_routing": 0,
"updated_at": "2023-02-07 10:41:35",
"created_at": "2023-02-07 10:41:35",
"create_by_data": {
"username": "admin.demo",
"display_username": "DEMO ADMIN",
"avatar_url": "https://deepserhost/media/user/image/default/12.png"
},
"created_at_date": "7/2/2023 10:41 AM"
},
{
"entity_id": 125,
"type": 1,
"description": "

I prefer tomorrow at 2PM.

\r\n

Thank you.

",
"portal_visibility": 1,
"frontend_visibility": 0,
"started_at": null,
"ended_at": null,
"duration": null,
"contract_id": 0,
"contract_line_id": 0,
"contract_line_qty": "0.0000",
"created_by": "user",
"model_alias": "deep_service/operation",
"model_id": 90,
"status": null,
"formtemplate_id": 44,
"disable_routing": 0,
"updated_at": "2023-02-07 10:43:14",
"created_at": "2023-02-07 10:43:14",
"create_by_data": {
"username": "user",
"display_username": "Demo User",
"avatar_url": "https://deepserhost/media/user/image/default/9.png"
},
"created_at_date": "7/2/2023 10:43 AM"
}
]
}