How to set Collaborators expiry date using API call
回答済みHi All,
I want to set expire date of the colloborator while adding colloboration on specific folder for a user using API call. So that on expiry date, the folder access should be disabled for the user.
But i am not able to find any option through which i can pass expiry_at value.
I have checked the below API description :
https://box-content.readme.io/reference#add-a-collaboration
There is no option available to set the expiry date using above API call. But as per the response, the expires_at is retrieved with null value.
Kindly suggest me possbile workaround through API.
-
Hi!
At this time, we don't allow modification of the expires_at parameter of collaborations through the API.
Depending on your use-case, you may be able to get away with leveraging shared links on the folder rather than collaborations and you can set the "unshared_at" date to automatically unshare the link on a certain date. You can add a shared link with expiration to a folder using a call similar to the below:
PUT /folders/folder_ID
-H Authorization Bearer [TOKEN]
-d {"shared_link": {"unshared_at": "DATE"}}^ returns the shared link along with additional information about it [https://box-content.readme.io/reference#create-a-shared-link-for-a-folder]
Alternatively, you could put logic into your application to maintain the collaborations by adding and removing them with calls on specific dates - but at this time, you cannot set the expires_at parameter using the API.
Hopefully that helps!
-Tony
-
I am too looking at changing the expires_at using the API. This answer seems to be from over an year ago, and wonder if something changed.
Looking at the API documentation, there is an expires_at property when updating a collaboration - https://docs.box.com/reference#edit-a-collaboration
I tried to use it, but the server consistently returns 500: Internal Server Error. Also, if I use it on its own, I get a validation error that a "role" is required.
サインインしてコメントを残してください。
コメント
3件のコメント