Create a new share

post/shares
Internal-Use Only

Creates a new share that has a system-generated ID.

Request Samples

1

Response Samples

1{
2 "type": "read",
3 "sharedWith": "testUser",
4 "sharedWithType": "user",
5 "sharedBy": "currentUser",
6 "resourceUri": "/files/files/4288b305-981f-4b8d-b440-0911eabe3faf",
7 "name": "test file",
8 "enabled": true,
9 "version": 3,
10 "links": [
11 {
12 "method": "GET",
13 "rel": "self",
14 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
15 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
16 "type": "application/vnd.sas.authorization.share"
17 },
18 {
19 "method": "PUT",
20 "rel": "update",
21 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
22 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
23 "type": "application/vnd.sas.authorization.share",
24 "responseType": "application/vnd.sas.authorization.share"
25 },
26 {
27 "method": "DELETE",
28 "rel": "delete",
29 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
30 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac"
31 }
32 ],
33 "id": "3288b305-981f-4b8d-b440-0911eabc3fac",
34 "modifiedTimestamp": "2016-08-27T04:09:42.150Z",
35 "createdTimestamp": "2016-08-27T04:09:42.150Z",
36 "createdBy": "currentUser",
37 "modifiedBy": "currentUser"
38}

Header Parameters

NameTypeRequiredDescription
Accept
string
false

Specifies the desired format of the returned share. Supported media types are: application/json application/vnd.sas.authorization.share+json

Content-Type
string
false

Specifies the format of the incoming share. Supported media types are: application/json application/vnd.sas.authorization.share+json

Request Body

The properties of the new share.

A share that does not have a known ID or sharedBy value. The share has not been saved or the ID is unavailable for some other reason. Compare with SavedShare.

NameTypeRequiredDescription
sharedWith
string
true

The principal name of the share recipient.

resourceUri
string
true

A relative URI that represents a resource. All shares must target a resource URI.

name
string
false

The user-friendly name of the shared resource.

sharedWithType
string
true

The type of principal to which the share applies.

Allowed values:
usergroupauthenticatedUserseveryoneguest
type
string
true

The level of access that the share provides.

Allowed values:
readreadEditreadSharereadEditShare
enabled
boolean
false

Flag indicating whether the current share is in effect or not.

Default:
true
version
integer<int32>
false

The version of the share representation. The current representation version is 2.

links
array [Link]
false

Zero or more links that are to related resources and actions.

Responses

StatusMeaningDescription
201CreatedA new share was created.HeadersSchema
400Bad RequestThe request was invalid. Returned if the specified share is invalid.