The action object

Attributes

  • _id
    string

    A unique Id for the assessment.

  • action_no
    string

    A unique number assigned to the action for easy reference.

  • assessment
    string

    The assessment the action relates to.

  • assigned_to
    string

    The user the action is assigned to.

  • care_enquiry
    string

    The care enquiry the action relates to.

  • comment
    string

    The comment the action relates to.

  • completed
    string

    The date/time the action was completed.

  • created
    string

    The date/time the assessment was created.

  • due
    string

    The date/time the action is due.

  • home_visit
    string

    The home visit the action relates to.

  • location
    string

    The Id of the location the action relates to (based on the subject of the action).

  • modified
    string

    The parent subject (if any) for the action, for example an action related to an assessment would have a parent subject referencing the related care enquiry.

  • notify_on_complete
    list of strings

    A list of of notification groups to notify when the action is marked as complete.

  • parent_subject
    string

    The care enquiry or service user the action relates to.

  • parent_subject_type
    string

    The subject type (if any) of the parent the action relates to; |('care_enquiry', 'service_user').

  • pin_to_calendar
    string

    The calender (if any) the action is pinned to (will appear on); location, user.

  • reminders
    list of hashs

    A list of reminders set for the action (at most 2).

  • service_users
    string

    The service user the action relates to.

  • subject_type
    string

    The subject type (if any) the action relates to; assessment, care_enquiry, comment, location, home_visit, service_user.

  • tag
    string

    A tag assigned to the action when created to help identify automatically generated actions (this is set by the application and cannot be set by a user or via the API).

  • task
    string

    A decription of the task to be performed for the action to be be completed.

  • urgent
    boolean

    Flag indicating if the action is urgent (urgent actions always appear at the top of a user's dashboard).

  • user_tags
    list of strings

    A list of action tags assigned to the action.

The action object
{
    "_id": "6724fbcb4f73a2cebf638856",
    "action_no": "1",
    "assessment": "6724fbca4f73a2cebf63857e",
    "assigned_to": "6724fbc74f73a2cebf637806",
    "care_enquiry": null,
    "comment": null,
    "completed": null,
    "created": "2024-11-01 16:03:23",
    "due": "2024-11-14 14:30:00",
    "home_visit": null,
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:23",
    "notify_on_complete": [],
    "parent_subject": "6724fbca4f73a2cebf638579",
    "parent_subject_type": "care_enquiry",
    "pin_to_calendar": null,
    "reminders": [],
    "service_users": null,
    "subject_type": "assessment",
    "tag": "care_enquiry__perform_assessment",
    "task": "Record outcome of assessment for the service user.",
    "urgent": false,
    "user_tags": []
}

Create an action

Parameters

  • assigned_to
    optional

    The Id of user the action should be assigned to.

  • care_enquiry
    optional

    The Id of the care enquiry the action relates to.

  • due
    required

    The date/time the action is due to be completed by.

  • notify_on_complete
    optional

    A list of Ids for notification groups to notify when the action is marked as complete.

  • pin_to_calendar
    optional
    • location
    • user
  • reminders_0-method
    optional
    • email
    • sms_or_whatsapp
    • voice
    • user_pref
  • reminders_0-offset_delta
    optional
    • 5
    • 10
    • 15
    • 30
    • 45
    • 60
  • reminders_0-offset_time_str
    optional
  • reminders_0-offset_type
    optional
    default none
    • none
    • delta
    • time
  • reminders_1-method
    optional
    • email
    • sms_or_whatsapp
    • voice
    • user_pref
  • reminders_1-offset_delta
    optional
    • 5
    • 10
    • 15
    • 30
    • 45
    • 60
  • reminders_1-offset_time_str
    optional
  • reminders_1-offset_type
    optional
    default none
    • none
    • delta
    • time
  • service_user
    optional

    The Id of the service user the action relates to.

  • task
    required

    A description of the task to complete.

  • urgent
    optional

    A flag indicating if the action is urgent.

  • user_tags
    optional

    A list of action tags (groups) Ids assigned to the action.

Response

Returns the action object created.

PUT
/v1/actions
var action = apiClient.Request(
    HttpMethod.Put,
    "actions",
    null,
    new MultDict()
        .Add("assigned_to", userId)
        .Add("care_enquiry", careEnquiryId),
        .Add("due", dueDateTime),
        .Add("reminders_0-offset_type", "delta"),
        .Add("reminders_0-offset_delta", 15),
        .Add("reminders_0-method", "email"),
        .Add(
            "task",
            "Call Bob to see if he has an update on his when his " +
            "father is leaving hospital."
        )
);
<?php

$action = $api_client->request(
    'PUT',
    'actions',
    NULL
    [
        'assigned_to'=>$user_id,
        'care_enquiry'=>$care_enquiry_id,
        'due'=>$due_date_time,
        'reminders_0-offset_type'=>'delta',
        'reminders_0-offset_delta'=>15,
        'reminders_0-method'=>'email',
        'task'=>'Call Bob to see if he has an update on his when his father is '
            . 'leaving hospital.'
    ]
);
action = api_client(
    'PUT',
    'actions',
    data={
        'assigned_to': user_id,
        'care_enquiry': care_enquiry_id,
        'due': due_date_time,
        'reminders_0-offset_type': 'delta',
        'reminders_0-offset_delta': 15,
        'reminders_0-method': 'email',
        'task': (
            'Call Bob to see if he has an update on his when his father is'
            'leaving hospital.'
        )
    }
)
action = api_client.request(
    'PUT',
    'actions',
    data: {
        'assigned_to' => user_id,
        'care_enquiry' => care_enquiry_id,
        'due' => due_date_time,
        'reminders_0-offset_type' => 'delta',
        'reminders_0-offset_delta' => 15,
        'reminders_0-method' => 'email',
        'task' => 'Call Bob to see if he has an update on his when his father ' +
            'is leaving hospital.'
    }
)
Response
{
    "_id": "6724fbd23cd2cde34170f2b1",
    "action_no": "8",
    "assigned_to": null,
    "care_enquiry": "6724fbd24f73a2cebf638f09",
    "completed": null,
    "created": "2024-11-01 16:03:30",
    "due": "2024-11-03 11:00:00",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:30",
    "notify_on_complete": [],
    "parent_subject": "6724fbd24f73a2cebf638f09",
    "pin_to_calendar": null,
    "reminders": [
        {
            "method": "email",
            "offset_delta": 15,
            "offset_time_str": null,
            "offset_type": "delta"
        }
    ],
    "subject_type": "care_enquiry",
    "task": "Call Bob to see if he has an update on his when his father isleaving hospital.",
    "urgent": false,
    "user_tags": []
}

List all actions

Return a list of actions.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-assigned_to
    optional

    A filter that accepts a list of user Ids and filters actions by the user they are assigned to.

  • filters-completed
    optional
    default unset

    A filter that allows assessments to be filtered by whether the assessment is completed.

    • unset
    • yes
    • no
  • filters-end_date
    optional

    A filter that accepts a date and filters actions to those due before or on the end date.

  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-parent_subject
    optional

    A filter that accepts a list of care enquiry and/or service user Ids and filters actions by the subject the actions are associated with.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; action_no, task.

  • filters-start_date
    optional

    A filter that accepts a date and filters actions to those due after or on the start date.

  • filters-urgent
    optional
    default unset

    A filter that allows actions to be filtered by whether the action is urgent.

    • unset
    • yes
    • no
  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • completed
    • due
    • modified

Response

Returns a page of actions.

GET
/v1/actions
var actions = apiClient.Request(
    HttpMethod.Get,
    "actions",
    new MultiValueDict()
        .Add("attributes", "action_no", "task")
        .Add("filters-q", "hair dressing")
    }
);
<?php

