Skip to main content

TasksService

A list of all methods in the TasksService service. Click on the method name to view detailed information about that method.

MethodsDescription
read_task_newReturns information about the specified task(s) by ID(s).
patch_task_newUpdates the specified task by ID.
delete_task_newDeletes the specified task.
complete_task_newCompletes a task in the specified chat.
list_chat_tasks_newReturns the list of tasks of the specified chat.
create_task_newCreates a task in the specified chat.

read_task_new

Returns information about the specified task(s) by ID(s).

  • HTTP Method: GET
  • Endpoint: /team-messaging/v1/tasks/{taskId}

Parameters

NameTypeRequiredDescription
task_idstrTask identifier or comma separated list of task IDs

Return Type

TmTaskInfo

Example Usage Code Snippet

from ring_central import RingCentral, Environment

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.tasks.read_task_new(task_id="taskId")

print(result)

patch_task_new

Updates the specified task by ID.

  • HTTP Method: PATCH
  • Endpoint: /team-messaging/v1/tasks/{taskId}

Parameters

NameTypeRequiredDescription
request_bodyTmUpdateTaskRequestThe request body.
task_idstrInternal identifier of a task

Return Type

TmTaskList

Example Usage Code Snippet

from ring_central import RingCentral, Environment
from ring_central.models import TmUpdateTaskRequest

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

request_body = TmUpdateTaskRequest(
subject="subject",
assignees=[
{
"id_": "id"
}
],
completeness_condition="Simple",
start_date="startDate",
due_date="dueDate",
color="Black",
section="section",
description="description",
recurrence={
"schedule": "None",
"ending_condition": "None",
"ending_after": 4,
"ending_on": "endingOn"
},
attachments=[
{
"id_": "id",
"type_": "File"
}
]
)

result = sdk.tasks.patch_task_new(
request_body=request_body,
task_id="taskId"
)

print(result)

delete_task_new

Deletes the specified task.

  • HTTP Method: DELETE
  • Endpoint: /team-messaging/v1/tasks/{taskId}

Parameters

NameTypeRequiredDescription
task_idstrInternal identifier of a task

Example Usage Code Snippet

from ring_central import RingCentral, Environment

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.tasks.delete_task_new(task_id="taskId")

print(result)

complete_task_new

Completes a task in the specified chat.

  • HTTP Method: POST
  • Endpoint: /team-messaging/v1/tasks/{taskId}/complete

Parameters

NameTypeRequiredDescription
request_bodyTmCompleteTaskRequestThe request body.
task_idstrInternal identifier of a task

Example Usage Code Snippet

from ring_central import RingCentral, Environment
from ring_central.models import TmCompleteTaskRequest

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

request_body = TmCompleteTaskRequest(
status="Incomplete",
assignees=[
{
"id_": "id"
}
],
completeness_percentage=93
)

result = sdk.tasks.complete_task_new(
request_body=request_body,
task_id="taskId"
)

print(result)

list_chat_tasks_new

Returns the list of tasks of the specified chat.

  • HTTP Method: GET
  • Endpoint: /team-messaging/v1/chats/{chatId}/tasks

Parameters

NameTypeRequiredDescription
chat_idstrInternal identifier of a chat
creation_time_tostrThe end datetime for resulting records in ISO 8601 format including timezone, e.g. 2019-03-10T18:23:45Z
creation_time_fromstrThe start datetime for resulting records in ISO 8601 format including timezone, e.g. 2016-02-23T00:00:00
creator_idList[str]Internal identifier of a task creator
statusList[ListChatTasksNewStatus]Task execution status
assignment_statusAssignmentStatusTask assignment status
assignee_idList[str]Internal identifier of a task assignee
assignee_statusAssigneeStatusTask execution status by assignee(-s) specified in assigneeId
page_tokenstrToken of the current page. If token is omitted then the first page should be returned
record_countintNumber of records to be returned per screen

Return Type

TmTaskList

Example Usage Code Snippet

from ring_central import RingCentral, Environment
from ring_central.models import AssignmentStatus, AssigneeStatus

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)
creator_id=[
"creatorId"
]
status=[
"Pending"
]
assignee_id=[
"assigneeId"
]

result = sdk.tasks.list_chat_tasks_new(
chat_id="chatId",
creation_time_to="now",
creation_time_from="creationTimeFrom",
creator_id=creator_id,
status=status,
assignment_status="Unassigned",
assignee_id=assignee_id,
assignee_status="Pending",
page_token="pageToken",
record_count=30
)

print(result)

create_task_new

Creates a task in the specified chat.

  • HTTP Method: POST
  • Endpoint: /team-messaging/v1/chats/{chatId}/tasks

Parameters

NameTypeRequiredDescription
request_bodyTmCreateTaskRequestThe request body.
chat_idstrInternal identifier of a chat

Return Type

TmTaskInfo

Example Usage Code Snippet

from ring_central import RingCentral, Environment
from ring_central.models import TmCreateTaskRequest

sdk = RingCentral(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

request_body = TmCreateTaskRequest(
subject="subject",
assignees=[
{
"id_": "id"
}
],
completeness_condition="Simple",
start_date="startDate",
due_date="dueDate",
color="Black",
section="section",
description="description",
recurrence={
"schedule": "None",
"ending_condition": "None",
"ending_after": 4,
"ending_on": "endingOn"
},
attachments=[
{
"id_": "id",
"type_": "File"
}
]
)

result = sdk.tasks.create_task_new(
request_body=request_body,
chat_id="chatId"
)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →