简体   繁体   中英

Create a task programmatically in RingCentral

I can create a post to Glip with the following code:

$AddPostHeader  =  @{'Content-Type'  =  'application/json';'Authorization'='Bearer ' + $token}
    $AddPostURL = 'https://platform.devtest.ringcentral.com/restapi/v1.0/glip/chats/' + $selectedGroup + '/posts'
    $AddPostBody = @{'type' = 'TextMessage'; 'text' = 'This post was written from Powershell'}
    $AddPostBody = ConvertTo-Json $AddPostBody

    $NewPost = Invoke-RestMethod -h $AddPostHeader -Body $AddPostBody $AddPostURL -Method 'POST'
    $AddPostURL
    $NewPost

But how can I create a Task?

This says I can: https://medium.com/ringcentral-developers/automating-team-productivity-with-glip-748a05aa32e9

I have referenced https://developers.ringcentral.com/api-reference without any luck? Is there an option 'type' for a post?

The API References now has a set of RingCentral Tasks APIs. The Create Tasks API is here:

A quick example of using this API using HTTP is as follows:

Required fields:

  • chatId (path)
  • subject (body) Task name
  • assignees (body) personId for assignee

Example Request:

POST https://platform.ringcentral.com/restapi/v1.0/glip/chats/{chatId}/tasks
Authorization: Bearer <myToken>
Content-Type: application/json

{
  "subject": "My New Task",
  "assignees": [{"id":"123"}]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM