Reputation: 478
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?
Upvotes: 1
Views: 174
Reputation: 16354
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 nameassignees
(body) personId
for assigneeExample 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"}]
}
Upvotes: 0