D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

ItemSharing Resource

Manage item sharing.

PUT /items/{id}/share

Share an item with some users and set its access type.

Request Parameters
name type description
defaultAccessType form default access type
Possible values: READ_ONLY, WRITE_OWNER, WRITE_ALL, ADMINISTRATOR
users form set of users
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the item
Request Body
media type data type
multipart/form-data (custom)
Response Body
media type data type description
text/plain string id of the shared item

Example

Request
PUT /items/{id}/share
Content-Type: multipart/form-data
Accept: text/plain
Authorization: ...

--------boundaryString
Content-Disposition: form-data; name="users"

user1
--------boundaryString
Content-Disposition: form-data; name="users"

user2
--------boundaryString
Content-Disposition: form-data; name="defaultAccessType"

READ_ONLY
------boundaryString--

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: text/plain

                
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
                
              

PUT /items/{id}/unshare

Unshare an item with some users.

Request Parameters
name type description
users form set of users
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path id of the item
Request Body
media type data type
multipart/form-data (custom)
Response Body
media type data type description
text/plain string id of the unshared item

Example

Request
PUT /items/{id}/unshare
Content-Type: multipart/form-data
Accept: text/plain
Authorization: ...

--------boundaryString
Content-Disposition: form-data; name="users"

user1,user2,user3
--------boundaryString--

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: text/plain

                
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e