$actions = $api_client->request(
    'GET',
    'actions',
    [
        'attributes'=>['action_no', 'task'],
        'filters-q'=>'hair dressing'
    ]
);
actions = api_client(
    'GET',
    'actions',
    params={
        'attributes': ['action_no', 'task'],
        'filters-q': 'hair dressing'
    }
)
actions = api_client.request(
    'GET',
    'actions',
    params: {
        'attributes' => ['action_no', 'task'],
        'filters-q' => 'hair dressing'
    }
)
Response
{
    "item_count": 1,
    "items": [
        {
            "_id": "6724fbcb4f73a2cebf638858",
            "action_no": "2",
            "task": "Confirm costs of hair dressing appointment for Anna with her daughter."
        }
    ],
    "page": 1,
    "page_count": 1,
    "per_page": 10
}

Retrieve an action

Retreive an action object.

Response

Returns a comment object.

GET
/v1/actions/<action_id>
var action = apiClient.Request(HttpMethod.Get, $"actions/{actionId}")
<?php

$action = $api_client->request('GET', 'actions/' . $action_id);
action = api_client('GET', f'actions/{action_id}')
action = api_client.request('GET', "actions/#{action_id}")
Response
{
    "_id": "6724fbcb4f73a2cebf638856",
    "action_no": "1",
    "assessment": "6724fbca4f73a2cebf63857e",
    "assigned_to": "6724fbc74f73a2cebf637806",
    "care_enquiry": null,
    "comment": null,
    "completed": null,
    "created": "2024-11-01 16:03:23",
    "due": "2024-11-14 14:30:00",
    "home_visit": null,
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:23",
    "notify_on_complete": [],
    "parent_subject": "6724fbca4f73a2cebf638579",
    "parent_subject_type": "care_enquiry",
    "pin_to_calendar": null,
    "reminders": [],
    "service_users": null,
    "subject_type": "assessment",
    "tag": "care_enquiry__perform_assessment",
    "task": "Record outcome of assessment for the service user.",
    "urgent": false,
    "user_tags": []
}

Update an action

Parameters

  • assigned_to
    optional

    The Id of user the action should be assigned to.

  • due
    required

    The date/time the action is due to be completed by.

  • notify_on_complete
    optional

    A list of Ids for notification groups to notify when the action is marked as complete.

  • pin_to_calendar
    optional
    • location
    • user
  • reminders_0-method
    optional
    • email
    • sms_or_whatsapp
    • voice
    • user_pref
  • reminders_0-offset_delta
    optional
    • 5
    • 10
    • 15
    • 30
    • 45
    • 60
  • reminders_0-offset_time_str
    optional
  • reminders_0-offset_type
    optional
    default none
    • none
    • delta
    • time
  • reminders_1-method
    optional
    • email
    • sms_or_whatsapp
    • voice
    • user_pref
  • reminders_1-offset_delta
    optional
    • 5
    • 10
    • 15
    • 30
    • 45
    • 60
  • reminders_1-offset_time_str
    optional
  • reminders_1-offset_type
    optional
    default none
    • none
    • delta
    • time
  • task
    required

    A description of the task to complete.

  • urgent
    optional

    A flag indicating if the action is urgent.

  • user_tags
    optional

    A list of action tags (groups) Ids assigned to the action.

Response

Returns the action object updated.

PATCH
/v1/actions/<action_id>
var action = apiClient.Request(
    HttpMethod.Put,
    $"actions/{action_id}",
    null,
    new MultiValueDict()
        .Add(
            "task",
            "Check with Bob if he has a time his father will be " +
            "checking in on Friday."
        )
);
<?php

$comment = $api_client->request(
    'PATCH',
    'actions/' . action_id,
    NULL
    [
        'task'=>'Check with Bob if he has a time his father will be checking '
            . 'in on Friday.'
    ]
);
action = api_client(
    'PATCH',
    f'actions/{action_id}',
    data={
        'task': (
            'Check with Bob if he has a time his father will be checking '
            'in on Friday.'
        ),
        'urgent': True
    }
)
action = api_client.request(
    'PUT',
    "actions/#{action_id}",
    data: {
        'task'=>'Check with Bob if he has a time his father will be ' +
            'checking in on Friday.'
    }
)
Response
{
    "_id": "6724fbd34f73a2cebf638f17",
    "action_no": "12",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "care_enquiry": "6724fbd34f73a2cebf638f13",
    "completed": null,
    "created": "2024-11-01 16:03:31",
    "due": "2024-11-03 11:00:00",
    "modified": "2024-11-01 16:03:31",
    "notify_on_complete": [],
    "parent_subject": "6724fbd34f73a2cebf638f13",
    "pin_to_calendar": null,
    "reminders": [
        {
            "method": "email",
            "offset_delta": 15,
            "offset_time_str": null,
            "offset_type": "delta"
        }
    ],
    "subject_type": "care_enquiry",
    "task": "Check with Bob if he has a time his father will be checking in on Friday.",
    "urgent": true,
    "user_tags": []
}

Mark an action as complete

Response

Returns the action object completed.

PATCH
/v1/actions/<action_id>/complete
var actions = apiClient.Request(
    HttpMethod.Patch,
    $"actions/{actionId}/complete"
);
<?php

$action = $api_client->request(
    'PATCH',
    'actions/' . action_id . '/complete'
);
action = api_client(
    'PATCH',
    f'actions/{action_id}/complete'
)
actions = api_client.request(
    'PATCH',
    "actions/#{action_id}/complete"
)
Response
{
    "_id": "6724fbd24f73a2cebf638f07",
    "action_no": "6",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "care_enquiry": "6724fbd24f73a2cebf638f03",
    "completed": "2024-11-01 16:03:30",
    "created": "2024-11-01 16:03:30",
    "due": "2024-11-03 11:00:00",
    "modified": "2024-11-01 16:03:30",
    "notify_on_complete": [],
    "parent_subject": "6724fbd24f73a2cebf638f03",
    "reminders": [
        {
            "method": "email",
            "offset_delta": 15,
            "offset_type": "delta"
        }
    ],
    "subject_type": "care_enquiry",
    "task": "Call Bob to see if he has an update on his when his father isleaving hospital.",
    "urgent": false,
    "user_tags": []
}

Reopen a completed action

Response

Returns the action object reopened.

PATCH
/v1/actions/<action_id>/reopen
var actions = apiClient.Request(
    HttpMethod.Patch,
    $"actions/{actionId}/reopen"
);
<?php

$action = $api_client->request(
    'PATCH',
    'actions/' . action_id . '/reopen'
);
action = api_client(
    'PATCH',
    f'actions/{action_id}/reopen'
)
actions = api_client.request(
    'PATCH',
    "actions/#{action_id}/reopen"
)
Response
{
    "_id": "6724fbd34f73a2cebf638f11",
    "action_no": "10",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "care_enquiry": "6724fbd34f73a2cebf638f0d",
    "completed": null,
    "created": "2024-11-01 16:03:31",
    "due": "2024-11-03 11:00:00",
    "modified": "2024-11-01 16:03:31",
    "notify_on_complete": [],
    "parent_subject": "6724fbd34f73a2cebf638f0d",
    "reminders": [
        {
            "method": "email",
            "offset_delta": 15,
            "offset_type": "delta"
        }
    ],
    "subject_type": "care_enquiry",
    "task": "Call Bob to see if he has an update on his when his father isleaving hospital.",
    "urgent": false,
    "user_tags": []
}