Core Services
Annotations
Base URLs:
- https://example.com/annotations
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Annotations API allows users to associate annotations with resources that other decoupled API manage. An annotation augments a target resource, which is typically a column or table, with information that extends beyond its physical properties. This information might include categorization (such as email and address), role (such as categorical and primary key), or other descriptive information.
Usage Notes
Overview
The Annotations API manages annotations within the SAS environment. An annotation adds extra information to tables, columns, and other objects. This is information that extends beyond metadata. The service allows annotations to be managed independently from the services that manage the object.
Expected uses of this API include data preparation and data mining.
Each annotation can contain an array of members. Each member represents an object to which that annotation applies. Each member has only one annotation.
If an object has more than one annotation, the object is represented as two unique members, each owned by a different annotation. For example, a column "SN" can have two annotations: one named "Serial Number" and another named "Discrete". The Annotations API persists the "Serial Number" annotation with a member named "SN". The "Discrete" annotation has a unique member named "SN".
Terminology
Error Codes
This API uses the standard error response type, (media type 'application/vnd.sas.error'), to handle propagation of all error messages and codes to the user.
| HTTP Status Code | Error Code | Description |
|---|---|---|
| 400 | 16300 | The specified status code is not valid. |
| 400 | 16301 | A null body is not valid. |
| 400 | 16302 | An empty or null body is not valid. |
| 400 | 16307 | The specified annotation ID does not match any existing annotation ID. |
| 400 | 16308 | The specified value exceeds the maximum allowable length. |
| 400 | 16309 | The specified domain exceeds the maximum allowable length. |
| 400 | 16310 | The specified name exceeds the maximum allowable length. |
| 400 | 16311 | The specified description exceeds the maximum allowable length. |
| 400 | 16312 | The specified label exceeds the maximum allowable length. |
| 400 | 16313 | The specified object type exceeds the maximum allowable length. |
| 400 | 16314 | The specified domain and name combination already exist. |
| 400 | 16315 | The specified object URI exceeds the maximum allowable length. |
| 404 | 16303 | The member was not found for specified annotation ID. |
| 404 | 16304 | The annotation was not found for specified annotation ID. |
| 412 | 16306 | The Etag did not match the conditional PUT request. |
| 428 | 16305 | No required Etag exists for the specified conditional PUT. |
Operations
Root
Contains the operations for the root resource of this API.
Get a list of top-level links
Code samples
# You can also use wget
curl -X GET https://example.com/annotations/ \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/annotations/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/annotations/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/annotations/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links at the top-level collections that this API provides.
Example responses
200 Response
{
"links": [
{
"method": "GET",
"rel": "annotations",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The API link list is available. | api |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description |
Check API availability
Code samples
# You can also use wget
curl -X HEAD https://example.com/annotations/
fetch('https://example.com/annotations/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/annotations/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/annotations/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Checks whether the Annotations API is available.
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The API is available. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description |
Annotations
Contains the operations to support annotations.
Get all annotations
Code samples
# You can also use wget
curl -X GET https://example.com/annotations/annotations \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/annotations/annotations',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/annotations/annotations', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/annotations/annotations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /annotations
Returns a collection of annotations. Standard paging, filtering, and sorting options are provided.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer | false | The starting index of the first annotation in a page. The default is 0. |
| limit | query | integer | false | The maximum number of annotations to return in this page of results. The actual number of returned annotations might be less if the collection has been exhausted. The default is 10. |
| filter | query | string(filter-criteria) | false | The filtering criteria for returned annotations. |
| sortBy | query | string(sort-criteria) | false | The sort returned annotations. The only valid sorting option is the name field. Ascending is the default sort order on the name field. Here is a sample sort: |
| resourceUri | query | string | false | The resourceUri of the object from which annotations are to be retrieved. |
Example responses
200 Response
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations?start=0&limit=10",
"uri": "/annotations/annotations?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
}
],
"name": "annotations",
"accept": "application/vnd.sas.annotation",
"count": 1,
"items": [
{
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"name": "Annotation1",
"domain": "Domain1",
"description": "One annotation.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4"
}
]
}
],
"limit": 10,
"version": 2
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The collection of annotations is available. | annotationCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description |
Create an annotation
Code samples
# You can also use wget
curl -X POST https://example.com/annotations/annotations \
-H 'Content-Type: application/vnd.sas.annotation+json' \
-H 'Accept: application/vnd.sas.annotation+json'
const inputBody = '{
"domain": "string",
"name": "string",
"label": "string",
"description": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.annotation+json',
'Accept':'application/vnd.sas.annotation+json'
};
fetch('https://example.com/annotations/annotations',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.annotation+json',
'Accept': 'application/vnd.sas.annotation+json'
}
r = requests.post('https://example.com/annotations/annotations', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.annotation+json"},
"Accept": []string{"application/vnd.sas.annotation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/annotations/annotations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /annotations
Creates an annotation from the specified request.
Body parameter
{
"domain": "string",
"name": "string",
"label": "string",
"description": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | createAnnotation | true | The annotation to create. Valid fields are name, label, domain, and description. All other fields are ignored. |
Example responses
201 Response
{
"name": "My Annotation",
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"domain": "Domain1",
"label": "Label",
"description": "Gives context to one or more objects.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The annotation was successfully created. | annotation |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI was created for the new annotation. | |
| 201 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this object. | |
| 201 | Etag | string | A tag that identifies this revision of this object. |
Find annotations by resourceUris
Code samples
# You can also use wget
curl -X POST https://example.com/annotations/annotations#multi \
-H 'Content-Type: application/vnd.sas.selection+json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.selection+json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/annotations/annotations#multi',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.selection+json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.post('https://example.com/annotations/annotations#multi', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.selection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/annotations/annotations#multi", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /annotations#multi
Find all annotations that are associated with the provided resourceUris. Returns an application/vnd.sas.collection of application/vnd.sas.annotation objects.
Body parameter
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | selection | true | Selects resourceUris for which associated annotations are to be found. |
Example responses
200 Response
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations?start=0&limit=10",
"uri": "/annotations/annotations?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
}
],
"name": "annotations",
"accept": "application/vnd.sas.annotation",
"count": 1,
"items": [
{
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"name": "Annotation1",
"domain": "Domain1",
"description": "One annotation.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4"
}
]
}
],
"limit": 10,
"version": 2
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | annotationCollection |
| 400 | Bad Request | The request was invalid. This can occur when no matching annotations are found or when the user provides an invalid limit, start, sortBy, or filter. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description |
Get an annotation
Code samples
# You can also use wget
curl -X GET https://example.com/annotations/annotations/{annotationId} \
-H 'Accept: application/vnd.sas.annotation+json'
const headers = {
'Accept':'application/vnd.sas.annotation+json'
};
fetch('https://example.com/annotations/annotations/{annotationId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.annotation+json'
}
r = requests.get('https://example.com/annotations/annotations/{annotationId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.annotation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/annotations/annotations/{annotationId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /annotations/{annotationId}
Returns information about a single annotation that is based on its unique ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
Example responses
200 Response
{
"name": "My Annotation",
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"domain": "Domain1",
"label": "Label",
"description": "Gives context to one or more objects.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation exists. | annotation |
| 404 | Not Found | The specified annotation does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this annotation. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Check annotation availability
Code samples
# You can also use wget
curl -X HEAD https://example.com/annotations/annotations/{annotationId} \
-H 'If-Match: string'
const headers = {
'If-Match':'string'
};
fetch('https://example.com/annotations/annotations/{annotationId}',
{
method: 'HEAD',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'If-Match': 'string'
}
r = requests.head('https://example.com/annotations/annotations/{annotationId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/annotations/annotations/{annotationId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /annotations/{annotationId}
Returns header information and verifies that the annotation exists.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| If-Match | header | string | false | The value of the ETag that was returned from a GET or previous PUT of this type. This header is optional, but if provided, this MUST match exactly the current value of the etag of the object. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation exists. | None |
| 404 | Not Found | The annotation does not exist. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this annotation. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Update or replace an existing annotation
Code samples
# You can also use wget
curl -X PUT https://example.com/annotations/annotations/{annotationId} \
-H 'Content-Type: application/vnd.sas.annotation+json' \
-H 'Accept: application/vnd.sas.annotation+json' \
-H 'If-Match: string'
const inputBody = '{
"version": 0,
"id": "string",
"domain": "string",
"name": "string",
"label": "string",
"description": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.annotation+json',
'Accept':'application/vnd.sas.annotation+json',
'If-Match':'string'
};
fetch('https://example.com/annotations/annotations/{annotationId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.annotation+json',
'Accept': 'application/vnd.sas.annotation+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/annotations/annotations/{annotationId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.annotation+json"},
"Accept": []string{"application/vnd.sas.annotation+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/annotations/annotations/{annotationId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /annotations/{annotationId}
Updates an existing annotation with a full replacement of the resource. This operation cannot modify the ID field.
Body parameter
{
"version": 0,
"id": "string",
"domain": "string",
"name": "string",
"label": "string",
"description": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| If-Match | header | string | false | The Etag that was returned from a GET, POST, or PUT of this annotation. |
| body | body | updateAnnotation | true | The annotation to update. |
Example responses
200 Response
{
"name": "My Annotation",
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"domain": "Domain1",
"label": "Label",
"description": "Gives context to one or more objects.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation was updated. | annotation |
| 400 | Bad Request | The request was invalid. | error2 |
| 412 | Precondition Failed | The specified Etag does not match the current version of the object or the last modified date. | error2 |
| 415 | Unsupported Media Type | The specified media type is not supported. | error2 |
| 428 | Precondition Required | The Etag was not specified during update of an existing type. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this annotation. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Delete an annotation
Code samples
# You can also use wget
curl -X DELETE https://example.com/annotations/annotations/{annotationId} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/annotations/annotations/{annotationId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.delete('https://example.com/annotations/annotations/{annotationId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/annotations/annotations/{annotationId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /annotations/{annotationId}
Deletes the specified annotation. The annotation and its members are permanently removed from the service.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
Example responses
404 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The annotation was deleted. | None |
| 404 | Not Found | The annotation does not exist. | error2 |
Members
Contains the operations to support members.
Get member objects for an annotation
Code samples
# You can also use wget
curl -X GET https://example.com/annotations/annotations/{annotationId}/members \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/annotations/annotations/{annotationId}/members', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/annotations/annotations/{annotationId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /annotations/{annotationId}/members
Returns the member objects for an annotation. A member is an external object that uses this annotation.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| start | query | integer | false | The starting index of the first annotation in a page. The default is 0. |
| limit | query | integer | false | The maximum number of members to return in this page of results. The actual number of returned members might be less if the collection has been exhausted. The default is 30. |
| filter | query | string(filter-criteria) | false | The filtering criteria for returned members. |
| sortBy | query | string(sort-criteria) | false | The sort returned members. The sorting criteria supports the name and descriptions fields in either ascending or descending order. |
Example responses
200 Response
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
],
"name": "members",
"accept": "application/vnd.sas.annotation.member",
"start": 0,
"count": 1,
"items": [
{
"creationTimeStamp": "2018-03-26T20:11:17.132Z",
"modifiedTimeStamp": "2018-03-26T20:11:17.132Z",
"createdBy": "sasboot",
"modifiedBy": "sasboot",
"version": 1,
"id": "a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"annotationId": "26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"resourceType": "table",
"resourceUri": "objects/b673660283/96764860d",
"value": "objectValue",
"links": [
{
"method": "GET",
"rel": "annotation",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"type": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42"
},
{
"method": "GET",
"rel": "up",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
]
}
],
"limit": 10,
"version": 2
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation schema was retrieved. | memberCollection |
| 404 | Not Found | The specified annotation ID does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description | |
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Create an annotation member
Code samples
# You can also use wget
curl -X POST https://example.com/annotations/annotations/{annotationId}/members \
-H 'Content-Type: application/vnd.sas.annotation.member+json' \
-H 'Accept: application/vnd.sas.annotation.member+json'
const inputBody = '{
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.annotation.member+json',
'Accept':'application/vnd.sas.annotation.member+json'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.annotation.member+json',
'Accept': 'application/vnd.sas.annotation.member+json'
}
r = requests.post('https://example.com/annotations/annotations/{annotationId}/members', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.annotation.member+json"},
"Accept": []string{"application/vnd.sas.annotation.member+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/annotations/annotations/{annotationId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /annotations/{annotationId}/members
Creates an annotation member from the provided request.
Body parameter
{
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| body | body | createMember | true | The member to create. Valid fields are annotationId, value, resourceType, and resourceUri. All other fields are ignored. |
Example responses
201 Response
{
"name": "A member",
"annotationId": "f9bd5124-418f-4326-86cf-b6d98d57778",
"id": "bd5124b7-318f-3326-97edf-cd79fe77758",
"resourceUri": "/objects/3989203-3867-1927-175d38a7421",
"resourceType": "column",
"value": "the member's value",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-21T17:12:01.846Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "create",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The annotation member was successfully created. | member |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The specified annotation does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI of the newly created annotation. | |
| 201 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this object. | |
| 201 | Etag | string | A tag that identifies this revision of this object. |
Get a member
Code samples
# You can also use wget
curl -X GET https://example.com/annotations/annotations/{annotationId}/members/{memberId} \
-H 'Accept: application/vnd.sas.annotation.member+json'
const headers = {
'Accept':'application/vnd.sas.annotation.member+json'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members/{memberId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.annotation.member+json'
}
r = requests.get('https://example.com/annotations/annotations/{annotationId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.annotation.member+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/annotations/annotations/{annotationId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /annotations/{annotationId}/members/{memberId}
Retrieves the member for the given annotation and member ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| memberId | path | string | true | The member ID to retrieve. |
Example responses
200 Response
{
"name": "A member",
"annotationId": "f9bd5124-418f-4326-86cf-b6d98d57778",
"id": "bd5124b7-318f-3326-97edf-cd79fe77758",
"resourceUri": "/objects/3989203-3867-1927-175d38a7421",
"resourceType": "column",
"value": "the member's value",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-21T17:12:01.846Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "create",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758"
}
]
}
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation member was retrieved. | member |
| 400 | Bad Request | The specified request was invalid for one of these reasons:
|
error2 |
| 404 | Not Found | The specified member does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this object. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Get headers verify that the member exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/annotations/annotations/{annotationId}/members/{memberId} \
-H 'Accept: */*' \
-H 'If-Match: string'
const headers = {
'Accept':'*/*',
'If-Match':'string'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members/{memberId}',
{
method: 'HEAD',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*',
'If-Match': 'string'
}
r = requests.head('https://example.com/annotations/annotations/{annotationId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/annotations/annotations/{annotationId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /annotations/{annotationId}/members/{memberId}
Returns header information and verifies that the member exists.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| memberId | path | string | true | The member ID. |
| If-Match | header | string | false | The value of the ETag that was returned from a GET or previous PUT of this type. This header is optional, but if provided, this MUST match exactly the current value of the etag of the object. |
Example responses
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation member exists. | None |
| 400 | Bad Request | The specified request was invalid for one of these reasons:
|
error2 |
| 404 | Not Found | The specified member does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this object. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Update or replace the member value
Code samples
# You can also use wget
curl -X PUT https://example.com/annotations/annotations/{annotationId}/members/{memberId} \
-H 'Content-Type: application/vnd.sas.annotation.member+json' \
-H 'Accept: application/vnd.sas.annotation.member+json' \
-H 'If-Match: string'
const inputBody = '{
"id": "string",
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.annotation.member+json',
'Accept':'application/vnd.sas.annotation.member+json',
'If-Match':'string'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members/{memberId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.annotation.member+json',
'Accept': 'application/vnd.sas.annotation.member+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/annotations/annotations/{annotationId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.annotation.member+json"},
"Accept": []string{"application/vnd.sas.annotation.member+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/annotations/annotations/{annotationId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /annotations/{annotationId}/members/{memberId}
Updates or replaces the member value for the given annotation and member ID.
Body parameter
{
"id": "string",
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| memberId | path | string | true | The member ID to update or replace. |
| If-Match | header | string | false | The Etag that was returned from a GET, POST, or PUT of this annotation. |
| body | body | updateMember | true | The member object. |
Example responses
200 Response
{
"name": "A member",
"annotationId": "f9bd5124-418f-4326-86cf-b6d98d57778",
"id": "bd5124b7-318f-3326-97edf-cd79fe77758",
"resourceUri": "/objects/3989203-3867-1927-175d38a7421",
"resourceType": "column",
"value": "the member's value",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-21T17:12:01.846Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "create",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The annotation member value was updated. | member |
| 400 | Bad Request | The specified request was invalid for one of these reasons:
|
error2 |
| 404 | Not Found | The specified member does not exist. | error2 |
| 412 | Precondition Failed | The specified Etag does not match the current version or the last modified date of the object. | error2 |
| 415 | Unsupported Media Type | The specified media type is not supported. | error2 |
| 428 | Precondition Required | The Etag was not specified during update of an existing type. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string that represents the timestamp of the last update to this object. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Delete a member
Code samples
# You can also use wget
curl -X DELETE https://example.com/annotations/annotations/{annotationId}/members/{memberId} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/annotations/annotations/{annotationId}/members/{memberId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.delete('https://example.com/annotations/annotations/{annotationId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/annotations/annotations/{annotationId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /annotations/{annotationId}/members/{memberId}
Deletes the member for the specified annotation and member ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| annotationId | path | string | true | The annotation ID. |
| memberId | path | string | true | The member ID to delete. |
Example responses
404 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The member was deleted. | None |
| 404 | Not Found | The specified annotation or member does not exist. | error2 |
Find annotation members by annotationIds
Code samples
# You can also use wget
curl -X POST https://example.com/annotations/members#multi \
-H 'Content-Type: application/vnd.sas.selection+json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.selection+json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/annotations/members#multi',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.selection+json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.post('https://example.com/annotations/members#multi', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.selection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/annotations/members#multi", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /members#multi
Find all members that are associated with the provided annotationIds. Returns an application/vnd.sas.collection of application/vnd.sas.annotation.member objects.
Body parameter
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | selection | true | Selects annotationIds for which associated members are to be found. |
Example responses
200 Response
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
],
"name": "members",
"accept": "application/vnd.sas.annotation.member",
"start": 0,
"count": 1,
"items": [
{
"creationTimeStamp": "2018-03-26T20:11:17.132Z",
"modifiedTimeStamp": "2018-03-26T20:11:17.132Z",
"createdBy": "sasboot",
"modifiedBy": "sasboot",
"version": 1,
"id": "a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"annotationId": "26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"resourceType": "table",
"resourceUri": "objects/b673660283/96764860d",
"value": "objectValue",
"links": [
{
"method": "GET",
"rel": "annotation",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"type": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42"
},
{
"method": "GET",
"rel": "up",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
]
}
],
"limit": 10,
"version": 2
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | memberCollection |
| 400 | Bad Request | The request was invalid. This can occur when no matching members are found or when the user provides an invalid limit, start, sortBy, or filter. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | No description |
Schemas
annotation
{
"name": "My Annotation",
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"domain": "Domain1",
"label": "Label",
"description": "Gives context to one or more objects.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778"
}
]
}
Annotation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | number | false | none | The version of the resource. |
| id | string | false | none | The unique ID, which the system assigns. |
| domain | string | false | none | The domain that is associated with the annotation. The domain and name comprise a unique key. |
| name | string | false | none | The name. The domain and name comprise a unique key. |
| label | string | false | none | The display label for the annotation. |
| description | string | false | none | The description. |
| createdBy | string | false | none | The user who created this annotation member. |
| modifiedBy | string | false | none | The last user to modify this annotation member. |
| creationTimeStamp | string | false | none | The formatted timestamp when the annotation member was created, shown in yyyy-mm-ddThh:mm:ssZ format. |
| modifiedTimeStamp | string | false | none | The formatted timestamp when the annotation member was last modified, shown in yyyy-mm-ddThh:mm:ssZ format. |
| links | [link] | false | none | Zero or more link objects. |
createAnnotation
{
"domain": "string",
"name": "string",
"label": "string",
"description": "string"
}
Create Annotation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| domain | string | false | none | The domain that is associated with the annotation. The domain and name comprise a unique key. |
| name | string | false | none | The name. The domain and name comprise a unique key. |
| label | string | false | none | The display label for the annotation. |
| description | string | false | none | The description of the annotation. |
updateAnnotation
{
"version": 0,
"id": "string",
"domain": "string",
"name": "string",
"label": "string",
"description": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}
Update Annotation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | number | false | none | The version of the resource. |
| id | string | false | none | The unique ID, which the system assigns. |
| domain | string | false | none | The domain that is associated with the annotation. The domain and name comprise a unique key. |
| name | string | false | none | The name. The domain and name comprise a unique key. |
| label | string | false | none | The display label for the annotation. |
| description | string | false | none | The description of the annotation. |
| createdBy | string | false | none | The user who created this annotation member. |
| modifiedBy | string | false | none | The last user to modify this annotation member. |
| creationTimeStamp | string | false | none | The formatted timestamp when the annotation member was created, shown in yyyy-mm-ddThh:mm:ssZ format. |
| modifiedTimeStamp | string | false | none | The formatted timestamp when the annotation member was last modified, shown in yyyy-mm-ddThh:mm:ssZ format. |
annotationCollection
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations?start=0&limit=10",
"uri": "/annotations/annotations?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
}
],
"name": "annotations",
"accept": "application/vnd.sas.annotation",
"count": 1,
"items": [
{
"id": "f9bd5124-418f-4326-86cf-b6d98d57778",
"name": "Annotation1",
"domain": "Domain1",
"description": "One annotation.",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-19T18:02:07.986Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"type": "application/vnd.sas.annotation"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4",
"uri": "/annotations/annotations/ccc0492f-7a0a-4481-8890-ca0b127c6ed4"
}
]
}
],
"limit": 10,
"version": 2
}
Annotation Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the collection "annotations" in the context of the request. |
| start | integer | false | none | The zero-based index of the result candidates to start returning. |
| limit | integer | false | none | The maximum number of results that were requested. |
| count | integer | false | none | The actual number of results that were returned in the collection. |
| accept | string | false | none | The accept header value that was used in the initial request. |
| links | [link] | false | none | The paging links that apply to this object. |
| items | [annotation] | false | none | The actual results of a query. |
| version | integer | false | none | The collection schema version. |
member
{
"name": "A member",
"annotationId": "f9bd5124-418f-4326-86cf-b6d98d57778",
"id": "bd5124b7-318f-3326-97edf-cd79fe77758",
"resourceUri": "/objects/3989203-3867-1927-175d38a7421",
"resourceType": "column",
"value": "the member's value",
"creationTimeStamp": "2016-12-19T18:02:07.986Z",
"modifiedTimeStamp": "2016-12-21T17:12:01.846Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "create",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758",
"uri": "/annotations/annotations/f9bd5124-418f-4326-86cf-b6d98d57778/members/bd5124b7-318f-3326-97edf-cd79fe77758"
}
]
}
Member
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | number | false | none | The version of the resource. |
| id | string | false | none | The unique ID, which the system assigns. |
| annotationId | string | false | none | The annotation ID that is associated with the member. |
| resourceUri | string | false | none | The URI of the object that is associated with the member. |
| resourceType | string | false | none | The object type that is associated with the member. |
| value | string | false | none | The member value. |
| createdBy | string | false | none | The user who created this annotation member. |
| modifiedBy | string | false | none | The last user to modify this annotation member. |
| creationTimeStamp | string | false | none | The formatted timestamp when the annotation member was created, shown in yyyy-mm-ddThh:mm:ssZ format. |
| modifiedTimeStamp | string | false | none | The formatted timestamp when the annotation member was last modified, shown in yyyy-mm-ddThh:mm:ssZ format. |
| links | [link] | false | none | Zero or more link objects. |
createMember
{
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string"
}
Create Member
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| annotationId | string | false | none | The annotation ID that is associated with the member. |
| resourceUri | string | false | none | The URI of the object that is associated with the member. |
| resourceType | string | false | none | The object type that is associated with the member. |
| value | string | false | none | The member value. |
updateMember
{
"id": "string",
"annotationId": "string",
"resourceUri": "string",
"resourceType": "string",
"value": "string",
"createdBy": "string",
"modifiedBy": "string",
"creationTimeStamp": "string",
"modifiedTimeStamp": "string"
}
Update Member
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string | false | none | The unique ID, which the system assigns. |
| annotationId | string | false | none | The annotation ID that is associated with the member. |
| resourceUri | string | false | none | The URI of the object that is associated with the member. |
| resourceType | string | false | none | The object type that is associated with the member. |
| value | string | false | none | The member value. |
| createdBy | string | false | none | The user who created this annotation member. |
| modifiedBy | string | false | none | The last user to modify this annotation member. |
| creationTimeStamp | string | false | none | The formatted timestamp when the annotation member was created, shown in yyyy-mm-ddThh:mm:ssZ format. |
| modifiedTimeStamp | string | false | none | The formatted timestamp when the annotation member was last modified, shown in yyyy-mm-ddThh:mm:ssZ format. |
memberCollection
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members?start=0&limit=10",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
],
"name": "members",
"accept": "application/vnd.sas.annotation.member",
"start": 0,
"count": 1,
"items": [
{
"creationTimeStamp": "2018-03-26T20:11:17.132Z",
"modifiedTimeStamp": "2018-03-26T20:11:17.132Z",
"createdBy": "sasboot",
"modifiedBy": "sasboot",
"version": 1,
"id": "a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"annotationId": "26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"resourceType": "table",
"resourceUri": "objects/b673660283/96764860d",
"value": "objectValue",
"links": [
{
"method": "GET",
"rel": "annotation",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca",
"type": "application/vnd.sas.annotation"
},
{
"method": "GET",
"rel": "self",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "PUT",
"rel": "update",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"type": "application/vnd.sas.annotation.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members/a7f35cb5-c72d-4fae-a5f3-af74f26cdf42"
},
{
"method": "GET",
"rel": "up",
"href": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"uri": "/annotations/annotations/26e2df43-aeaf-475d-a64e-7baafb8a4eca/members",
"type": "application/vnd.sas.annotation.member",
"responseType": "application/vnd.sas.annotation.member"
}
]
}
],
"limit": 10,
"version": 2
}
Member Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the collection "members" within the context of the request. |
| start | integer | false | none | The zero-based index of the result candidates to start returning. |
| limit | integer | false | none | The maximum number of results that were requested. |
| count | integer | false | none | The actual number of results that were returned in the collection. |
| accept | string | false | none | The accept header value that was used in the initial request. |
| links | [link] | false | none | The paging links that apply to this object. |
| items | [member] | false | none | The actual results of a query. |
| version | integer | false | none | The collection schema version. |
api
{
"links": [
{
"method": "GET",
"rel": "annotations",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "create",
"href": "/annotations/annotations",
"uri": "/annotations/annotations",
"type": "application/vnd.sas.annotation",
"responseType": "application/vnd.sas.annotation"
}
]
}
API
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| links | [link] | false | none | The API base links. |
error2
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | false | none | The message for the error. |
| id | string | false | none | The string ID for the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| errors | [error2] | false | none | Any additional errors that occurred. |
| links | [link] | false | none | The links that apply to the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
link
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
Link
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| method | string | false | none | The HTTP method for the link. |
| rel | string | true | none | The relationship of the link to the resource. |
| uri | string | false | none | The relative URI for the link. |
| href | string | false | none | The URL for the link. |
| title | string | false | none | The title for the link. |
| type | string | false | none | The media type or link type for the link. |
| itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
selection
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Selection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | true | none | The schema version number of this media type. This representation is version 1. |
| template | string(uri) | false | none | A URI template in which the {id} parameter can be replaced with a value from the "resources" array in order to yield the URI of the identified resource. |
| type | string | false | none | Specifies whether the resources array contains IDs, URIs, or both.
|
| resources | [string] | true | none | An array of resource IDs or URIs |
| links | [link] | false | none | An array of links to related resources and actions. |
Enumerated Values
| Property | Value |
|---|---|
| type | id |
| type | uri |
| type | mixed |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Authorization
Base URLs:
- https://example.com/authorization
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Manages authorization rules and makes authorization decisions.
Usage Notes
Overview
The Authorization API encapsulates all activities that affect access to system functions and resources.
Here is a summary of the functional scope of this API:
- This API enables authorized users to define access by creating and managing authorization rules and shares.
- This API enables any principal that has the Secure permission for a particular object to create and manage authorization rules that directly target that object.
- This API enables any principal that has the Secure permission for a particular object to share that object. If re-sharing is enabled, each share recipient can extend the access that they receive to other users and groups.
- This API enforces authorization rules by making authorization decisions. Each decision is evaluated for a specific authorization context. The decision process is transparent to end users.
- This API explains its authorization decisions by listing all of the rules and shares that contribute to each decision.
- This API does not manage access to CAS data (caslibs and tables) or CAS actions.
For background information, see General Authorization: Concepts.
Security
The Authorization API automatically protects any endpoints of any API that includes dependencies on it. This dependency intercepts calls to the endpoints and builds an authorization context, which is then sent to the Authorization API for evaluation. If the context is granted permission to perform the request action on that endpoint, it returns an HTTP status code of 200 and allows the request to proceed. If the context is prohibited, it returns an HTTP status code of 403 and the request does not continue further. This access is controlled by authorization rules that can be created through bootstrapping, by an administrative user, or by other methods.
Terminology
authorization
the process by which a set of principals is evaluated against defined rules and a requested action to determine whether the user can perform the action.
authorization context
information about an authorization request (for example, a target URI, the HTTP headers and verb, the requestor's group memberships, or the time of the request).
condition
a logical Spring Expression Language (SpEL) expression that evaluates to either true or false. A rule that includes a condition applies only when the condition is true. For example, you can use a condition to make a rule applicable to only to the creator of an object.
container
an object that logically contains the URI of one or more member objects. In parent-child relationship between objects, a container represents a parent.
decision
a yes or no answer to an authorization request to perform a particular action. Each authorization decision is based on a specific authorization context.
permission
a specific action that a rule affects (for example: read, update, delete, create, secure, add, or remove).
principal
an entity that represents an individual user or a group.
rule
an action or set of actions that is either permitted or prohibited for a given principal or set of principals. A rule can include a condition that limits the circumstances under which the rule applies.
share
a simplified abstraction of an authorization rule. Each share identifies a target object (resource), a recipient (principal), and a level of access (type). Each share is backed by a corresponding authorization rule. Shares can help users easily make resources available to each other.
Error Codes
| HTTP Status Code | Error Code | Description |
|---|---|---|
| 400 | 12600 | The patch 'test' operation failed. |
Operations
Rules
Contains operations that create and manage authorization rules.
Get authorization rules
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/rules \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'string'
};
fetch('https://example.com/authorization/rules',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'string'
}
r = requests.get('https://example.com/authorization/rules', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /rules
Retrieves some or all authorization rules, with or without paging.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer | false | The index number for the first rule in a page. default: 0 |
| limit | query | integer | false | The maximum number of rules to return per page. |
| filter | query | string(filter-criteria) | false | Constraints on which rules to retrieve. Here are the supported filters and criteria:
|
| sortBy | query | string(sort-criteria) | false | Instructions for sorting the retrieved rules. You can sort by name or description in ascending or descending order. |
| Accept-Item | header | string | false | If provided, returns the items in the requested format. Supported media types are:
|
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | savedAuthorizationRuleCollection |
| 400 | Bad Request | The request was invalid. Returned if any query criteria (sortBy, filter, limit, start) are invalid. | None |
Create a new authorization rule
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/rules \
-H 'Content-Type: application/vnd.sas.authorization.rule+json' \
-H 'Accept: application/vnd.sas.authorization.rule+json' \
-H 'Content-Type: string' \
-H 'Accept: string'
const inputBody = '{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.rule+json',
'Accept':'application/vnd.sas.authorization.rule+json',
'Content-Type':'string',
'Accept':'string'
};
fetch('https://example.com/authorization/rules',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.rule+json',
'Accept': 'application/vnd.sas.authorization.rule+json',
'Content-Type': 'string',
'Accept': 'string'
}
r = requests.post('https://example.com/authorization/rules', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.rule+json"},
"Accept": []string{"application/vnd.sas.authorization.rule+json"},
"Content-Type": []string{"string"},
"Accept": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /rules
Creates a new authorization rule that has a system-generated ID.
Body parameter
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Content-Type | header | string | false | Specifies the format of the incoming rule. Supported media types are:
|
| Accept | header | string | false | Specifies the desired format of the returned rule. Supported media types are:
|
| body | body | authorizationRule | true | The properties of the new rule. |
Example responses
201 Response
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A new authorization rule was created. | savedAuthorizationRule |
| 400 | Bad Request | The request was invalid. Returned if the specified authorization rule is invalid. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Content-Type | string | Type of returned content. | |
| 201 | Last-Modified | string | Timestamp of when rule was last modified. | |
| 201 | Location | string | Relative URI of the rule's path. | |
| 201 | ETag | string | The entity tag for the rule. |
Patch authorization rules
Code samples
# You can also use wget
curl -X PATCH https://example.com/authorization/rules \
-H 'Content-Type: application/json-patch+json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '[
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
]';
const headers = {
'Content-Type':'application/json-patch+json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/authorization/rules',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json-patch+json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.patch('https://example.com/authorization/rules', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json-patch+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/authorization/rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /rules
Performs a set of rule management actions as specified in a JSON patch. The actions are performed synchronously and transactionally. A resource collection of all created and revised rules is returned. If the patch is not successfully applied, changes are rolled back.
For every action, the patch must specify an operation (add, replace, remove, test, or copy) and a target URI (for example, /authorization/rules/{ruleId} or, to create a new rule, /authorization/rules). Each add and replace operation requires a valid rule representation. Each copy operation requires a 'from' URI that identifies the original rule.
You cannot save duplicate rules, so a patch that includes a copy operation must also include an operation that modifies or deletes either the original rule or the new rule.
You can combine operations to migrate existing rules. For example, you might copy a rule, then update the new rule (using the 'replace' operation), and then delete the original rule.
New rules that do not yet have known rule IDs are added to a zero-indexed ordered list. To reference such rules, use the substitution token @CREATED#@ (where '#' is the index of the target rule).
Body parameter
[
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | rulePatchOperation | true | JSON patch describing operations to perform and identifying the target rules. |
Example responses
200 Response
{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. Returned if the patch was applied successfully. | ruleJob |
| 400 | Bad Request | The request was invalid. Returned if the specified rule patch is invalid. | error2 |
| 422 | Unprocessable Entity | Returned if the patch request is syntactically valid but would result in a resource state that is inconsistent or invalid. | error2 |
Delete an authorization rule
Code samples
# You can also use wget
curl -X DELETE https://example.com/authorization/rules/{ruleId}
fetch('https://example.com/authorization/rules/{ruleId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/authorization/rules/{ruleId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/authorization/rules/{ruleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /rules/{ruleId}
Deletes a specified authorization rule.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ruleId | path | string | true | The ID of the rule to delete. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The authorization rule was deleted. | None |
| 404 | Not Found | No authorization rule with the specified ID was found. | None |
Get an authorization rule
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/rules/{ruleId} \
-H 'Accept: application/vnd.sas.authorization.rule+json'
const headers = {
'Accept':'application/vnd.sas.authorization.rule+json'
};
fetch('https://example.com/authorization/rules/{ruleId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.authorization.rule+json'
}
r = requests.get('https://example.com/authorization/rules/{ruleId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.authorization.rule+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/rules/{ruleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /rules/{ruleId}
Retrieves a specified authorization rule.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ruleId | path | string | true | The ID of the rule to retrieve. |
Example responses
200 Response
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | savedAuthorizationRule |
| 404 | Not Found | No authorization rule with the specified ID was found. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | Type of returned content. | |
| 200 | Last-Modified | string | Timestamp of when rule was last modified. | |
| 200 | Location | string | Relative URI of the rule's path. | |
| 200 | ETag | string | The entity tag for the rule. |
Update or create an authorization rule
Code samples
# You can also use wget
curl -X PUT https://example.com/authorization/rules/{ruleId} \
-H 'Content-Type: application/vnd.sas.authorization.rule+json' \
-H 'Accept: application/vnd.sas.authorization.rule+json' \
-H 'If-Match: string'
const inputBody = '{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.rule+json',
'Accept':'application/vnd.sas.authorization.rule+json',
'If-Match':'string'
};
fetch('https://example.com/authorization/rules/{ruleId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.rule+json',
'Accept': 'application/vnd.sas.authorization.rule+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/authorization/rules/{ruleId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.rule+json"},
"Accept": []string{"application/vnd.sas.authorization.rule+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/authorization/rules/{ruleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /rules/{ruleId}
Updates an authorization rule by completely replacing it with specified values. Or, if there is no rule that has the specified ID, creates a new rule using that ID.
Body parameter
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ruleId | path | string | true | The ID of the rule to update or create. |
| If-Match | header | string | true | The entity tag obtained from the most recent ETag response header. Must match the current entity tag for the rule. |
| body | body | identifiableAuthorizationRule | true | The properties of the rule. |
Example responses
200 Response
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The object was updated. | savedAuthorizationRule |
| 201 | Created | A new authorization rule was created. | savedAuthorizationRule |
| 400 | Bad Request | The request was invalid. Returned if the format of the request does not match the schema for the media type used. Also can be returned if the ID passed in the request payload does not match the ID in the URI. | None |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the rule. | |
| 201 | Location | string | Relative URI of the rule's path. | |
| 201 | ETag | string | The entity tag for the rule. |
Create a rule job
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/rules/jobs \
-H 'Content-Type: application/vnd.sas.authorization.rule.job+json' \
-H 'Accept: application/vnd.sas.authorization.rule.job+json' \
-H 'Accept: string' \
-H 'Content-Type: string'
const inputBody = '{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.rule.job+json',
'Accept':'application/vnd.sas.authorization.rule.job+json',
'Accept':'string',
'Content-Type':'string'
};
fetch('https://example.com/authorization/rules/jobs',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.rule.job+json',
'Accept': 'application/vnd.sas.authorization.rule.job+json',
'Accept': 'string',
'Content-Type': 'string'
}
r = requests.post('https://example.com/authorization/rules/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.rule.job+json"},
"Accept": []string{"application/vnd.sas.authorization.rule.job+json"},
"Accept": []string{"string"},
"Content-Type": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/rules/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /rules/jobs
Creates an asynchronous job that performs one or more rule management actions (such as creating, updating, and deleting authorization rules. Each update and delete action must specify the rule ID for an existing rule. All actions are performed in a single request. The request returns a vnd.sas.authorization.rule.job that contains a 'self' and 'ruleJobState' links that can be used to retrieve the entire job or to check the current state of the running job.
Body parameter
{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept | header | string | false | Specifies the desired format of the returned rule job. Supported media types are:
|
| Content-Type | header | string | false | Specifies the format of the incoming rule job. Supported media types are:
|
| body | body | ruleJob | true | Instructions to create, update, and delete specified rules. |
Example responses
202 Response
{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 202 | Accepted | Accepted. Returned if the rule job is created. | ruleJob |
| 400 | Bad Request | The request was invalid. Returned if the specified rule job is invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 202 | Location | string | Relative URI of the rule job's path. | |
| 202 | Content-Type | string | Content type of the returned object. |
Get information about a rule job
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/rules/jobs/{jobId} \
-H 'Accept: application/vnd.sas.authorization.rule.job+json'
const headers = {
'Accept':'application/vnd.sas.authorization.rule.job+json'
};
fetch('https://example.com/authorization/rules/jobs/{jobId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.authorization.rule.job+json'
}
r = requests.get('https://example.com/authorization/rules/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.authorization.rule.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/rules/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /rules/jobs/{jobId}
Retrieves descriptive information about a specified rule job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The ID of the rule job. |
Example responses
200 Response
{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The specified rule job exists. | ruleJob |
| 404 | Not Found | No rule job with the specified ID was found. | None |
Delete a rule job
Code samples
# You can also use wget
curl -X DELETE https://example.com/authorization/rules/jobs/{jobId}
fetch('https://example.com/authorization/rules/jobs/{jobId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/authorization/rules/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/authorization/rules/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /rules/jobs/{jobId}
Deletes a specified rule job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The ID of the rule job to delete. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The rule job was deleted. | None |
| 404 | Not Found | No rule job with the specified ID was found. | None |
Get the state of a rule job
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/rules/jobs/{jobId}/state \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/authorization/rules/jobs/{jobId}/state',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'text/plain'
}
r = requests.get('https://example.com/authorization/rules/jobs/{jobId}/state', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/plain"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/rules/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /rules/jobs/{jobId}/state
Retrieves status information for a specified rule job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The ID of the rule job. |
Example responses
200 Response
"pending"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The rule job with the specified ID exists. The value of the response is the state of the overall job: pending, running, completed, completedWithErrors, or failed. | string |
| 404 | Not Found | No rule job with the specified ID was found. | None |
Validate the syntax of a specified rule condition
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/commons/validations/conditions \
-H 'Content-Type: text/plain' \
-H 'Accept: application/vnd.sas.validation+json'
const inputBody = 'string';
const headers = {
'Content-Type':'text/plain',
'Accept':'application/vnd.sas.validation+json'
};
fetch('https://example.com/authorization/commons/validations/conditions',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'text/plain',
'Accept': 'application/vnd.sas.validation+json'
}
r = requests.post('https://example.com/authorization/commons/validations/conditions', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"text/plain"},
"Accept": []string{"application/vnd.sas.validation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/commons/validations/conditions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /commons/validations/conditions
Determines whether a client-supplied string is a properly formatted Spring Expression Language (SpEL) expression.
Body parameter
"string"
string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | string | true | The string that constitutes a rule condition. |
Example responses
200 Response
{
"version": 0,
"valid": true,
"error": {},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | validation |
| 400 | Bad Request | The request was invalid. | errorResponse |
Validate a new rule
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/commons/validations/rules \
-H 'Content-Type: application/vnd.sas.authorization.rule+json' \
-H 'Accept: application/vnd.sas.validation+json'
const inputBody = '{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.rule+json',
'Accept':'application/vnd.sas.validation+json'
};
fetch('https://example.com/authorization/commons/validations/rules',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.rule+json',
'Accept': 'application/vnd.sas.validation+json'
}
r = requests.post('https://example.com/authorization/commons/validations/rules', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.rule+json"},
"Accept": []string{"application/vnd.sas.validation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/commons/validations/rules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /commons/validations/rules
Determines whether a new authorization rule meets completeness and uniqueness requirements.
Body parameter
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | authorizationRule | true | The properties of the rule. |
Example responses
200 Response
{
"version": 0,
"valid": true,
"error": {},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | validation |
| 400 | Bad Request | The request was invalid. | errorResponse |
Validate an updated rule
Code samples
# You can also use wget
curl -X PUT https://example.com/authorization/commons/validations/rules/{ruleId} \
-H 'Content-Type: application/vnd.sas.authorization.rule+json' \
-H 'Accept: application/vnd.sas.validation+json' \
-H 'If-Match: string'
const inputBody = '{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.rule+json',
'Accept':'application/vnd.sas.validation+json',
'If-Match':'string'
};
fetch('https://example.com/authorization/commons/validations/rules/{ruleId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.rule+json',
'Accept': 'application/vnd.sas.validation+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/authorization/commons/validations/rules/{ruleId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.rule+json"},
"Accept": []string{"application/vnd.sas.validation+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/authorization/commons/validations/rules/{ruleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /commons/validations/rules/{ruleId}
Determines whether an updated authorization rule meets completeness and uniqueness requirements.
Body parameter
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ruleId | path | string | true | The ID of the updated rule. |
| If-Match | header | string | true | The entity tag obtained from the most recent ETag response header. Must match the current entity tag for the rule. |
| body | body | authorizationRule | true | The properties of the updated rule. |
Example responses
200 Response
{
"version": 0,
"valid": true,
"error": {},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | validation |
| 400 | Bad Request | The request was invalid. | errorResponse |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag. |
error2 |
Verify that a specified rule exists
Code samples
# You can also use wget
curl -X DELETE https://example.com/authorization/commons/validations/rules/{ruleId} \
-H 'Accept: application/vnd.sas.validation+json'
const headers = {
'Accept':'application/vnd.sas.validation+json'
};
fetch('https://example.com/authorization/commons/validations/rules/{ruleId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.validation+json'
}
r = requests.delete('https://example.com/authorization/commons/validations/rules/{ruleId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.validation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/authorization/commons/validations/rules/{ruleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /commons/validations/rules/{ruleId}
Determines whether a specified authorization rule exists.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ruleId | path | string | true | The ID of the rule. |
Example responses
200 Response
{
"version": 0,
"valid": true,
"error": {},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | validation |
| 400 | Bad Request | The request was invalid. | errorResponse |
Decisions
Contains operations that make and explain authorization decisions.
Obtain an authorization decision
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/decisions \
-H 'Content-Type: application/vnd.sas.authorization.context+json' \
-H 'Accept: application/vnd.sas.authorization.decision+json'
const inputBody = '{
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.context+json',
'Accept':'application/vnd.sas.authorization.decision+json'
};
fetch('https://example.com/authorization/decisions',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.context+json',
'Accept': 'application/vnd.sas.authorization.decision+json'
}
r = requests.post('https://example.com/authorization/decisions', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.context+json"},
"Accept": []string{"application/vnd.sas.authorization.decision+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/decisions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /decisions
Determines whether a specified principal is authorized to perform a specified action in a specified context. The response is either true (the action is authorized) or false (the action is not authorized).
Body parameter
{
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | authorizationContext | true | The requested action and contextual details. |
Example responses
200 Response
true
true
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Always returned if the request is successful and the request's Accept header is application/vnd.sas.authorization.direct.decision+json. However, if the Accept header is application/json or application/vnd.sas.authorization.direct.decision+json, 200 is returned only if the request is successful and the decision is true. |
boolean |
| 201 | Created | Always returned if the request is successful and the request's Accept header is text/plain | string |
| 400 | Bad Request | The request was invalid. Returned if the authorization context is invalid. | None |
| 403 | Forbidden | Returned if the request's Accept header is application/vnd.sas.authorization.decision+json or application/json and the request was completed successfully but the authorization decision is false. |
boolean |
Obtain authorization decisions with explanations
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/decisions#explanation \
-H 'Content-Type: application/vnd.sas.selection+json' \
-H 'Accept: application/vnd.sas.authorization.explanations+json'
const inputBody = '{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.selection+json',
'Accept':'application/vnd.sas.authorization.explanations+json'
};
fetch('https://example.com/authorization/decisions#explanation',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.selection+json',
'Accept': 'application/vnd.sas.authorization.explanations+json'
}
r = requests.post('https://example.com/authorization/decisions#explanation', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.selection+json"},
"Accept": []string{"application/vnd.sas.authorization.explanations+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/decisions#explanation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /decisions#explanation
Provides authorization information for specified principals in a specified context. Each explanation identifies the rules that are relevant to a particular authorization decision and includes details (such as parent containment) if applicable. By default, explanations are provided for only principals to whom relevant authorization rules are directly assigned.
Body parameter
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| additionalUser | query | array[string] | false | The ID of an additional user to include. You can specify this parameter multiple times. |
| additionalGroup | query | array[string] | false | The ID of an additional group to include. You can specify this parameter multiple times. |
| includeSystemAccounts | query | boolean | false | Whether to provide explanations for system accounts (such as sasapp and sas.ops-agentsrv). |
| contentType | query | string | false | String to match rules' contentType against. |
| acceptType | query | string | false | String to match rules' acceptType against. |
| acceptItemType | query | string | false | String to match rules' acceptItemType against. |
| includeShares | query | boolean | false | Whether to include explanations for shares. |
| body | body | object | true | The resources for which explanations are requested. Only 'uri' type selections (relative object URIs) are supported. |
Example responses
200 Response
"{'/foo/123': [... explanation array ...], '/bar/123': [... explanation array ...]}"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | explanations |
| 400 | Bad Request | The request was invalid. Returned if the format of the request does not match the schema for the media type used. | None |
Obtain predictive authorization decisions
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/decisions#hypotheticalExplanation \
-H 'Content-Type: application/vnd.sas.authorization.explanation.hypothetical+json' \
-H 'Accept: application/vnd.sas.authorization.explanations+json'
const inputBody = '{
"version": 0,
"patch": [
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
],
"uris": [
"string"
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.explanation.hypothetical+json',
'Accept':'application/vnd.sas.authorization.explanations+json'
};
fetch('https://example.com/authorization/decisions#hypotheticalExplanation',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.explanation.hypothetical+json',
'Accept': 'application/vnd.sas.authorization.explanations+json'
}
r = requests.post('https://example.com/authorization/decisions#hypotheticalExplanation', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.explanation.hypothetical+json"},
"Accept": []string{"application/vnd.sas.authorization.explanations+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/decisions#hypotheticalExplanation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /decisions#hypotheticalExplanation
Provides decisions and explanations that incorporate unsaved changes to authorization rules. A client enters an array of PATCH input that describes unsaved changes to authorization rules. The returned information is hypothetical in the sense that it reflects the effects of unsaved changes.
Body parameter
{
"version": 0,
"patch": [
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
],
"uris": [
"string"
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| additionalUser | query | array[string] | false | The ID of an additional user to include. You can specify this parameter multiple times. |
| additionalGroup | query | array[string] | false | The ID of an additional group to include. You can specify this parameter multiple times. |
| includeSystemAccounts | query | boolean | false | Whether to provide hypothetical explanations for system accounts (such as sasapp and sas.ops-agentsrv). |
| contentType | query | string | false | String to match rules' contentType against. |
| acceptType | query | string | false | String to match rules' acceptType against. |
| acceptItemType | query | string | false | String to match rules' acceptItemType against. |
| includeShares | query | boolean | false | Whether to include explanations for shares. |
| body | body | hypothetical | true | A hypothetical object that consists of one or more URIs and one or more new rules. |
Example responses
200 Response
"{'/foo/123': [... explanation array ...], '/bar/123': [... explanation array ...]}"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | explanations |
| 400 | Bad Request | The request was invalid. Returned if the format of the request does not match the schema for the media type used. | None |
Obtain multiple authorization decisions
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/decisions#bulk \
-H 'Content-Type: application/vnd.sas.authorization.bulk.context+json' \
-H 'Accept: application/vnd.sas.authorization.authorized.links+json'
const inputBody = '{
"bulkLinks": {
"add": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"create": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"delete": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"read": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"remove": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"secure": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"update": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.bulk.context+json',
'Accept':'application/vnd.sas.authorization.authorized.links+json'
};
fetch('https://example.com/authorization/decisions#bulk',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.bulk.context+json',
'Accept': 'application/vnd.sas.authorization.authorized.links+json'
}
r = requests.post('https://example.com/authorization/decisions#bulk', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.bulk.context+json"},
"Accept": []string{"application/vnd.sas.authorization.authorized.links+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/decisions#bulk", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /decisions#bulk
Determines which actions a specified principal is authorized to perform in a specified context. Each requested action is evaluated against its associated permission. Only authorized actions (links) are returned.
Body parameter
{
"bulkLinks": {
"add": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"create": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"delete": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"read": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"remove": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"secure": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"update": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | bulkAuthorizationContext | true | The requested actions and contextual details. Bulk information must be included as a map of permissions to arrays of links. |
Example responses
200 Response
{
"grantedLinks": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"prohibitedLinks": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | authorizedLinks |
| 400 | Bad Request | The request was invalid. Returned if no URIs are provided in the context to authorize. | None |
Metadata
Contains operations that provide information about this API.
Get list of links that this API supports
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/ \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/authorization/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/authorization/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Clients should use this top-level endpoint and the appropriate link relationship to find the specific endpoint of interest.
Example responses
200 Response
{
"version": 1,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
Response Schema
Status Code 200
API
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » version | integer | true | none | The version number of the API representation. This is version 1. |
| » links | [permissionsToLinks] | true | none | The API's top-level links. |
| »» Link | permissionsToLinks | false | none | A link to a related operation or resource. |
| »»» method | string | false | none | The HTTP method for the link. |
| »»» rel | string | true | none | The relationship of the link to the resource. |
| »»» uri | string | false | none | The relative URI for the link. |
| »»» href | string | false | none | The URL for the link. |
| »»» title | string | false | none | The title for the link. |
| »»» type | string | false | none | The media type or link type for the link. |
| »»» itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| »»» responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| »»» responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
Get a localized list of rule types
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/localizations/types \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string'
};
fetch('https://example.com/authorization/localizations/types',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/authorization/localizations/types', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/localizations/types", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /localizations/types
Provides localized versions of type enums for use as display labels in a graphical user interface. The names are localized to the accept-language of the header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Language | header | string | false | Enumerates the language(s) the client prefers the response in. This can be used to provide localized data where available. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"value": "string",
"localizedValue": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | localizedValueCollection |
Get a localized list of principal types
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/localizations/principalTypes \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string'
};
fetch('https://example.com/authorization/localizations/principalTypes',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/authorization/localizations/principalTypes', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/localizations/principalTypes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /localizations/principalTypes
Provides localized versions of principal type enums for use as display labels in a graphical user interface. The names are localized to the accept-language of the header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Language | header | string | false | Enumerates the language(s) the client prefers the response in. This can be used to provide localized data where available. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"value": "string",
"localizedValue": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | localizedValueCollection |
Get a localized list of permission names
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/localizations/permissions \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string'
};
fetch('https://example.com/authorization/localizations/permissions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/authorization/localizations/permissions', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/localizations/permissions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /localizations/permissions
Provides localized versions of permission enums for use as display labels in a graphical user interface. The names are localized to the accept-language of the header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Language | header | string | false | Enumerates the language(s) the client prefers the response in. This can be used to provide localized data where available. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"value": "string",
"localizedValue": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | localizedValueCollection |
Shares
Get shares
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/shares \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/authorization/shares',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/authorization/shares', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/shares", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shares
Retrieves some or all shares, with or without paging.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer | false | The index number for the first share in a page. |
| limit | query | integer | false | The maximum number of shares to return per page. |
| filter | query | string(filter-criteria) | false | Constraints on which shares to retrieve. Here are the supported filters and criteria:
|
| sortBy | query | string(sort-criteria) | false | Instructions for sorting the retrieved shares. You can sort by name or description in ascending or descending order. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | savedShareCollection |
| 400 | Bad Request | The request was invalid. Returned if any query criteria (sortBy, filter, limit, start) are invalid. | error2 |
Create a new share
Code samples
# You can also use wget
curl -X POST https://example.com/authorization/shares \
-H 'Content-Type: application/vnd.sas.authorization.share+json' \
-H 'Accept: application/vnd.sas.authorization.share+json' \
-H 'Content-Type: string' \
-H 'Accept: string'
const inputBody = '{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.share+json',
'Accept':'application/vnd.sas.authorization.share+json',
'Content-Type':'string',
'Accept':'string'
};
fetch('https://example.com/authorization/shares',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.share+json',
'Accept': 'application/vnd.sas.authorization.share+json',
'Content-Type': 'string',
'Accept': 'string'
}
r = requests.post('https://example.com/authorization/shares', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.share+json"},
"Accept": []string{"application/vnd.sas.authorization.share+json"},
"Content-Type": []string{"string"},
"Accept": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/authorization/shares", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /shares
Creates a new share that has a system-generated ID.
Body parameter
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Content-Type | header | string | false | Specifies the format of the incoming share. Supported media types are:
|
| Accept | header | string | false | Specifies the desired format of the returned share. Supported media types are:
|
| body | body | share | true | The properties of the new share. |
Example responses
201 Response
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A new share was created. | savedShare |
| 400 | Bad Request | The request was invalid. Returned if the specified share is invalid. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Content-Type | string | Type of returned content. | |
| 201 | Last-Modified | string | Timestamp of when share was last modified. | |
| 201 | Location | string | Relative URI of the share's path. | |
| 201 | ETag | string | The entity tag for the share. |
Patch shares
Code samples
# You can also use wget
curl -X PATCH https://example.com/authorization/shares \
-H 'Content-Type: application/json-patch+json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '[
{
"value": {
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
]';
const headers = {
'Content-Type':'application/json-patch+json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/authorization/shares',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json-patch+json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.patch('https://example.com/authorization/shares', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json-patch+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/authorization/shares", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /shares
Performs a set of share management actions as specified in a JSON patch. The actions are performed synchronously and transactionally. A resource collection of all created and revised shares is returned. If the patch is not successfully applied, changes are rolled back.
For every action, the patch must specify an operation (add, replace, remove, test, or copy) and a target URI (for example, /authorization/shares/{shareId} or, to create a new share, /authorization/shares). Each add and replace operation requires a valid share representation.
Body parameter
[
{
"value": {
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | sharePatchOperation | true | JSON patch describing operations to perform and identifying the target shares. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. Returned if the patch was applied successfully. | savedShareCollection |
| 400 | Bad Request | The request was invalid. Returned if the specified share patch is invalid. | error2 |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag. |
error2 |
| 422 | Unprocessable Entity | Unprocessable Entity. Returned if the patch request is syntactically valid but would result in a resource state that is inconsistent or invalid. | error2 |
Delete a share
Code samples
# You can also use wget
curl -X DELETE https://example.com/authorization/shares/{shareId}
fetch('https://example.com/authorization/shares/{shareId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/authorization/shares/{shareId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/authorization/shares/{shareId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /shares/{shareId}
Deletes a specified share.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| shareId | path | string | true | The ID of the share to delete. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The share was deleted. | None |
| 404 | Not Found | No share with the specified ID was found. | None |
Get a share
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/shares/{shareId} \
-H 'Accept: application/vnd.sas.authorization.share+json'
const headers = {
'Accept':'application/vnd.sas.authorization.share+json'
};
fetch('https://example.com/authorization/shares/{shareId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.authorization.share+json'
}
r = requests.get('https://example.com/authorization/shares/{shareId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.authorization.share+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/shares/{shareId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shares/{shareId}
Retrieves a specified share.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| shareId | path | string | true | The ID of the share to retrieve. |
Example responses
200 Response
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | savedShare |
| 404 | Not Found | No share with the specified ID was found. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | Type of returned content. | |
| 200 | Last-Modified | string | Timestamp of when share was last modified. | |
| 200 | Location | string | Relative URI of the share's path. | |
| 200 | ETag | string | The entity tag for the share. |
Update a share
Code samples
# You can also use wget
curl -X PUT https://example.com/authorization/shares/{shareId} \
-H 'Content-Type: application/vnd.sas.authorization.share+json' \
-H 'Accept: application/vnd.sas.authorization.share+json' \
-H 'If-Match: string'
const inputBody = '{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.authorization.share+json',
'Accept':'application/vnd.sas.authorization.share+json',
'If-Match':'string'
};
fetch('https://example.com/authorization/shares/{shareId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.authorization.share+json',
'Accept': 'application/vnd.sas.authorization.share+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/authorization/shares/{shareId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.authorization.share+json"},
"Accept": []string{"application/vnd.sas.authorization.share+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/authorization/shares/{shareId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /shares/{shareId}
Updates a share by completely replacing it with specified values.
Body parameter
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| shareId | path | string | true | The ID of the share to update. |
| If-Match | header | string | true | The entity tag obtained from the most recent ETag response header. Must match the current entity tag for the share. |
| body | body | share | true | The properties of the share. |
Example responses
200 Response
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. Returned if the object was updated. | savedShare |
| 400 | Bad Request | The request was invalid. Returned if the format of the request does not match the schema for the media type used or there is no existing object with the given ID. Also can be returned if the ID passed in the request payload does not match the ID in the URI. | error2 |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the share. |
Get sharing configuration
Code samples
# You can also use wget
curl -X GET https://example.com/authorization/shares/configuration \
-H 'Accept: application/vnd.sas.properties+json'
const headers = {
'Accept':'application/vnd.sas.properties+json'
};
fetch('https://example.com/authorization/shares/configuration',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.properties+json'
}
r = requests.get('https://example.com/authorization/shares/configuration', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.properties+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/authorization/shares/configuration", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shares/configuration
Gets property values that specify how sharing is configured. Currently, there are two properties that configure sharing: sas.authorization.share.enabled and sas.authorization.share.reshare.enabled. The first determines whether sharing is enabled at all in the system while the second determines whether users are allowed to grant reshare permission on objects. There can be additional properties in the future.
Example responses
200 Response
{
"version": 1,
"properties": [
{
"name": "string",
"value": "string"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
Response Schema
Status Code 200
API
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » version | integer | false | none | The version number of the API representation. This is version 1. |
| » properties | [any] | true | none | A list of name/value pairs. |
| »» Property | object | false | none | A pair consisting of a string name and a string value. This is an element of application/vnd.sas.properties |
| »»» name | string | true | none | The property name. |
| »»» value | string | true | none | The property value. |
| » links | [permissionsToLinks] | false | none | Links to associated resources and operartions. APIs may provide links for the link relations self',update(to replace the attributes),patch` (to update some attributes) or others. |
| »» Link | permissionsToLinks | false | none | A link to a related operation or resource. |
| »»» method | string | false | none | The HTTP method for the link. |
| »»» rel | string | true | none | The relationship of the link to the resource. |
| »»» uri | string | false | none | The relative URI for the link. |
| »»» href | string | false | none | The URL for the link. |
| »»» title | string | false | none | The title for the link. |
| »»» type | string | false | none | The media type or link type for the link. |
| »»» itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| »»» responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| »»» responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
Schemas
authorizationRule
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Authorization Rule
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| condition | string | false | none | A Spring Expression Language (SpEL) expression that limits the applicability of the rule. The rule applies only in authorization contexts in which the expression evaluates to 'true'. |
| containerUri | string | false | none | A relative URI that represents the container aspect of a container object, such as a folder. Rules that target a container URI affect access that the container conveys to its child members. |
| expirationTimeStamp | string(date-time) | false | none | The date and time at which the rule expires. Expired rules should be disregarded and deleted. |
| filter | string | false | none | Filter criteria for the rule's target object (or objects). This property is not currently in use. |
| contentType | string | false | none | Media type of the object that is handled by an endpoint. If set, rules will only apply to endpoints that consume resources of this type. Most rules do not specify a content type. |
| acceptType | string | false | none | Media type of the object returned by an endpoint. If set, rules will only apply to endpoints that produce resources of this type. Most rules do not specify an accept type. |
| acceptItemType | string | false | none | Media type of object in a resource collection that is returned by an endpoint. If set, rules will only apply to endpoints that produce a resource collection containing resources of this type. Most rules do not specify an accept item type. |
| objectUri | string | true | none | A relative URI or ANT-path pattern that represents a resource or set of resources. Most rules target an object URI. |
| permissions | [string] | true | none | The specific actions that the rule affects (for example: read, update, delete, create, secure, add, or remove). |
| principal | string | true | none | Specifies the ID of a user or group to which the rule applies. Use this property in conjunction with the principalType property. |
| principalType | string | true | none | The type of principal or construct to which the rule applies. |
| reason | string | false | none | Information that a client can display to end users for diagnostic purposes. For example, a prohibit rule’s reason could be displayed to an end user as part of an 'access denied' message. |
| type | string | true | none | Indicates whether the rule blocks (prohibit) or attempts to provide (grant) access to the specified principal. |
| version | integer(int32) | false | none | The version of the rule representation. The current representation version is 8. |
| description | string | false | none | Information that documents the rule for administrative purposes. |
| enabled | boolean | false | none | Indicates whether the rule is enabled. |
| matchParams | boolean | false | none | Indicates whether the rule applies to only those requests whose query parameters exactly match the rule target. |
| links | links | false | none | Zero or more links that are to related resources and actions. |
Enumerated Values
| Property | Value |
|---|---|
| principalType | user |
| principalType | group |
| principalType | authenticatedUsers |
| principalType | everyone |
| principalType | guest |
| type | grant |
| type | prohibit |
identifiableAuthorizationRule
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string"
}
Identifiable Authorization Rule
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Identifiable Authorization Rule | any | false | none | Any authorization rule that can be referenced by a unique identifier. This can be a savedAuthorizationRule or an unsaved authorization rule that has a client-specified identifier. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | authorizationRule | false | none | An authorization rule that does not have a known ID. The rule has not been saved or the ID is unavailable for some other reason. Compare with SavedAuthorizationRule. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » ruleId | string | false | none | The unique identifier for the rule. |
savedAuthorizationRule
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Saved Authorization Rule
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Saved Authorization Rule | any | false | none | An authorization rule that has a known rule ID and has been persisted. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | identifiableAuthorizationRule | false | none | Any authorization rule that can be referenced by a unique identifier. This can be a savedAuthorizationRule or an unsaved authorization rule that has a client-specified identifier. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » createdBy | string | false | none | The ID of the user who created the rule. |
| » creationTimeStamp | string(date-time) | false | none | The date and time at which the rule was created. |
| » modifiedBy | string | false | none | The ID of the last user to modify the rule. |
| » modifiedTimeStamp | string(date-time) | false | none | The date and time at which the rule was last modified. |
savedAuthorizationRuleCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"ruleId": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Resource Collection of Authorization Rules
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Resource Collection of Authorization Rules | any | false | none | A collection of saved authorization rules. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
| » name | string | false | none | The name of the collection. |
| » start | integer(int64) | false | none | The zero-based index of the first item in the collection. |
| » limit | integer | false | none | The number of items that were requested for the collection. |
| » count | integer(int64) | false | none | If populated indicates the number of items in the collection. |
| » accept | string | false | none | A space-delimited list of media types from which an Accept header may be constructed. |
| » links | [permissionsToLinks] | false | none | The links that apply to the collection. |
| » version | integer | false | none | The version number of the collection representation. This representation is version 2. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | The array of application/vnd.sas.authorization.rule+json representations. |
| » items | [savedAuthorizationRule] | false | none | [An authorization rule that has a known rule ID and has been persisted.] |
principal
{
"name": "string",
"type": "user",
"version": 0
}
Principal
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The ID of the user or group. If the principalType refers to a construct, no value is specified for t his property. |
| type | string | false | none | The type of the principal, or a construct. |
| version | integer(int32) | false | none | The principal media type version. The version described here is version 1. |
Enumerated Values
| Property | Value |
|---|---|
| type | user |
| type | group |
authorizationContext
{
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}
Authorization Context
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| request | authorizationContextRequest | false | none | A description of the HTTP request that is associated with an authorization request. |
| principals | [principal] | false | none | The set of principals representing the actor performing the action. |
| permission | string | true | none | A type of access. |
| parameters | object | false | none | A map of keys to objects that represent the parameters and return object of a method being invoked. This can be null or empty. |
| matchParams | boolean | false | none | Whether the authorization service should strictly match query parameters in this context against a rule. |
| eachNamed | object | false | none | Map of parameter names to a new name that should be used in rule condition evaluation for collections. For example, if a parameter being used for evaluation is a collection named 'items', then eachNamed can map 'items' to 'item' so that item in the collection can be evaluated independently against a rule that references the '#item' variable. |
| version | integer(int32) | false | none | The authorization context's media type version. The version described here is version 1. |
Enumerated Values
| Property | Value |
|---|---|
| permission | add |
| permission | create |
| permission | delete |
| permission | read |
| permission | remove |
| permission | secure |
| permission | update |
bulkAuthorizationContext
{
"bulkLinks": {
"add": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"create": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"delete": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"read": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"remove": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"secure": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"update": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"request": {
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
},
"principals": [
{
"name": "string",
"type": "user",
"version": 0
}
],
"permission": "add",
"parameters": {},
"matchParams": false,
"eachNamed": {},
"version": 0
}
Bulk Authorization Context
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Bulk Authorization Context | authorizationContext | false | none | Contextual information about an action that a principal is attempting, including one or more links that should be authorized against a supplied permission. Represented by media type application/vnd.sas.authorization.bulk.context+json. |
| bulkLinks | permissionsToLinks | true | none | A map of permissions to link arrays. The keys of this map are the permissions that the link values are authorized for. |
permissionsToLinks
{
"add": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"create": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"delete": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"read": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"remove": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"secure": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"update": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Permissions to Links
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| add | [object] | false | none | An array of links that should be authorized against the add permission. |
| » Link | object | false | none | A link to a related operation or resource. |
| »» method | string | false | none | The HTTP method for the link. |
| »» rel | string | true | none | The relationship of the link to the resource. |
| »» uri | string | false | none | The relative URI for the link. |
| »» href | string | false | none | The URL for the link. |
| »» title | string | false | none | The title for the link. |
| »» type | string | false | none | The media type or link type for the link. |
| »» itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| »» responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| »» responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
| create | [permissionsToLinks] | false | none | An array of links that should be authorized against the create permission. |
| delete | [permissionsToLinks] | false | none | An array of links that should be authorized against the delete permission. |
| read | [permissionsToLinks] | false | none | An array of links that should be authorized against the read permission. |
| remove | [permissionsToLinks] | false | none | An array of links that should be authorized against the remove permission. |
| secure | [permissionsToLinks] | false | none | An array of links that should be authorized against the secure permission. |
| update | [permissionsToLinks] | false | none | An array of links that should be authorized against the update permission. |
authorizationContextRequest
{
"uri": "string",
"method": "string",
"queryString": "string",
"parameters": {},
"locale": "string",
"headers": {},
"contentLength": 0,
"contentType": "string",
"protocol": "string",
"serverName": "string",
"serverPort": 0,
"serverIp": "string",
"remoteHost": "string",
"remoteIp": "string",
"requestDate": 0,
"timeStamp": "string"
}
Authorization Context Request
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| uri | string | false | none | The relative URI of the request, excluding any query parameters. |
| method | string | false | none | The HTTP method that is used by the caller. |
| queryString | string | false | none | The query string portion of the caller request, if any. |
| parameters | object | false | none | The request parameters map. |
| locale | string | false | none | The preferred locale that the client accepts content in. |
| headers | object | false | none | A map of HTTP header names to their values. |
| contentLength | integer(int32) | false | none | The length, in bytes, of the request body. |
| contentType | string | false | none | The MIME type of the body of the request. |
| protocol | string | false | none | The protocol of the request. |
| serverName | string | false | none | The name of the server to which the request was sent. |
| serverPort | integer(int32) | false | none | The port number of the server to which the request was sent. |
| serverIp | string | false | none | The IP address of the server to which the request was sent. |
| remoteHost | string | false | none | The fully qualified name of the client (or the last proxy) that sent the request. |
| remoteIp | string | false | none | The IP address of the client (or the last proxy) that sent the request. |
| requestDate | integer(int32) | false | none | The date on which the request was sent, represented as the number of milliseconds since January 1, 1970 GMT. |
| timeStamp | string | false | none | The date on which the request was sent, represented as a W3C/ISO 8601 compliant timestamp string using yyyy-MM-dd'T'HH:mm:ss.SSSZ format. |
explanations
"{'/foo/123': [... explanation array ...], '/bar/123': [... explanation array ...]}"
Explanations
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Explanations | string | false | none | A map of relative URI keys to an array of Explanation values. Each explanation in each array explains authorization decisions for one principal. |
| version | integer(int32) | false | none | The version of the explanation representation. The current representation version is 1. |
| explanations | [explanation] | false | none | [An explanation of access for one principal.] |
explanation
"{'principal': {'name': 'test-user', 'type': 'user'}, 'read': {... read explanation ...}, 'update': {... update explanation ...}, 'so on, for each permission...':{...}}"
Explanation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| principal | principal | false | none | A specific user or group. |
| add | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| create | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| delete | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| read | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| remove | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| secure | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
| update | permissionExplanation | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
individualExplanation
{
"result": "grant",
"grantFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"prohibitFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
}
Individual Explanation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| result | string | false | none | The ultimate access result for the defined principal and permission. A result of 'conditional' means that access might be either granted or denied, depending on the impact of request-time circumstances on evaluation of relevant conditions. |
| grantFactor | factor | false | none | Information about the source or cause of the result. Includes a list of applicable rules, indication of whether any of those rules has a condition, and whether the result is direct (a rule directly targets the defined object and is directly assigned to the defined principal). |
| prohibitFactor | factor | false | none | Information about the source or cause of the result. Includes a list of applicable rules, indication of whether any of those rules has a condition, and whether the result is direct (a rule directly targets the defined object and is directly assigned to the defined principal). |
Enumerated Values
| Property | Value |
|---|---|
| result | grant |
| result | prohibit |
| result | conditional |
permissionExplanation
{
"result": "grant",
"grantFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"prohibitFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"conveyedExplanation": {
"result": "grant",
"grantFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"prohibitFactor": {
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
}
}
Permission Explanation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Permission Explanation | any | false | none | An explanation of access for one principal and permission. Includes explanations for permissions conveyed by containing objects. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | individualExplanation | false | none | An explanation of access for one principal and permission. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » conveyedExplanation | individualExplanation | false | none | An explanation of access for one principal and permission. |
factor
{
"direct": true,
"condition": "string",
"contributingRules": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Factor
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| direct | boolean | false | none | Indicates whether the result comes from a rule that targets the defined object directly (via objectUri) and is directly assigned to the defined principal. If false, the result comes from another source, such as inheritance a parent object), membership (a parent group), or the absence of applicable rules. |
| condition | string | false | none | The condition that affects access, if any. |
| contributingRules | [permissionsToLinks] | false | none | An array of links that indicate which rules contributed to this factor. If empty or null, then no explicit rules contributed and the result comes from the inherit semantics of the system (for example, prohibit is implicit if there is no relevant grant rule). |
ruleJob
{
"state": "pending",
"actions": [
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Rule Job
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| state | string | false | none | Defines the current state of an action. |
| actions | [ruleAction] | false | none | A set of actions to be performed on defined rules. These can be create, update, or delete actions. Actions are performed in their arrayed order. |
| links | links | false | none | Zero or more links that are to related resources and actions. |
Enumerated Values
| Property | Value |
|---|---|
| state | pending |
| state | running |
| state | completed |
| state | completedWithErrors |
| state | failed |
ruleAction
{
"rule": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"type": "create",
"status": "pending"
}
Rule Action
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| rule | authorizationRule | true | none | An authorization rule that does not have a known ID. The rule has not been saved or the ID is unavailable for some other reason. Compare with SavedAuthorizationRule. |
| type | string | true | none | The type of action to be performed on a rule |
| status | string | false | none | Defines the current state of an action. |
Enumerated Values
| Property | Value |
|---|---|
| type | create |
| type | update |
| type | delete |
| status | pending |
| status | running |
| status | completed |
| status | completedWithErrors |
| status | failed |
rulePatchOperation
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
Rule Patch Operation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | authorizationRule | false | none | An authorization rule that does not have a known ID. The rule has not been saved or the ID is unavailable for some other reason. Compare with SavedAuthorizationRule. |
| op | string | true | none | The type of operation to perform on the defined rule. |
| path | any | true | none | The URI of the rule. |
Enumerated Values
| Property | Value |
|---|---|
| op | add |
| op | replace |
| op | remove |
| op | test |
| op | copy |
links
[
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
Links
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Links | [permissionsToLinks] | false | none | Zero or more links that are to related resources and actions. |
localizedValueCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"value": "string",
"localizedValue": "string"
}
]
}
Resource Collection of Localized Values
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Resource Collection of Localized Values | any | false | none | A collection of localized values. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | savedAuthorizationRuleCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | The array of localizedValue representations. |
| » items | [localizedValue] | false | none | [A name-value pair of the form (value: localizedValue).] |
localizedValue
{
"value": "string",
"localizedValue": "string"
}
Localized Value
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | string | false | none | The original, unlocalized value. |
| localizedValue | string | false | none | The corresponding localized value. |
authorizedLinks
{
"grantedLinks": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"prohibitedLinks": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Authorized Links
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| grantedLinks | [permissionsToLinks] | false | none | An array of link objects that are granted based on the permission requested. |
| prohibitedLinks | [permissionsToLinks] | false | none | An array of link objects that are prohibited based on the permission requested. |
| version | integer(int32) | false | none | The version of the authorized links format that is being referenced. |
errorResponse
{
"statusCode": 0,
"errorCode": 0,
"message": "string",
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"id": "string",
"version": 0,
"links": {
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
}
Error Response
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| statusCode | integer(int32) | false | none | HTTP status code. |
| errorCode | integer(int32) | false | none | An optional error code that indicates what went wrong. |
| message | string | false | none | A message that describes the error. |
| details | [string] | false | none | An array of strings that provide more information about what went wrong. |
| remediation | string | false | none | An optional string that describes steps that can be taken to fix the problem. |
| errors | [errorResponse] | false | none | A nested array of root causes or related errors. |
| id | string | false | none | The identifier for the error. |
| version | integer(int32) | false | none | The version of the error response format that is being referenced. |
| links | permissionsToLinks | false | none | A link to a related operation or resource. |
hypothetical
{
"version": 0,
"patch": [
{
"value": {
"condition": "string",
"containerUri": "string",
"expirationTimeStamp": "2019-08-24T14:15:22Z",
"filter": "string",
"contentType": "string",
"acceptType": "string",
"acceptItemType": "string",
"objectUri": "string",
"permissions": [
"add"
],
"principal": "string",
"principalType": "user",
"reason": "string",
"type": "grant",
"version": 0,
"description": "string",
"enabled": true,
"matchParams": false,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
],
"uris": [
"string"
]
}
Hypothetical
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer(int32) | false | none | The version of the resource selection format that is being referenced. |
| patch | [rulePatchOperation] | false | none | An array of patch operations to apply to the existing rules. |
| uris | [string] | false | none | The URIs for which to create the explanations. |
share
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Share
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| sharedWith | string | true | none | The principal name of the share recipient. |
| resourceUri | string | true | none | A relative URI that represents a resource. All shares must target a resource URI. |
| name | string | false | none | The user-friendly name of the shared resource. |
| sharedWithType | string | true | none | The type of principal to which the share applies. |
| type | string | true | none | The level of access that the share provides. |
| enabled | boolean | false | none | Flag indicating whether the current share is in effect or not. |
| version | integer(int32) | false | none | The version of the share representation. The current representation version is 2. |
| links | links | false | none | Zero or more links that are to related resources and actions. |
Enumerated Values
| Property | Value |
|---|---|
| sharedWithType | user |
| sharedWithType | group |
| sharedWithType | authenticatedUsers |
| sharedWithType | everyone |
| sharedWithType | guest |
| type | read |
| type | readEdit |
| type | readShare |
| type | readEditShare |
savedShare
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
Saved Share
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Saved Share | any | false | none | Any share that can be referenced by a unique identifier and has been persisted. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | share | false | none | 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. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | false | none | The unique identifier for the share. |
| » createdBy | string | false | none | The ID of the user who created the share. |
| » creationTimeStamp | string(date-time) | false | none | The date and time at which the share was created. |
| » modifiedBy | string | false | none | The ID of the last user to modify the share. |
| » modifiedTimeStamp | string(date-time) | false | none | The date and time at which the share was last modified. |
savedShareCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"id": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Resource Collection of Shares
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Resource Collection of Shares | any | false | none | A collection of saved shares. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | savedAuthorizationRuleCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [savedShare] | false | none | The array of application/vnd.sas.authorization.rule+json representations. |
sharePatchOperation
{
"value": {
"sharedWith": "string",
"resourceUri": "string",
"name": "string",
"sharedWithType": "user",
"type": "read",
"enabled": true,
"version": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
},
"op": "add",
"path": null
}
Share Patch Operation
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | share | false | none | 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. |
| op | string | true | none | The type of operation to perform on the defined share. |
| path | any | true | none | The URI of the share. |
Enumerated Values
| Property | Value |
|---|---|
| op | add |
| op | replace |
| op | remove |
error2
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | false | none | The message for the error. |
| id | string | false | none | The string ID for the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| errors | [error2] | false | none | Any additional errors that occurred. |
| links | [permissionsToLinks] | false | none | The links that apply to the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
validation
{
"version": 0,
"valid": true,
"error": {},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Validation Response
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | true | none | This media type's schema version number. This representation is version 1. |
| valid | boolean | true | none | true if and only if the validation was successful. |
| error | object | false | none | An error object that describes how the validation failed. This member is omitted if the value for the valid property is true. |
| links | [permissionsToLinks] | false | none | An array of links to related resources and actions. |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.authorization.rule
The application/vnd.sas.authorization.rule media type describes the complete details of an authorization rule. The schema is at authorizationRule.
application/vnd.sas.authorization.rule+json
Here is an example of the JSON representation of this media type.
{
"type": "grant",
"permissions": [
"read"
],
"principalType": "authenticatedUsers",
"objectUri": "/preferences/",
"description": "Allow access to a service root.",
"matchParams": false,
"version": 5,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac",
"type": "application/vnd.sas.authorization.rule"
},
{
"method": "PUT",
"rel": "update",
"href": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac",
"type": "application/vnd.sas.authorization.rule",
"responseType": "application/vnd.sas.authorization.rule"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/rules/3288b305-981f-4b8d-b440-0911eabc3fac"
}
],
"id": "3288b305-981f-4b8d-b440-0911eabc3fac",
"modifiedTimestamp": "2016-08-27T04:09:42.150Z",
"createdTimestamp": "2016-08-27T04:09:42.150Z",
"createdBy": "bob",
"modifiedBy": "bob",
"enabled": true
}
application/vnd.sas.authorization.decision
The application/vnd.sas.authorization.decision media type represents the decision that the authorization system has made as to whether an action can occur or not. This type simply represents a json Boolean value indicating whether the action can occur (true) or not (false). The returned value is a string.
application/vnd.sas.authorization.decision+json
Here is an example of the JSON representation of this media type.
{
true
}
application/vnd.sas.authorization.explanations
The application/vnd.sas.authorization.explanations media type represents the implicit and explicit grant (or prohibit) state of all permissions for all relevant principals for a set of objects. The common use for this media type.
is explaining effective access in an administrative UI.
This media type represents a list of Explanation objects.
The schema is at explanations.
application/vnd.sas.authorization.explanations+json
Here is an example of the JSON representation of this media type.
{
"principal":{
"version":1,
"name":"testprincipal",
"type":"user"
},
"permissions":{
"read":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"add":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"delete":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"create":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"secure":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"remove":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"update":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
}
},
"read":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"add":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"delete":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"create":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"secure":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"remove":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
},
"update":{
"result":"grant",
"grantFactor":{
"direct":true,
"contributingRules":[
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f",
"uri":"/authorization/rules/6084bd1a-582c-45b0-8ef4-4045c0d10d2f"
},
{
"method":"GET",
"rel":"directContributingRule",
"href":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4",
"uri":"/authorization/rules/a07598bf-cb6a-409e-980f-d33f07b921d4"
}
]
}
}
}
application/vnd.sas.authorization.context
The application/vnd.sas.authorization.context media type represents the authorization context.
The authorization context contains the information that is relevant to a specific authorization decision.
The schema is at authorizationContext.
application/vnd.sas.authorization.context+json
Here is an example of the JSON representation of this media type.
{
"request":{
"uri":"/test/123"
},
"principals":[
{
"name":"testprincipal",
"type":"user"
}
],
"permission":"read",
"parameters":{},
"properties":{},
"links":{},
"bulkLinks":{},
"matchParams":false,
"eachNamed":{}
}
application/vnd.sas.authorization.rule.job
The application/vnd.sas.authorization.rule.job media type represents a set of rule CRUD actions to be performed asynchronously by the authorization service.
Each action must specify an application/vnd.sas.authorization.rule to act on. For create actions, this representation does not require a valid rule ID, because a rule ID is generated automatically when the new rule is created. For update and delete actions, the representation must contain a valid rule ID that matches an existing rule.
The schema is at ruleJob.
application/vnd.sas.authorization.rule.async+json
Here is an example of the JSON representation of this media type.
{
"state":"pending",
"actions":[
{
"rule":{
"type":"grant",
"permissions":[
"add",
"create",
"delete",
"read",
"remove",
"secure",
"update"
],
"principal":"testprincipal",
"principalType":"user",
"objectUri":"/test/**",
"mediaType":"application/vnd.sas.test",
"reason":"Because I'm testing",
"matchParams":false,
"version":5,
"enabled":true
},
"type":"create",
"state":"pending"
}
]
}
application/vnd.sas.authorization.explanation.hypothetical
The vnd.sas.authorization.explanation.hypothetical media type represents a set of URIs that provide hypothetical explanations and a JSON patch that contains a series of hypothetical actions to be applied to the rules collection before creating those explanations.
The schema is at hypothetical.
application/vnd.sas.authorization.explanation.hypothetical+json
Here is an example of the JSON representation of this media type.
{
"uris": [
"/test/conditionalGrant"
],
"patch": [
{
"op": "add",
"path": "/authorization/rules/fc320a06-51de-46bc-a8e7-3922a33f9d27",
"value": {
"type": "grant",
"permissions": [
"remove",
"add",
"read",
"secure",
"create",
"delete",
"update"
],
"principal": "somePrincipal",
"principalType": "user",
"containerUri": null,
"objectUri": "/test/conditionalGrant",
"mediaType": "application/vnd.sas.test",
"condition": "isFoo()",
"filter": null,
"reason": "Because I'm testing",
"description": null,
"matchParams": false,
"version": 8,
"id": "fc320a06-51de-46bc-a8e7-3922a33f9d27",
"enabled": true
}
}
],
"version": 1
}
application/vnd.sas.authorization.share
The application/vnd.sas.authorization.share media type describes the complete details of a share. The schema is at share.
application/vnd.sas.authorization.share+json
Here is an example of the JSON representation of this media type.
{
"type": "readEdit",
"sharedWith": "testUser",
"sharedWithType": "user",
"sharedBy": "currentUser",
"resourceUri": "/files/files/4288b305-981f-4b8d-b440-0911eabe3faf",
"name": "test file",
"enabled": true
"version": 3,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
"type": "application/vnd.sas.authorization.share"
},
{
"method": "PUT",
"rel": "update",
"href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
"type": "application/vnd.sas.authorization.share",
"responseType": "application/vnd.sas.authorization.share"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
"uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac"
}
],
"id": "3288b305-981f-4b8d-b440-0911eabc3fac",
"modifiedTimestamp": "2016-08-27T04:09:42.150Z",
"createdTimestamp": "2016-08-27T04:09:42.150Z",
"createdBy": "currentUser",
"modifiedBy": "currentUser"
}
Root
Path: /
The root of the API. This resource contains links to the top-level resources in the API.
The response uses the application/vnd.sas.api media type.
Links
Note that all GET operations have a corresponding HEAD, which is identical except for HEAD semantics.
The GET / response includes the following links:
| Relation | Method | Description |
|---|---|---|
authorize |
POST |
Obtains an authorization decision for the specified action and authorization context. |
| URI: /authorization/decisions | ||
Type: application/vnd.sas.authorization.context |
||
rules |
GET |
Retrieves a list of all rules. |
| URI: /authorization/rules | ||
Type: application/vnd.sas.collection |
||
createRule |
POST |
Creates a new rule. |
| URI: /authorization/rules | ||
Type: application/vnd.sas.authorization.rule |
||
getRule |
GET |
Retrieves an existing rule by its ID. |
| URI: /authorization/rules/{ruleId} | ||
Type: application/vnd.sas.authorization.rule |
||
createOrUpdateRule |
PUT |
Creates or updates a rule with a specified ID. (To create a rule that has a system-generated ID, use POST on /rules.) |
| URI: /authorization/rules/{ruleId} | ||
Type: application/vnd.sas.authorization.rule |
||
deleteRule |
DELETE |
Deletes an existing rule. |
| URI: /authorization/rules/{ruleId} | ||
patchRules |
PATCH |
Applies a JSON patch to the rules collection. Supported JSON patch operations are 'add', 'replace', 'remove', 'copy', and 'test'. |
| URI: /authorization/rules | ||
| Type: application/json-patch+json | ||
createDecisionExplanation |
POST |
Obtains a decision explanation for the specified action and authorization context. The decision explanation details all of the factors that are relevant to the decision. |
| URI: /authorization/decision | ||
Type: application/vnd.sas.selection |
||
createHypotheticalDecisionExplanation |
POST |
Obtains a hypothetical decision explanation for the specified action and authorization context, with the hypothetical rules applied. The decision explanation details all of the factors that are relevant to the hypothetical decision. |
| URI: /authorization/decision | ||
Type: application/vnd.sas.authorization.explanation.hypothetical |
||
localizedTypes |
GET |
Retrieves a list of localized rule type values. |
| URI: /authorization/localizations/types | ||
Type: application/vnd.sas.collection |
||
localizedPermissions |
GET |
Retrieves a list of localized permission values. |
| URI: /authorization/localizations/permissions | ||
Type: application/vnd.sas.collection |
||
localizedPrincipalTypes |
GET |
Retrieves a list of localized principal type values. |
| URI: /authorization/localizations/principalTypes | ||
Type: application/vnd.sas.collection |
||
createRuleFromTransferObject |
POST |
Creates a rule from the provided transfer object. |
| URI: /authorization/rules | ||
| Type: application/vnd.sas.transfer.object | ||
getRuleAsTransferObject |
GET |
Retrieves a transfer object representation of a rule. |
| URI: /authorization/rules/{ruleId} | ||
updateRuleFromTransferObject |
PUT |
Updates a rule from the provided transfer object. |
| URI: /authorization/rules/{ruleId} | ||
| Type: application/vnd.sas.transfer.object | ||
getRuleJob |
GET |
Retrieves a rule job. |
| URI: /authorization/rules/jobs/{jobId} | ||
deleteRuleJob |
DELETE |
Deletes a rule job. |
| URI: /authorization/rules/jobs/{jobId} | ||
getRuleJobState |
GET |
Retrieves a rule job's current state. |
| URI: /authorization/rules/jobs/{jobId}/state | ||
createRuleJob |
POST |
Creates a new rule job. |
| URI: /authorization/rules/jobs | ||
Type: application/vnd.sas.authorization.rule.job |
||
validateCondition |
POST |
Validates the syntax of a potential rule condition. |
| URI: /authorization/rules/conditionValidation | ||
| Type: text/plain | ||
shares |
GET |
Retrieves a list of all shares. |
| URI: /authorization/shares | ||
Type: application/vnd.sas.collection |
||
createShare |
POST |
Creates a new share. |
| URI: /authorization/shares | ||
Type: application/vnd.sas.authorization.share |
||
share |
GET |
Retrieves an existing share by its ID. |
| URI: /authorization/shares/{shareId} | ||
Type: application/vnd.sas.authorization.share |
||
updateShare |
PUT |
Updates a share with a specified ID. |
| URI: /authorization/shares/{shareId} | ||
Type: application/vnd.sas.authorization.share |
||
deleteShare |
DELETE |
Deletes an existing share. |
| URI: /authorization/shares/{shareId} | ||
patchShares |
PATCH |
Applies a JSON patch to the shares collection. Supported JSON patch operations are 'add', 'replace', and 'remove'. |
| URI: /authorization/shares | ||
| Type: application/json-patch+json | ||
shareConfiguration |
GET |
Gets property values that define how sharing is configured. |
| URI: /authorization/shares/configuration | ||
Type: application/vnd.sas.collection |
Collection Resources
Path: /rules
This API provides collections of rules.
Members of the /rules collection are rules, /rules/{ruleId}.
Links
The rules collection representation is application/vnd.sas.collection.
The collection items are application/vnd.sas.authorization.rule resources.
Responses include the following links:
| Relation | Method | Description |
|---|---|---|
self |
GET |
Returns the current page from the collection. |
collection |
GET |
Returns the first page of the collection, without sorting, or filtering criteria. |
prev |
GET |
Returns the previous page of the collection. |
first |
GET |
Returns the first page of the collection. |
next |
GET |
Returns the next page of the collection. |
last |
GET |
Returns the last page of the collection. |
Sorting and Filtering
These collections can be sorted and filtered using the ?sortBy= and ?filter= query parameters.
Filtering and sorting can use the following members of the Rule:
containerUriobjectUriprincipalTypecreationTimeStampcreatedBymodifiedBymodifiedTimeStamptypedescriptionenabledmatchParamscontentTypeacceptTypeacceptItemTypepermissionsprincipal
Path: /localizations/types
This API provides collections of localized string values of rule types.
Members of the /localizations/types collection are localized strings.
Path: /localizations/permissions
This API provides collections of localized string values of permissions.
Members of the /localizations/permissions collection are localized strings.
Path: /localizations/principalTypes
This API provides collections of localized string values of principal types.
Members of the /localizations/principalTypes collection are localized strings.
Single Item Resources
Path: /rules/{ruleId}
A specific rule.
Links
Each rule instance includes the following links:
| Relation | Method | Description |
|---|---|---|
self |
GET |
Retrieves this rule. |
update |
PUT |
Updates this rule. |
delete |
DELETE |
Deletes this rule. |
Files
Base URLs:
- https://example.com/files
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Files API provides persistence of files, such as comment attachments and report images.
Usage Notes
Overview
The Files API provides a generic platform for clients to persist and retrieve such files as documents, attachments, and reports. You can associate the file with the URI of another identifiable object (for example, a parentUri). You must assign a content type and name to every file. You can retrieve files individually by using the file identifier or as a list of files by using a parentUri. A content stream is associated with each file.
After you create the file, you can update the metadata that is associated with the file or the actual content. You can delete a single file by using a specific ID. You can delete multiple files by specifying a parentUri.
You can upload a file using a raw request or a multipart form request.
Supported Features
This API provides these functions, each has an associated default user value that can perform the function.
| Function | Default User |
|---|---|
| Store a file | authenticated |
| Retrieve file meta information | authorized |
| Retrieve file content | authorized |
| Update file meta information | authorized |
| Update file content | authorized |
| Delete a file | authorized |
| Copy a file | any user with Read access to the file |
| Retrieve fileVersion meta information | authorized |
| Retrieve fileVersion content | authorized |
File Service Administration
By default, the Files API blocks a file upload when any of these conditions exists.
- No file is specified in the request.
- The file size is greater than 100 megabytes (MB). This value is configurable.
- The file media type is application/x-msdownload (.exe file). This type is configurable.
Change the Permissible File Size
To modify the 100 MB upload limit, specify the applicable value in bytes in the files.maxFileSize Consul property. For example, to specify a 10 MB limit, specify files.maxFileSize=10485760.
Change Blocked Media Types
To determine whether uploading is permitted for a specific file type, the Files API checks the Content-Type in the request. If approved, the Files API then scans the file content to determine the actual content type. To modify the list of blocked types, specify the applicable types in the files.blockedTypes Consul property. Separate multiple values with a comma. For example, to block .zip, .exe, and plain text files, specify files.blockedTypes=application/zip,application/x-msdownload,text/plain.
Prevent Content Scan for Secured Types
If you want the Files API to skip content scanning, specify the applicable media types in the sas.files.securedTypes Consul property. Separate multiple values with a comma. If the Content-Type value for a request matches a type that is specified in the sas.files.securedTypes property, the Files API does not perform a content scan. It is recommended that you use this feature only if it is absolutely necessary. If you use this feature, you should specify a local media type in the sas.files.securedTypes property and for the Content-Type when you upload the file.
Create Versioned file
File Service now has a provision to create versions of a given file.The end consumer can provide information at the time of file creation.
Terminology
file resource
the meta representation of a file.
stream
the data stream for the actual content of a file.
Operations
Root
The operations for the Root resource.
Get top-level resource links
Code samples
# You can also use wget
curl -X GET https://example.com/files/ \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/files/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/files/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level resources that are available through the API. These top-level links include create and retrieve operations for /files.
Example responses
200 Response
{
"version": 1,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
| 404 | Not Found | The service is not available. | None |
Response Schema
Status Code 200
API
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » version | integer | true | none | The version number of the API representation. This is version 1. |
| » links | [link] | true | none | The API's top-level links. |
| »» Link | link | false | none | A link to a related operation or resource. |
| »»» method | string | false | none | The HTTP method for the link. |
| »»» rel | string | true | none | The relationship of the link to the resource. |
| »»» uri | string | false | none | The relative URI for the link. |
| »»» href | string | false | none | The URL for the link. |
| »»» title | string | false | none | The title for the link. |
| »»» type | string | false | none | The media type or link type for the link. |
| »»» itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| »»» responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| »»» responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
Check the state of the service
Code samples
# You can also use wget
curl -X HEAD https://example.com/files/
fetch('https://example.com/files/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/files/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/files/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Indicates whether the service is available.
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The service is available. | None |
| 404 | Not Found | The service is not available. | None |
Files
The CRUD (Create, Read, Update, Delete) operations for files.
Get file resources
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId}/versions \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/files/files/{fileId}/versions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/files/files/{fileId}/versions', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}/versions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}/versions
Retrieves file resources of all versions of a given file. Standard paging options is available.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The specific fileId for which version needs to be returned. |
| start | query | integer(int64) | false | The offset of the first member to return. The default value is 0. |
| limit | query | integer(int64) | false | The maximum number of members to return. The default value is 10. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. If files are found for the specified criteria, they are returned in a collection. If no files are found, an empty collection is returned. | fileResourceCollection |
| 400 | Bad Request | The request was not valid. The limit parameter cannot be less than 0 or greater than 10000. |
error2 |
Delete file resources
Code samples
# You can also use wget
curl -X DELETE https://example.com/files/files?parentUri=string
fetch('https://example.com/files/files?parentUri=string',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/files/files', params={
'parentUri': 'string'
})
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/files/files", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /files
Deletes file resources for the specified parentUri. If the user is not authorized to delete all matching files, no files are deleted.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| parentUri | query | string | true | The parent URI that is associated with the file resources to be deleted. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The file resources for the specified parentUri were successfully deleted. | None |
| 404 | Not Found | No file resources exist for the specified parentUri. | None |
Create new file resource
Code samples
# You can also use wget
curl -X POST https://example.com/files/files#rawUpload \
-H 'Content-Type: */*' \
-H 'Accept: application/vnd.sas.file+json' \
-H 'Content-Type: string' \
-H 'Content-Disposition: string'
const inputBody = 'string';
const headers = {
'Content-Type':'*/*',
'Accept':'application/vnd.sas.file+json',
'Content-Type':'string',
'Content-Disposition':'string'
};
fetch('https://example.com/files/files#rawUpload',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': '*/*',
'Accept': 'application/vnd.sas.file+json',
'Content-Type': 'string',
'Content-Disposition': 'string'
}
r = requests.post('https://example.com/files/files#rawUpload', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"*/*"},
"Accept": []string{"application/vnd.sas.file+json"},
"Content-Type": []string{"string"},
"Content-Disposition": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/files/files#rawUpload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /files#rawUpload
Creates a new file resource by passing file content in the request body.
Body parameter
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Content-Type | header | string | false | The actual MIME type of the file. |
| Content-Disposition | header | string | false | The content disposition. It indicates whether the content is expected to be displayed inline in a browser (as a web page or part of a web page) or as an attachment that is downloaded and saved locally. If a filename is specified in the header, it is used as the default name of the file. |
| expirationTimeStamp | query | string | false | A timestamp that indicates when a file expires. If this is not specified, the file never expires. |
| parentFolderUri | query | string | false | The URI of the folder in which the file should be made a member. |
| searchable | query | string | false | An indicator specifying if a file is searchable or not. Defaulted to 'true' indicating file is searchable. |
| typeDefName | query | string | false | The type definition name of the file. If the file is associated with a folder and the client does not provide the value of this parameter, the file-service tries to find the best possible value using type-registry service. If it fails to find a default value, it defaults to "file". |
| versioned | query | boolean | false | An indicator specifying if a file is a version control file or not. If set to true, the endpoint will return first version of the file. |
| recoverable | query | boolean | false | An indicator specifying if a file is recoverable or not.If a user deleted the file then those files can be recovered.There is a certain retention period till which the file will be retained. |
| body | body | file | false | The contents of the file to be passed in raw format in the request body. |
Example responses
201 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The file resource was created and returned in the response body. | fileResource |
| 400 | Bad Request | The request was not valid. A validation error occurred, and the file cannot be created. Check the response for more information. Here are common reasons for this issue: The file is empty, the file is larger than the permitted size, or the file type is not supported. | error2 |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. A file with the specified name cannot be created in the folder because the file already exists in that folder. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | ETag | string | The entity tag for the file resource. | |
| 201 | Last-Modified | string | The last modified timestamp of the file resource. | |
| 201 | Location | string | The URI of the file resource. |
Create a new file resource
Code samples
# You can also use wget
curl -X POST https://example.com/files/files#multipartUpload \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/vnd.sas.file+json' \
-H 'Content-Type: string' \
-H 'Content-Disposition: string'
const inputBody = '{
"filename": "string",
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/vnd.sas.file+json',
'Content-Type':'string',
'Content-Disposition':'string'
};
fetch('https://example.com/files/files#multipartUpload',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/vnd.sas.file+json',
'Content-Type': 'string',
'Content-Disposition': 'string'
}
r = requests.post('https://example.com/files/files#multipartUpload', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/vnd.sas.file+json"},
"Content-Type": []string{"string"},
"Content-Disposition": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/files/files#multipartUpload", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /files#multipartUpload
Creates a new file resource by passing a file in the form of a multipart request.
Body parameter
filename: string
file: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Content-Type | header | string | false | The MIME type for the multipart request. You must specify "multipart/form-data; boundary={boundaryString}". You can specify the actual MIME type of the file by using Content-Type as form data in the request body. |
| Content-Disposition | header | string | false | The content disposition. This indicates whether the content is expected to be displayed inline in a browser (as a web page or part of a web page) or as an attachment that is downloaded and saved locally. If a filename is specified in the header, it is used as the default name of the file. |
| expirationTimeStamp | query | string | false | A timestamp that indicates when a file expires. If it is not specified, the file never expires. |
| parentFolderUri | query | string | false | The URI of the folder in which to add the file. |
| searchable | query | string | false | An indicator specifying if a file is searchable or not. Defaulted to 'true' indicating file is searchable. |
| typeDefName | query | string | false | The type definition name of the file. If the file is associated with folder and the client does not provide the value of this parameter, the file-service tries to find the best possible value using type-registry service. If it fails to find a default value, it defaults to "file". |
| body | body | object | false | none |
| » filename | body | string | false | The name of the file. Clients must specify name of the file as form data in the request body. |
| » file | body | string(binary) | false | The actual file content. The content should be listed in the format of standard form data in the request body. Only one file is permitted in a multipart request. |
Example responses
201 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The file was created and returned in the response body. | fileResource |
| 400 | Bad Request | The request was not valid. A validation error occurred, and the file cannot be created. Check the response for more information. Here are common reasons for this issue: The file is empty, the file is larger than the permitted size, the file type is not supported, or the multipart request contains more than one file. | error2 |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. A file with the specified name cannot be created in the folder because the file already exists in that folder. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | ETag | string | The entity tag for the file resource. | |
| 201 | Last-Modified | string | The last modified timestamp of the file resource. | |
| 201 | Location | string | The URI of the file resource. |
Get file resources for multiple parentUris
Code samples
# You can also use wget
curl -X POST https://example.com/files/files#fetchFilesForMultipleParentUri \
-H 'Content-Type: application/vnd.sas.selection+json' \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: string'
const inputBody = '{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.selection+json',
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'string'
};
fetch('https://example.com/files/files#fetchFilesForMultipleParentUri',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.selection+json',
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'string'
}
r = requests.post('https://example.com/files/files#fetchFilesForMultipleParentUri', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.selection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/files/files#fetchFilesForMultipleParentUri", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /files#fetchFilesForMultipleParentUri
Retrieves the file resources that are associated with multiple parentUri specifications. Request the parentUri values in the body. The returned collection is grouped by parentUri.
Body parameter
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | false | The file resource media type value. If this is not specified, the API returns the latest version. |
| body | body | selection | true | Multiple parentUri values that are specified as an array of string values. The file resources that are associated with each parentUri are retrieved. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. If files are found for the specified criteria, they are returned in a collection. If no files are found, an empty collection is returned. | fileResourceCollection |
| 400 | Bad Request | The request was not valid. A validation error occurred, and the file cannot be created. Check the response for more information. Here are common reasons for this issue: The file is empty, the file is larger than the permitted size, the file type is not supported, or the multipart request contains more than one file. | error2 |
Check if a file resource exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/files/files/{fileId}
fetch('https://example.com/files/files/{fileId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/files/files/{fileId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/files/files/{fileId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /files/{fileId}
Determines whether a file resource exists for the specified fileId.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file resource exists. | None |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the file resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the file resource. |
Get a file resource
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId} \
-H 'Accept: application/vnd.sas.file+json'
const headers = {
'Accept':'application/vnd.sas.file+json'
};
fetch('https://example.com/files/files/{fileId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.file+json'
}
r = requests.get('https://example.com/files/files/{fileId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.file+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}
Retrieves a file resource by specifying a fileId.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
Example responses
200 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file was found and returned in the response body. | fileResource |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the file resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the file resource. |
Update a file resource
Code samples
# You can also use wget
curl -X PATCH https://example.com/files/files/{fileId} \
-H 'Content-Type: application/vnd.sas.file+json' \
-H 'Accept: application/vnd.sas.file+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"description": "string",
"documentType": "string",
"name": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.file+json',
'Accept':'application/vnd.sas.file+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/files/files/{fileId}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.file+json',
'Accept': 'application/vnd.sas.file+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.patch('https://example.com/files/files/{fileId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.file+json"},
"Accept": []string{"application/vnd.sas.file+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/files/files/{fileId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /files/{fileId}
Updates the file resource information. The user can change these attributes: name, description, parentUri, documentType, contentDisposition, properties, and expirationTimeStamp.
Body parameter
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"description": "string",
"documentType": "string",
"name": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| If-Match | header | string | false | The entity tag that was obtained from the most recent ETag response header. |
| If-Unmodified-Since | header | string | false | The timestamp that was obtained from the most recent Last-Modified response header. This is ignored when If-Match is specified. |
| fileId | path | string | true | The identifier of the file resource to update. |
| body | body | fileToPatch | true | The file resource to update. |
Example responses
200 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The updates were applied, and the new object data is returned in the response body. | fileResource |
| 400 | Bad Request | The request was not valid. A validation error occurred. Check the string that was returned in the response for more information. A possible cause is that the filename is not specified in the request body. | error2 |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag or the If-Unmodified-Since request header did not match the resource's last modified timestamp. Another operation modified the resource. Get an updated representation of the resource before trying the request again. |
error2 |
| 428 | Precondition Required | The request headers did not include a If-Match or If-Unmodified-Since precondition. Specify the appropriate values for the If-Unmodified-Since and If-Match request headers before trying the request again. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for current resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the resource. |
Delete a file resource
Code samples
# You can also use wget
curl -X DELETE https://example.com/files/files/{fileId}
fetch('https://example.com/files/files/{fileId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/files/files/{fileId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/files/files/{fileId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /files/{fileId}
Deletes the file resource.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource to delete. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The file resource was deleted. | None |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
Get file resource content
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId}/version/{fileVersion}/content \
-H 'If-Range: string' \
-H 'Range: string'
const headers = {
'If-Range':'string',
'Range':'string'
};
fetch('https://example.com/files/files/{fileId}/version/{fileVersion}/content',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'If-Range': 'string',
'Range': 'string'
}
r = requests.get('https://example.com/files/files/{fileId}/version/{fileVersion}/content', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"If-Range": []string{"string"},
"Range": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}/version/{fileVersion}/content", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}/version/{fileVersion}/content
Retrieves the content of the file resource.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource for which to fetch content. |
| fileVersion | path | integer | true | The version of the file resource for which to fetch content. |
| changeContentDisposition | query | boolean | false | Specifies whether to use the persisted content-disposition value. If this is specified to true and the word "attachment" appears in the content-disposition, it is changed to "inline". No other changes are made to the content-disposition value. |
| If-Range | header | string | false | A conditional range request. The client must specify the previously returned ETag as the If-Range header value. This determines whether the resource has been modified. If it has been modified, the entire file is returned. Otherwise, only partial content is returned using the Range header. |
| Range | header | string | false | A specific range request. The value specifies the required byte range--for example, bytes=0-100. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The stream is returned in the response body. | None |
| 206 | Partial Content | The partial content request succeeded. The requested range of data is in the response body. | None |
| 404 | Not Found | No content was found for the specified identifier or No content was found for specified version. | None |
| 416 | Range Not Satisfiable | An invalid or non-overlapping range was specified in the Range request header. |
None |
Update file resource content
Code samples
# You can also use wget
curl -X PUT https://example.com/files/files/{fileId}/content \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/vnd.sas.file+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string' \
-H 'Content-Type: string' \
-H 'Content-Disposition: string'
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/vnd.sas.file+json',
'If-Match':'string',
'If-Unmodified-Since':'string',
'Content-Type':'string',
'Content-Disposition':'string'
};
fetch('https://example.com/files/files/{fileId}/content',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/vnd.sas.file+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string',
'Content-Type': 'string',
'Content-Disposition': 'string'
}
r = requests.put('https://example.com/files/files/{fileId}/content', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/vnd.sas.file+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
"Content-Type": []string{"string"},
"Content-Disposition": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/files/files/{fileId}/content", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /files/{fileId}/content
Updates the content of the file resource.
Body parameter
file: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource for which to fetch content. |
| If-Match | header | string | false | The entity tag that was obtained from the most recent ETag response header. |
| If-Unmodified-Since | header | string | false | The timestamp that was obtained from the most recent Last-Modified response header. This is ignored when If-Match is specified. |
| Content-Type | header | string | true | The content type. Specify this as "multipart/form-data" if you are using a multipart request, or specify the actual MIME type of the file if the request is a raw data upload. |
| Content-Disposition | header | string | false | The content disposition. The previously assigned value can be changed. This indicates whether the content is expected to be displayed inline in a browser (as a web page or part of a web page) or as an attachment that is downloaded and saved locally. If a filename is specified in the header, it is used as the default name of the file. |
| body | body | object | true | none |
| » file | body | string(binary) | true | The file data. If you are using a raw data upload request, the request body should contain only the file data (the actual file content). If you are using a multipart request, the request body should be in multipart or form-data format, where the file data is listed as file in the form data. Only one file is permitted in a multipart request. |
Example responses
200 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The updates were applied, and the new file data is returned in the response body. | fileResource |
| 400 | Bad Request | The request was not valid. A validation error occurred, and the file cannot be updated. Check the response for more information. Here are common reasons for this issue: The file is empty, the file is larger than the permitted size, the file type is not supported, or the multipart request contains more than one file. | error2 |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
| 412 | Precondition Failed | The If-Match request header did not match the file resource's entity tag, or the If-Unmodified-Since request header did not match the file resource's last modified timestamp. Another operation modified the file resource. Get an updated representation of the file resource before trying the request again. |
error2 |
| 428 | Precondition Required | The request headers did not include an If-Match or If-Unmodified-Since precondition. Specify the appropriate values for the If-Unmodified-Since and If-Match request headers before trying the request again. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the file resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the file resource. |
Copy an existing file
Code samples
# You can also use wget
curl -X POST https://example.com/files/files/{fileId}/copy \
-H 'Accept: application/vnd.sas.file+json' \
-H 'Content-Disposition: string'
const headers = {
'Accept':'application/vnd.sas.file+json',
'Content-Disposition':'string'
};
fetch('https://example.com/files/files/{fileId}/copy',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.file+json',
'Content-Disposition': 'string'
}
r = requests.post('https://example.com/files/files/{fileId}/copy', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.file+json"},
"Content-Disposition": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/files/files/{fileId}/copy", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /files/{fileId}/copy
Copies the file if the user has Read access to the specified file.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource for which to fetch content. |
| Content-Disposition | header | string | false | The content disposition. The previously assigned value can be changed. This indicates whether the content is expected to be displayed inline in a browser (as a web page or part of a web page) or as an attachment that is downloaded and saved locally. If a filename is specified in the header, it is used as the default name of the file. |
| expirationTimeStamp | query | string | false | The date and time at which a file expires. If not specified, the file never expires. |
| parentFolderUri | query | string | false | The URI of the folder in which to add the file. |
Example responses
201 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The file was created and returned in the response body. | fileResource |
| 404 | Not Found | A file resource does not exist for the specified source file. | error2 |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. A file with the specified name cannot be created in the folder because the file already exists in that folder. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | ETag | string | The entity tag for the file resource. | |
| 201 | Last-Modified | string | The last modified timestamp of the file resource. | |
| 201 | Location | string | The URI of the file resource. |
Check if a file resource exists for given version
Code samples
# You can also use wget
curl -X HEAD https://example.com/files/files/{fileId}/version/{fileVersion} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/files/files/{fileId}/version/{fileVersion}',
{
method: 'HEAD',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.head('https://example.com/files/files/{fileId}/version/{fileVersion}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/files/files/{fileId}/version/{fileVersion}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /files/{fileId}/version/{fileVersion}
Determines whether a file resource exists for the specified file version of given fileId.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
| fileVersion | path | integer | true | The version of the file resource. |
Example responses
404 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file resource exists. | None |
| 404 | Not Found | No file resource exists for the specified identifier or No file version exists | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the file resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the file resource. |
Get a file resource for specified version.
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId}/version/{fileVersion} \
-H 'Accept: application/vnd.sas.file+json'
const headers = {
'Accept':'application/vnd.sas.file+json'
};
fetch('https://example.com/files/files/{fileId}/version/{fileVersion}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.file+json'
}
r = requests.get('https://example.com/files/files/{fileId}/version/{fileVersion}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.file+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}/version/{fileVersion}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}/version/{fileVersion}
Retrieves a file resource by specifying version of a fileId.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
| fileVersion | path | integer | true | The version of the file resource. |
Example responses
200 Response
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file was found and returned in the response body. | fileResource |
| 404 | Not Found | No file resource exists for the specified identifier or No file version exists | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the file resource. | |
| 200 | Last-Modified | string | The last modified timestamp of the file resource. |
Index
The operations to obtain a generic indexable representation of files.
Get indexable representations for parentUris
Code samples
# You can also use wget
curl -X POST https://example.com/files/files#fetchIndexableRepresentationCollection \
-H 'Content-Type: application/vnd.sas.selection+json' \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: string'
const inputBody = '{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.selection+json',
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'string'
};
fetch('https://example.com/files/files#fetchIndexableRepresentationCollection',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.selection+json',
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'string'
}
r = requests.post('https://example.com/files/files#fetchIndexableRepresentationCollection', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.selection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/files/files#fetchIndexableRepresentationCollection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /files#fetchIndexableRepresentationCollection
Retrieves indexable representations of files that are associated with multiple parentUri specifications. Request the parentUri values in the body. The returned collection is grouped by parentUri.
Body parameter
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | true | The value of the file resource media type. You must specify this as "application/vnd.sas.search.indexable.data". |
| body | body | selection | true | Multiple parentUri values that are specified as an array of string values. The file resources that are associated with each parentUri are retrieved. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. If files are found for the specified criteria, they are returned in a collection. If no files are found, an empty collection is returned. | fileResourceCollection |
| 400 | Bad Request | The request was not valid. A validation error occurred, and the file cannot be created. Check the response for more information. Here are common reasons for this issue: The file is empty, the file is larger than the permitted size, the file type is not supported, or the multipart request contains more than one file. | error2 |
Get indexable representations for files
Code samples
# You can also use wget
curl -X GET https://example.com/files/files#getIndexableRepresentationCollection \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'string'
};
fetch('https://example.com/files/files#getIndexableRepresentationCollection',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'string'
}
r = requests.get('https://example.com/files/files#getIndexableRepresentationCollection', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files#getIndexableRepresentationCollection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files#getIndexableRepresentationCollection
Retrieves indexable representations of file resources for the specified criteria. Standard paging, filtering, and sorting options are available.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | true | The value of the file resource media type. You must specify this as "application/vnd.sas.search.indexable.data". |
| parentUri | query | string | false | The URI of the associated object or parent object. |
| fields | query | string | false | The specific fields to return. |
| start | query | integer(int64) | false | The offset of the first member to return. The default is 0. |
| limit | query | integer(int64) | false | The maximum number of members to return. The default value is 10. |
| filter | query | string | false | The filter criteria to apply to the returned member collection. |
| sortBy | query | string | false | The sort criteria to apply to the returned member collection. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"version": 0,
"properties": [
{
"name": "string",
"value": "string"
}
],
"resourceUri": "string",
"sasType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. If files are found for the specified criteria, indexable representations are returned in a collection. If no files are found, an empty collection is returned. | fileResourceIndexCollection |
| 400 | Bad Request | The request was not valid. The limit parameter cannot be less than 0 or greater than 10000. |
error2 |
Get a generic indexable representation
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId}#getIndexableRepresentation \
-H 'Accept: application/vnd.sas.search.indexable.data+json'
const headers = {
'Accept':'application/vnd.sas.search.indexable.data+json'
};
fetch('https://example.com/files/files/{fileId}#getIndexableRepresentation',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.search.indexable.data+json'
}
r = requests.get('https://example.com/files/files/{fileId}#getIndexableRepresentation', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.search.indexable.data+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}#getIndexableRepresentation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}#getIndexableRepresentation
Retrieves a generic indexable representation of file for the specified identifier.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
Example responses
200 Response
{
"version": 0,
"properties": [
{
"name": "string",
"value": "string"
}
],
"resourceUri": "string",
"sasType": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file was found, and the indexable representation is returned in the response body. | fileResourceIndex |
| 404 | Not Found | No file resource exists for the specified the identifier. | None |
Summary
The operations to obtain a generic summary representation of files.
Get summary representations
Code samples
# You can also use wget
curl -X GET https://example.com/files/files#getSummaryRepresentationCollection \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'string'
};
fetch('https://example.com/files/files#getSummaryRepresentationCollection',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'string'
}
r = requests.get('https://example.com/files/files#getSummaryRepresentationCollection', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files#getSummaryRepresentationCollection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files#getSummaryRepresentationCollection
Retrieves summary representations of file resources for the specified criteria. Standard paging, filtering, and sorting options are available.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | true | The value of the file resource media type. You must specify this as "application/vnd.sas.summary". |
| parentUri | query | string | false | The URI of the associated object or parent object. |
| fields | query | string | false | The specific fields to return. |
| start | query | integer(int64) | false | The offset of the first member to return. The default value is 0. |
| limit | query | integer(int64) | false | The maximum number of members to return. The default value is 10. |
| filter | query | string | false | The filter criteria to apply to the returned member collection. |
| sortBy | query | string | false | The sort criteria to apply to the returned member collection. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"expirationTimeStamp": "string",
"typeDefName": "string",
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. If files are found for the specified criteria, summary representations are returned in a collection. If no files are found, an empty collection is returned. | fileResourceSummaryCollection |
| 400 | Bad Request | The request was not valid. The limit parameter cannot be less than 0 or greater than 10000. |
error2 |
Get a generic summary representation
Code samples
# You can also use wget
curl -X GET https://example.com/files/files/{fileId}#getSummaryRepresentation \
-H 'Accept: application/vnd.sas.search.summary+json'
const headers = {
'Accept':'application/vnd.sas.search.summary+json'
};
fetch('https://example.com/files/files/{fileId}#getSummaryRepresentation',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.search.summary+json'
}
r = requests.get('https://example.com/files/files/{fileId}#getSummaryRepresentation', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.search.summary+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/files/files/{fileId}#getSummaryRepresentation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /files/{fileId}#getSummaryRepresentation
Retrieves a generic summary representation of a file for the specified identifier.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| fileId | path | string | true | The identifier of the file resource. |
Example responses
200 Response
{
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"expirationTimeStamp": "string",
"typeDefName": "string",
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The file was found, and a summary representation is returned in the response body. | fileResourceSummary |
| 404 | Not Found | No file resource exists for the specified identifier. | None |
Schemas
file
"string"
File
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| File | string | false | none | The file to be uploaded. |
fileToPatch
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"description": "string",
"documentType": "string",
"name": "string"
}
File to Patch
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| parentUri | string | false | none | The URI of the object that is associated with or linked to a file resource. |
| properties | object | false | none | The properties that are specific to this file. Each property uses a "key" : "value" format. Use a comma to separate properties. |
| » additionalProperties | string | false | none | none |
| contentDisposition | string | false | none | The value for the Content-Disposition header. This is specified in response when downloading the file. |
| description | string | false | none | The description of the file resource. |
| documentType | string | false | none | The type of the file resource. |
| name | string | true | none | The name of the file resource. |
fileResourceCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
]
}
File Resource Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| File Resource Collection | any | false | none | A collection of file representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
| » name | string | false | none | The name of the collection. |
| » start | integer(int64) | false | none | The zero-based index of the first item in the collection. |
| » limit | integer | false | none | The number of items that were requested for the collection. |
| » count | integer(int64) | false | none | If populated indicates the number of items in the collection. |
| » accept | string | false | none | A space-delimited list of media types from which an Accept header may be constructed. |
| » links | [link] | false | none | The links that apply to the collection. |
| » version | integer | false | none | The version number of the collection representation. This representation is version 2. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [fileResource] | false | none | The array of application/vnd.sas.file representations. |
fileResource
{
"parentUri": "string",
"properties": {
"property1": "string",
"property2": "string"
},
"contentDisposition": "string",
"contentType": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"documentType": "string",
"encoding": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"size": 0,
"typeDefName": "string",
"searchable": true
}
File Resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| parentUri | string | false | none | The URI of the object that is associated with or linked to a file resource. |
| properties | object | false | none | Properties that are specific to this file. Each property uses a "key" : "value" format. Use a comma to separate properties. |
| » additionalProperties | string | false | none | none |
| contentDisposition | string | false | none | Value for the Content-Disposition header. It is specified in response when downloading the file. |
| contentType | string | false | none | The type of the content. |
| createdBy | string | false | none | The name of the author. |
| creationTimeStamp | string(date-time) | false | none | The timestamp that indicates when the file resource was created. |
| description | string | false | none | The description of the file resource. |
| documentType | string | false | none | The type of the file resource. |
| encoding | string | false | none | The encoding of the file resource. |
| id | string | false | none | The identifier of the file resource. |
| links | [object] | false | none | Links that apply to this file resource. The links are "self", "content", "patch", "update", and "delete". |
| » Link | object | false | none | A link to a related operation or resource. |
| »» method | string | false | none | The HTTP method for the link. |
| »» rel | string | true | none | The relationship of the link to the resource. |
| »» uri | string | false | none | The relative URI for the link. |
| »» href | string | false | none | The URL for the link. |
| »» title | string | false | none | The title for the link. |
| »» type | string | false | none | The media type or link type for the link. |
| »» itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| »» responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| »» responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
| modifiedBy | string | false | none | The name of the user who modified this file resource. |
| modifiedTimeStamp | string(date-time) | false | none | The timestamp when the file resource was modified. |
| name | string | false | none | The name of the file resource. |
| size | integer | false | none | The byte size of the file resource content. |
| typeDefName | string | false | none | The type definition name of the file. If the file is associated with a folder and the client does not provide the value of this parameter, the file-service tries to find the best possible value using the type-registry service. If it fails to find a default value, it defaults to "file". |
| searchable | boolean | false | none | It indicates if a file is searchable or not. |
fileResourceIndexCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"version": 0,
"properties": [
{
"name": "string",
"value": "string"
}
],
"resourceUri": "string",
"sasType": "string"
}
]
}
File Resource Indexable Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| File Resource Indexable Collection | any | false | none | A collection of file representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | fileResourceCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [fileResourceIndex] | false | none | The array of file indexable representations. |
fileResourceIndex
{
"version": 0,
"properties": [
{
"name": "string",
"value": "string"
}
],
"resourceUri": "string",
"sasType": "string"
}
File Resource Indexable Data
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | false | none | The version of the representation. |
| properties | [indexableDataElement] | false | none | none |
| resourceUri | string | false | none | The URI of the representation. |
| sasType | string | false | none | The sasType of the representation. |
indexableDataElement
{
"name": "string",
"value": "string"
}
Indexable Data Element
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the field. |
| value | string | false | none | The value of the field. |
fileResourceSummaryCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"expirationTimeStamp": "string",
"typeDefName": "string",
"version": 0
}
]
}
File Resource Summary Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| File Resource Summary Collection | any | false | none | A collection of file representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | fileResourceCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [fileResourceSummary] | false | none | The array of file resource summary representations. |
fileResourceSummary
{
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"name": "string",
"expirationTimeStamp": "string",
"typeDefName": "string",
"version": 0
}
File Resource Summary
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| createdBy | string | false | none | The name of the author. |
| creationTimeStamp | string(date-time) | false | none | The timestamp that indicates when the file resource was created. |
| description | string | false | none | The description of the file resource. |
| id | string | false | none | The identifier of the file resource. |
| links | [link] | false | none | The alternate link to fetch the complete representation of the file resource--for example, vnd.sas.file. |
| modifiedBy | string | false | none | The name of the user who modified the file resource. |
| modifiedTimeStamp | string(date-time) | false | none | The timestamp that indicates when the file resource was modified. |
| name | string | false | none | The name of the file. |
| expirationTimeStamp | string | false | none | The timestamp that indicates when the file expires. |
| typeDefName | string | false | none | The type definition name of the fileIf the file is associated with a folder and the client does not provide the value of this parameter, the file-service tries to find the best possible value using type-registry service. If it fails to find a default value, it defaults to "file". |
| version | integer | false | none | The version of the media type. |
error2
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | false | none | The message for the error. |
| id | string | false | none | The string ID for the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| errors | [error2] | false | none | Any additional errors that occurred. |
| links | [link] | false | none | The links that apply to the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
selection
{
"version": 0,
"template": "https://example.com",
"type": "id",
"resources": [
"string"
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Selection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | true | none | The schema version number of this media type. This representation is version 1. |
| template | string(uri) | false | none | A URI template in which the {id} parameter can be replaced with a value from the "resources" array in order to yield the URI of the identified resource. |
| type | string | false | none | Specifies whether the resources array contains IDs, URIs, or both.
|
| resources | [string] | true | none | An array of resource IDs or URIs |
| links | [link] | false | none | An array of links to related resources and actions. |
Enumerated Values
| Property | Value |
|---|---|
| type | id |
| type | uri |
| type | mixed |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.file
Provides metadata about the file resource. Here is the schema: file Resource
application/vnd.sas.file+json
Here is an example of the JSON representation of this media type.
{
"creationTimeStamp": "2017-10-31T10:12:12.164Z",
"modifiedTimeStamp": "2017-10-31T10:12:47.097Z",
"createdBy": "bob",
"modifiedBy": "bob",
"id": "317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"parentUri": "/reports/reports/9504285d-5ee5-4754-8430-730ffab4d7e5",
"properties": {
"myprop2": "propVal2",
"myprop1": "propVal1",
"myprop4": "propVal4",
"myprop3": "propVal3"
},
"contentDisposition": "attachment; filename=Attributes.csv;",
"contentType": "text/plain",
"description": "This file is created for temporary purpose",
"documentType": "Plain_TextDoc",
"encoding": "UTF-8",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"type": "application/vnd.sas.file"
},
{
"method": "GET",
"rel": "alternate",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"type": "application/vnd.sas.summary"
},
{
"method": "PATCH",
"rel": "patch",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"type": "application/vnd.sas.file",
"responseType": "application/vnd.sas.file"
},
{
"method": "PUT",
"rel": "update",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"type": "application/vnd.sas.file",
"responseType": "application/vnd.sas.file"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0"
},
{
"method": "GET",
"rel": "content",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0/content",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0/content",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "updateContent",
"href": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0/content",
"uri": "/files/files/317359c7-f70e-49fb-95a7-78fb2e02c0f0/content",
"type": "*/*",
"responseType": "application/vnd.sas.file"
},
{
"method": "POST",
"rel": "create",
"href": "/files/files",
"uri": "/files/files",
"type": "*/*",
"responseType": "application/vnd.sas.file"
}
],
"name": "TempFile",
"fileVersion":0,
"fileStatus":unlocked
"size": 4918,
"expirationTimeStamp": "2017-12-04T15:14:40.084Z",
"version": 4
}
application/vnd.sas.api
Contains top-level links for an API. See application/vnd.sas.api.
application/vnd.sas.collection
A paginated, filterable, sortable collection of resource representations. See application/vnd.sas.collection.
application/vnd.sas.selection
Identifies a set of resources. See application/vnd.sas.selection.
Resource Relationships
Here are the File resources and its related attributes.
| Type | Attribute | Description |
|---|---|---|
| String | id |
The identifier for the file. This is specified internally and cannot be changed. |
contentType |
The content type of the source file. This is specified and managed internally. | |
createdBy |
The owner of the file. This is specified internally and cannot be changed. | |
encoding |
The character encoding of the content. This is specified and managed internally. | |
modifiedBy |
The user who last modified the file. This is specified and managed internally. | |
name |
The name of the file. This is initialized internally and can be changed after initialization. | |
parentUri |
The reference URI of the parent, owner, or associated object. The end user manages this. | |
contentDisposition |
The content disposition to use while downloading the file. The end user manages this. | |
description |
A brief description of the files. The end user manages this. | |
documentType |
The document type of the file. The end user manages this. | |
searchable |
Indicates if a file is searchable or not through search service. | |
expirationTimeStamp |
The date and time at which the file expires or is deleted. The end user manages this. | |
fileStatus |
The status of the file whether locked or unlocked. The end user manages this. | |
| Date | creationTimeStamp |
The date of file creation. This is specified internally and cannot be changed. |
modifiedTimeStamp |
The date on which the file was last modified. This is specified and managed internally. | |
| Numeric | fileVersion |
The version of the file. If file is version control then set to any value greater then 0.The end user manages this. |
| List | <Link> links |
A collection of links that represent the supported operations for the current resource. These links are supported:self: GET - A link to retrieve the file metadata.patch: PATCH - A link to update the file metadata.delete: DELETE - A link to delete the current file resource.content: GET - A link to download the actual content of the file.updateContent: PUT - A link to update the actual content of the file. |
| Long | size |
The size of the actual content. This is specified and managed internally. |
| Map | <String, String> properties |
A mapping of key/value pairs that you can use to provide more information about the file. The end user manages this. |
Root
Path: /
The root of the API. This resource contains links to the top-level resources in the API.
Links
The GET / response includes these links.
| Relation | Method | Description |
|---|---|---|
| checkState | HEAD | Checks the state of the service. URI: /files/files Response type: [ application/json] |
| create | POST | Uploads a file. Note that Type */* indicates that the content-type is dynamic. The end user must provide the actual content-type to the File service, not */*. URI: /files/files Request type: */* Response type: application/vnd.sas.file |
| files | GET | Returns a collection of files. URI: /files/files Response type: application/vnd.sas.collection |
| bulkFiles | POST | Returns a collection of files for multiple parentUri entries using application/vnd.sas.selection in the request body. URI: /files/files Request type: application/vnd.sas.selection Response type: application/vnd.sas.collection |
File
Path: /files/{fileId}
This endpoint returns the file resource or the file metadata.
Links
These are the links from the file resource.
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the meta representation of the file resource. URI: /files/files/{fileId} Response type: [ application/vnd.sas.file] |
| alternate | GET | Returns the summary representation of the file resource. URI: /files/files/{fileId} Response type: [ application/vnd.sas.summary] |
| content | GET | Downloads the actual content of the file. The type is the contentType from vnd.sas.file. URI: /files/files/{fileId}/content Response type: [ */*] |
| update | PUT | Updates the meta information of the file resource. URI: /files/files/{fileId} Request type: application/vnd.sas.file Response type: application/vnd.sas.file |
| patch | PATCH | Updates the meta information of the file resource. URI: /files/files/{fileId} Request type: application/vnd.sas.file Response type: application/vnd.sas.file |
| updateContent | PUT | Updates the actual content of the file. Note that Type */* indicates that content-type is dynamic. The end user must pass on actual content-type to file service, not */*. URI: /files/files/{fileId}/content Request type: */* Response type: application/vnd.sas.file |
| delete | DELETE | Removes the file resource. URI: /files/files/{fileId} |
| create | POST | Uploads a file. Note that Type */* indicates that content-type is dynamic. The end user must pass on actual content-type to file service, not */*. URI: /files/files Request type: */* Response type: application/vnd.sas.file |
| copyFile | POST | If the user has Read access to the file, copies the file. URI: /files/files/{fileId}/copy Response type: application/vnd.sas.file |
File Collection
Path: /files
This endpoint returns the collection of file resource.
Links
These are the links from the collection.
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the current page from the collection. |
| prev | GET | Returns the previous page of the collection. This link is omitted if the current view is on the first page. |
| next | GET | Returns the next page of the collection. This link is omitted if the current view is on the last page. |
| first | GET | Returns the first page of the collection. This link is omitted if the current view is on the first page. |
Folders
Base URLs:
https://example.com/folders
https://example.com/folders
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Folders API provides an organizational structure for SAS and external content. It can also be used for favorites folders or a history of objects accessed. The resources that are stored in folders (members) use a URI to point back to those resources.
Usage Notes
Overview
The Folders API is used to create a virtual folder hierarchy for organizing and presenting resources. There is no physical backing structure, such as a file system, DAV, or JCR. The Folders API persists only the URI of resources that are managed by other persistence services. In general, the persistence services and the Folders API do not know about each other. The persistence services that own the resources that are members of the folders know nothing directly about the Folders API, and the Folders API knows nothing of the persistence services. This design maintains the loose coupling that is a fundamental concept of the microservices architecture.
There are two exceptions where a persistence service and the Folders service know about each other:
The persistence service knows about the Folders service when the persistence service is creating a new object. The persistence service might implement the Creating objects in folders as a single transaction pattern, which accepts a parentFolderURI query parameter and makes a call to the Folders API to add the new object to the specified folder as a child member. If the member creation fails, the persistence service cleans up the newly created resource and returns a proper response that indicates why the member could not be created.
The exception to the Folders API knowing about the persistence service is the event consumer. The Folders API listens for change events (for example, an UPDATE or DELETE). If an object that is a child of a folder changes, it tries to retrieve the summary (application/vnd.sas.summary) representation of the object and, if successful, updates the object's name, description, and modified time stamp. The summary type should normally be recognized by content persistence services. If the persistence service does not answer to the summary media type, or if any other error occurs, the member is not updated. If the persistence service does not allow automatic updating by the folders service, a client uses the PUT operation to update members with changes in the content.
Folder Types to Specify for the Type Field
There are three types of folders you can use in the type field:
folder - This is just a basic folder, with no particular restrictions. If the type is not specified, this is the default value.
favoritesFolder - This type of folder can hold only reference members, or other favoritesFolders. Attempting to add a child of any other type results in an error response.
historyFolder - This type of folder can contain only references. The folder has a property of "maxMembers" that limits the number of members the folder can hold. The default value of maxMembers is 40. When maxMembers is reached, members are evicted when a new member is added following this policy: 1) the member with the highest value of OrderNum and 2) the member with the oldest time stamp. History folders respond to some special endpoints under the /folders/{folderId}/histories path. These endpoints provide special behavior when adding or updating history entries. A POST to /folders/{folderId}/histories "touches" the entry. That is, a POST creates a history entry if it is not there or updates the history entry's data, including the added attribute, if it already exists (based on an exact match of the uri field).
Folder Types that Are Returned when Creating a Folder
These three special folder types are returned and cannot be specified when creating a folder.
userFolder - One folder of this type is created per user, named for the user's user name. This folder is the parent of the other special folders.
myFolder - Users have one folder of this type for storing items that they do not want to share with other users. Items in this folder are not visible to other users except administrative users.
applicationDataFolder - This folder is used by applications to store data specific to one user.
All GET operations have a corresponding HEAD with identical signature and semantics except the resource body is not returned.
Rules for Folders and Folder Members
Folders are not managed on a per-user basis. In other words, in general, folders are intended to be shared by some group of users. The exception is the user folder and the special folders that are stored under the user folder (myFolder, appDataFolder, myHistory, and myFavorites). Those folders are intended solely for the use of the user for which they were created. Authorizations are created to enforce that level of access.
There are two types of folder members: child and reference. A given resource URI can exist as a child in only one folder. An attempt to create a child member with the same URI in a second folder results in a 412 response (precondition failed). If it is already in the same parent folder, a 409 response (conflict) is returned. A resource URI can exist as a reference member in as many folders as desired. When an attempt is made to delete a folder, only child members are considered when testing whether the folder is empty. Likewise, only child members are considered when retrieving ancestors.
Error Codes
| HTTP Status Code | Error Code | Description |
|---|---|---|
| 400 | 1000 | The member could not be created. |
| 400 | 1009 | The identifier in the query did not match the identifier in the request body. |
| 400 | 1013 | The string in the If-Match header did not match the calculated ETag for the folder. |
| 400 | 1014 | The date in the If-Unmodified-Since is before the date in the folder. |
| 400 | 1177 | An invalid folder object was provided on a create or update operation. |
| 400 | 11502 | No path items were provided in the path request. |
| 400 | 11503 | No content type was provided in the path request. |
| 400 | 11508 | The @item resource wildcard requires exactly one parameter (either path or childUri). |
| 400 | 11509 | The resource wildcard returned multiple results. |
| 400 | 11510 | The resource wildcard path must start with a slash. |
| 400 | 11511 | The resource wildcard path must have at least one element other than '/'. |
| 400 | 11518 | A childUri must be specified when requesting ancestors. |
| 400 | 11523 | A history-specific operation was attempted on a non-history folder. |
| 400 | 11526 | An invalid name was provided for a folder. member. |
| 400 | 11527 | An invalid URI was provided for a folder. member. |
| 400 | 11528 | An invalid member type was provided for a folder member. |
| 400 | 11529 | An attempt was made to add a child member to a folder that is allowed to contain only reference members. |
| 400 | 11530 | The abortOnMetadataFailure option was specified, and the GET of the resource failed. |
| 400 | 11531 | Members cannot be created in the RecycleBin (trash) folder. |
| 400 | 11532 | Only a folder can exist at the root of the hierarchy. |
| 400 | 11533 | The member provided is invalid for the type of parent folder. |
| 400 | 11535 | The parentFolderUri that was provided was invalid for a folder. |
| 400 | 11540 | An attempt was made to move or rename a folder that is marked to disallow that action. |
| 400 | 11541 | A folder cannot be its own parent. |
| 400 | 11542 | The user in the security context is not a valid identity. |
| 400 | 11543 | An invalid delegate was specified. |
| 400 | 11544 | The /Users folder could not be created. |
| 400 | 11545 | The user does not have permission to delete a folder and all of its children. |
| 400 | 11550 | The specified folder name is too long. |
| 400 | 11551 | The specified folder name has a leading or trailing space. |
| 400 | 11552 | There is already a member with the same name and type in the parent or root folder. |
| 403 | 11513 | Add permission is required to add a member to a folder. |
| 403 | 11514 | Remove permission is required to remove a member from a folder. |
| 404 | 11500 | The specified folder could not be found. |
| 404 | 11501 | The specified folder member could not be found. |
| 404 | 11504 | There is no member at the path provided. |
| 404 | 11512 | The resource wildcard returned no results. |
| 404 | 11519 | The requested URI was not found as a child in any folder. |
| 409 | 11534 | The URI in a new child member already exists as a child in another folder. |
| 412 | 11515 | A folder must be empty in order to delete it, unless recursive is specified. |
Operations
Root
Contains the operations for the root resource.
Get a list of top-level links
Code samples
# You can also use wget
curl -X GET https://example.com/folders/ \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/folders/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/folders/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level collections surfaced through this API. These top-level links include /folders and /ancestors.
Example responses
Here is an example of using the GET request to retrieve the application/vnd.sas.api+json representation of the APIs top-level links.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "folders",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "createFolder",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "rootFolders",
"href": "/folders/rootFolders",
"uri": "/folders/rootFolders",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "folderTypes",
"href": "/folders/folderTypes",
"uri": "/folders/folderTypes",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "delegateInfo",
"href": "/folders/delegateInfo",
"uri": "/folders/delegateInfo",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "delegateFolders",
"href": "/folders/delegateFolders",
"uri": "/folders/delegateFolders",
"type": "application/vnd.sas.collection"
},
{
"method": "PUT",
"rel": "validateRootFolderName",
"href": "/folders/commons/validations/folders/@root/members/@new/name?value={newname}&type=folder",
"uri": "/folders/commons/validations/folders/@root/members/@new/name?value={newname}&type=folder",
"type": "application/vnd.sas.validation"
},
{
"method": "GET",
"rel": "ancestors",
"href": "/folders/ancestors?childUri={resourceUri}",
"uri": "/folders/ancestors?childUri={resourceUri}",
"type": "application/vnd.sas.content.folder.ancestor"
},
{
"method": "GET",
"rel": "myFolder",
"href": "/folders/folders/@myFolder",
"uri": "/folders/folders/@myFolder",
"type": "application/vnd.sas.content.folder",
"title": "My Folder for current user"
},
{
"method": "GET",
"rel": "myHistory",
"href": "/folders/folders/@myHistory",
"uri": "/folders/folders/@myHistory",
"type": "application/vnd.sas.content.folder",
"title": "My History folder for current user"
},
{
"method": "GET",
"rel": "myFavorites",
"href": "/folders/folders/@myFavorites",
"uri": "/folders/folders/@myFavorites",
"type": "application/vnd.sas.content.folder",
"title": "My Favorites folder for current user"
},
{
"method": "GET",
"rel": "appData",
"href": "/folders/folders/@appDataFolder",
"uri": "/folders/folders/@appDataFolder",
"type": "application/vnd.sas.content.folder",
"title": "Application data folder for current user"
},
{
"method": "GET",
"rel": "recycleBin",
"href": "/folders/folders/@myRecycleBin",
"uri": "/folders/folders/@myRecycleBin",
"type": "application/vnd.sas.content.folder",
"title": "Recycle Bin folder for current user"
},
{
"method": "GET",
"rel": "public",
"href": "/folders/folders/@public",
"uri": "/folders/folders/@public",
"type": "application/vnd.sas.content.folder",
"title": "Public folder"
},
{
"method": "GET",
"rel": "products",
"href": "/folders/folders/@products",
"uri": "/folders/folders/@products",
"type": "application/vnd.sas.content.folder",
"title": "Products folder"
},
{
"method": "PUT",
"rel": "validateName",
"href": "/folders/commons/validations/folders/@new/name?value={newname}&parentFolderUri={parentFolderUri}",
"uri": "/folders/commons/validations/folders/@new/name?value={newname}&parentFolderUri={parentFolderUri}",
"type": "application/vnd.sas.content.folder",
"title": "Validate new folder name"
},
{
"method": "POST",
"rel": "createSubfolder",
"href": "/folders/folders?parentFolderUri=/folders/folders/{parentId}",
"uri": "/folders/folders?parentFolderUri=/folders/folders/{parentId}",
"type": "application/vnd.sas.content.folder"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | folderCollection |
Folder
Contains the operations for the folder resource.
Get a list of root folders
Code samples
# You can also use wget
curl -X GET https://example.com/folders/rootFolders \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/folders/rootFolders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/folders/rootFolders', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/rootFolders", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /rootFolders
Returns a list of root folders. Standard paging, filtering, and sorting options are provided.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer | false | 0-based offset of first folder to return. The default value is 0. |
| limit | query | integer | false | Maximum number of folders to return. The default value is 20. |
| filter | query | string(filter-criteria) | false | Filter criteria for returned folders. See Filtering in REST APIs. Any member of the Folder object can be used to filter the results: id, name, description, createdBy, modifiedBy, properties, folderType, or parent. Date fields currently cannot be used to filter results. |
| sortBy | query | string(sort-criteria) | false | Sort returned folder. See Sorting in REST APIs. The default sort order is name:ascending. Other valid sorting options are added the timestamp when the item was added to the foldername the folder name |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | folderCollection |
| 400 | Bad Request | The request was invalid. An invalid filter or combination of request parameters was provided. | errorResponse |
Get a list of folders
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folders \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string' \
-H 'Accept-Item: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string',
'Accept-Item':'string'
};
fetch('https://example.com/folders/folders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string',
'Accept-Item': 'string'
}
r = requests.get('https://example.com/folders/folders', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
"Accept-Item": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folders", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folders
Returns a list of folders. Standard paging, filtering, and sorting options are provided.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer | false | 0-based offset of first folder to return. The default value is 0. |
| limit | query | integer | false | Maximum number of folders to return. The default value is 20. |
| filter | query | string(filter-criteria) | false | Filter criteria for returned folders. See Filtering in REST APIs. Any member of the Folder object can be used to filter the results: id, name, description, createdBy, modifiedBy, properties, folderType, or parent. Date fields currently cannot be used to filter results. Sample queries
|
| sortBy | query | string(sort-criteria) | false | Sort returned folder. See Sorting in REST APIs. The default sort order is name:ascending. Other valid sorting options are
|
| childUri | query | string(relative URI) | false | Return only folders containing a child member with the specified URI. For now, childUri, referenceUri, memberUri, and filter are mutually exclusive. The childUri has special semantics, because it should return only a single item. The URL form /folders/.?childUri={resourceUri} can be used to return a single item. |
| referenceUri | query | string(relative URI) | false | Return only folders containing a reference member with the specified URI. For now, childUri, referenceUri, memberUri, and filter are mutually exclusive. |
| memberUri | query | string(relative URI) | false | Return only folders containing any member with the specified URI. For now, childUri, referenceUri, memberUri, and filter are mutually exclusive. |
| Accept-Language | header | string | false | Enumerates the languages that the client prefers to use for the response. This can be used to provide localized data where available. |
| Accept-Item | header | string | false | If provided, this should be an alternative media type that the service recognizes. If the media type is not one that the service can provide, a 406 response is returned. |
Example responses
Here is an example of using a GET request to page through folder results.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "self",
"href": "/folders/folders?start=0&limit=20",
"uri": "/folders/folders?start=0&limit=20",
"type": "application/vnd.sas.collection"
},
{
"method": "POST",
"rel": "createFolder",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.content.folder",
"responseType": "application/vnd.sas.content.folder"
}
],
"name": "folders",
"accept": "application/vnd.sas.content.folder",
"start": 0,
"items": [
{
"creationTimeStamp": "2020-10-27T16:26:54.618197Z",
"createdBy": "bob",
"modifiedTimeStamp": "2020-10-27T16:26:54.618198Z",
"modifiedBy": "bob",
"version": 1,
"id": "b156020a-83f1-41c2-9d63-fe49780526dc",
"name": "Samples",
"parentFolderUri": "/folders/folders/804ea126-e12b-42ee-b9c4-40cb79db222b",
"type": "folder",
"memberCount": 7,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"type": "application/vnd.sas.content.folder"
},
{
"method": "PUT",
"rel": "update",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"type": "application/vnd.sas.content.folder",
"responseType": "application/vnd.sas.content.folder"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc"
},
{
"method": "DELETE",
"rel": "deleteRecursively",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc?recursive=true",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc?recursive=true"
},
{
"method": "GET",
"rel": "members",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.content.folder"
},
{
"method": "POST",
"rel": "addMember",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members",
"type": "application/vnd.sas.content.folder.member",
"responseType": "application/vnd.sas.content.folder.member"
},
{
"method": "GET",
"rel": "up",
"href": "/folders/folders/804ea126-e12b-42ee-b9c4-40cb79db222b",
"uri": "/folders/folders/804ea126-e12b-42ee-b9c4-40cb79db222b",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "ancestors",
"href": "/folders/ancestors?childUri=/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/ancestors?childUri=/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"type": "application/vnd.sas.content.folder.ancestor"
},
{
"method": "POST",
"rel": "createChild",
"href": "/folders/folders?parentFolderUri=/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders?parentFolderUri=/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"type": "application/vnd.sas.content.folder"
},
{
"method": "PUT",
"rel": "validateRename",
"href": "/folders/commons/validations/folders/804ea126-e12b-42ee-b9c4-40cb79db222b/members/0ab9120e-2cbc-4de8-8b6e-e8d81b60d982/name?value={newname}&type=folder",
"uri": "/folders/commons/validations/folders/804ea126-e12b-42ee-b9c4-40cb79db222b/members/0ab9120e-2cbc-4de8-8b6e-e8d81b60d982/name?value={newname}&type=folder",
"type": "application/vnd.sas.validation"
},
{
"method": "PUT",
"rel": "validateNewMemberName",
"href": "/folders/commons/validations/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members/@new/name?value={newname}&type={newtype}",
"uri": "/folders/commons/validations/folders/b156020a-83f1-41c2-9d63-fe49780526dc/members/@new/name?value={newname}&type={newtype}",
"type": "application/vnd.sas.validation"
},
{
"method": "GET",
"rel": "transferExport",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"responseType": "application/vnd.sas.transfer.object"
},
{
"method": "PUT",
"rel": "transferImportUpdate",
"href": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"uri": "/folders/folders/b156020a-83f1-41c2-9d63-fe49780526dc",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
},
{
"method": "POST",
"rel": "transferImport",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
}
]
},
{
"<item 2>": null
},
{
"<item 3>": null
},
{
"etc. to item 20": null
}
],
"limit": 20,
"version": 2
}
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Here is an example of using a GET request for @myFolder.
{
"creationTimeStamp": "2019-08-08T12:53:51.309Z",
"modifiedTimeStamp": "2019-08-08T12:53:51.309Z",
"createdBy": "testuser",
"modifiedBy": "testuser",
"id": "6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"name": "My Folder",
"parentFolderUri": "/folders/folders/f210f767-7f3a-4109-849b-f1b7d1c5d11a",
"description": "My Folder for testuser",
"type": "myFolder",
"memberCount": 0,
"properties": {
"allowMove": "false"
},
"links": [
{
"method": "GET",
"rel": "self",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "up",
"href": "/folders/folders/f210f767-7f3a-4109-849b-f1b7d1c5d11a",
"uri": "/folders/folders/f210f767-7f3a-4109-849b-f1b7d1c5d11a",
"type": "application/vnd.sas.content.folder"
},
{
"method": "PUT",
"rel": "validateNewMemberName",
"href": "/folders/commons/validations/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/@new/name?value={newname}&type={newtype}",
"uri": "/folders/commons/validations/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/@new/name?value={newname}&type={newtype}"
},
{
"method": "GET",
"rel": "ancestors",
"href": "/folders/ancestors?childUri=/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/ancestors?childUri=/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"type": "application/vnd.sas.content.folder.ancestor"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d"
},
{
"method": "DELETE",
"rel": "deleteRecursively",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d?recursive=true",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d?recursive=true"
},
{
"method": "GET",
"rel": "members",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.content.folder.member"
},
{
"method": "POST",
"rel": "addMember",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"type": "application/vnd.sas.content.folder.member"
},
{
"method": "POST",
"rel": "createChild",
"href": "/folders/folders?parentFolderUri=/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders?parentFolderUri=/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "transferExport",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"responseType": "application/vnd.sas.transfer.object"
},
{
"method": "PUT",
"rel": "transferImportUpdate",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
}
],
"version": 1
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | folder |
| 400 | Bad Request | The request was invalid. An invalid filter or combination of request parameters was provided. | errorResponse |
Create a new folder
Code samples
# You can also use wget
curl -X POST https://example.com/folders/folders?parentFolderUri=string \
-H 'Content-Type: application/vnd.sas.content.folder+json' \
-H 'Accept: application/vnd.sas.content.folder+json'
const inputBody = '{
"name": "A new folder"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder+json',
'Accept':'application/vnd.sas.content.folder+json'
};
fetch('https://example.com/folders/folders?parentFolderUri=string',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder+json',
'Accept': 'application/vnd.sas.content.folder+json'
}
r = requests.post('https://example.com/folders/folders', params={
'parentFolderUri': 'string'
}, headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder+json"},
"Accept": []string{"application/vnd.sas.content.folder+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/folders/folders", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /folders
Creates a new empty folder. Members can be added to the folder using the /folders/{folderId}/members endpoint. This service maintains name uniqueness at any given level in the folder structure. In other words, if you try to create a root folder named "newRootFolder", and a root folder with that name exists, the operation fails with a 409 status. If you try to create a subfolder using the ?parentFolderUri parameter, and the parent already has a subfolder with the same name, the operation fails with a 409 status.
Body parameter
Sample body when creating new folder.
{
"name": "A new folder"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| parentFolderUri | query | string(relative URI) | true | URI of folder to add new folder as a child. This parameter is required. An explicit value of "none" indicates that the client wants to create a root folder. |
| body | body | #/components/requestBodies/folderIn | false | none |
Example responses
Here is an example of using a POST request to create a new folder in the parentFolder @myFolder
{
"creationTimeStamp": "2019-08-08T12:55:20.420Z",
"modifiedTimeStamp": "2019-08-08T12:55:20.420Z",
"createdBy": "testuser",
"modifiedBy": "testuser",
"id": "f3277e88-01f2-4f2f-9ce2-cb575e849238",
"name": "Test Folder 1",
"parentFolderUri": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
"type": "folder",
"memberCount": 0,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "up",
"href": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
"uri": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
"type": "application/vnd.sas.content.folder"
},
{
"method": "PUT",
"rel": "validateRename",
"href": "/folders/commons/validations/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450/members/35def691-e932-4bf2-a38a-9f38e906eb5e/name?value={newname}&type=folder",
"uri": "/folders/commons/validations/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450/members/35def691-e932-4bf2-a38a-9f38e906eb5e/name?value={newname}&type=folder"
},
{
"method": "PUT",
"rel": "validateNewMemberName",
"href": "/folders/commons/validations/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members/@new/name?value={newname}&type={newtype}",
"uri": "/folders/commons/validations/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members/@new/name?value={newname}&type={newtype}"
},
{
"method": "GET",
"rel": "ancestors",
"href": "/folders/ancestors?childUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/ancestors?childUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"type": "application/vnd.sas.content.folder.ancestor"
},
{
"method": "PUT",
"rel": "update",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"type": "application/vnd.sas.content.folder",
"responseType": "application/vnd.sas.content.folder"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238"
},
{
"method": "DELETE",
"rel": "deleteRecursively",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238?recursive=true",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238?recursive=true"
},
{
"method": "GET",
"rel": "members",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.content.folder.member"
},
{
"method": "POST",
"rel": "addMember",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
"type": "application/vnd.sas.content.folder.member"
},
{
"method": "POST",
"rel": "createChild",
"href": "/folders/folders?parentFolderUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders?parentFolderUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "transferExport",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"responseType": "application/vnd.sas.transfer.object"
},
{
"method": "PUT",
"rel": "transferImportUpdate",
"href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
},
{
"method": "POST",
"rel": "transferImport",
"href": "/folders/folders",
"uri": "/folders/folders",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
}
],
"version": 1
}
201 Response
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A folder was created. | folder |
| 400 | Bad Request | The request was invalid. The parentFolderUri is not a valid folder, or does not exist. A malformed request body also returns this status. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI of the newly created folder. | |
| 201 | Etag | string | A tag that identifies this revision of this object. |
Get a folder with a path or a child URI
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folders/@item \
-H 'Accept: application/vnd.sas.content.folder+json'
const headers = {
'Accept':'application/vnd.sas.content.folder+json'
};
fetch('https://example.com/folders/folders/@item',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.content.folder+json'
}
r = requests.get('https://example.com/folders/folders/@item', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.content.folder+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folders/@item", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folders/@item
Get a folder with a resource wildcard. Either a path or a child URI is required. The result must be exactly one matching folder. If the childUri parameter is provided, the parent folder of the member with the matching URI is returned, if it exists. If the path is provided, it must be a slash-delimited path to the desired folder.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| childUri | query | string | false | The URI of a resource whose parent folder you want to return. This can be a folder or non-folder resource. |
| path | query | string | false | The slash-delimited path to a folder. For example, /root/child/grandchild/greatgrandchild would return the folder greatgrandchild. |
Example responses
200 Response
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The folder was found and returned. | folder |
| 400 | Bad Request | The request was invalid. Either no path or childUri was provided in the request, or the request was not formatted correctly. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. No folder that matches the criteria exists. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | the ISO8601 date string representing the timestamp of the last update to this folder. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Get a folder
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folders/{folderId} \
-H 'Accept: application/vnd.sas.content.folder+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.content.folder+json',
'Accept-Language':'string'
};
fetch('https://example.com/folders/folders/{folderId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.content.folder+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/folders/folders/{folderId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.content.folder+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folders/{folderId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folders/{folderId}
Returns the specified folder.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder or one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| Accept-Language | header | string | false | Enumerates the languages that the client prefers to use for the response. This can be used to provide localized data where available. |
Example responses
200 Response
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The folder was returned. | folder |
| 400 | Bad Request | The request was invalid. An invalid delegate string was specified. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The RFC 1123 date string representing the timestamp of the last update to this folder. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Delete a folder
Code samples
# You can also use wget
curl -X DELETE https://example.com/folders/folders/{folderId} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/folders/folders/{folderId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.delete('https://example.com/folders/folders/{folderId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/folders/folders/{folderId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /folders/{folderId}
The specified folder is deleted. If the folder is not empty, a recursive option can be specified to indicate a recursive delete. If the folder is not empty and no recursive option is present, an error response will be returned. Any non-folder content will not be deleted.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder or one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| recursive | query | boolean | false | do a recursive delete of the folder |
Example responses
400 Response
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The folder was deleted. | None |
| 400 | Bad Request | The request was invalid. The folder was not empty, and recursive=true was not specified. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. The folder has children, and recursive=true was not specified, or the folder contains non-folder children. | errorResponse |
Update a folder
Code samples
# You can also use wget
curl -X PUT https://example.com/folders/folders/{folderId} \
-H 'Content-Type: application/vnd.sas.content.folder+json' \
-H 'Accept: application/vnd.sas.content.folder+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"name": "Test Folder 1",
"description": "A Test Folder",
"type": "folder"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder+json',
'Accept':'application/vnd.sas.content.folder+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/folders/folders/{folderId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder+json',
'Accept': 'application/vnd.sas.content.folder+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.put('https://example.com/folders/folders/{folderId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder+json"},
"Accept": []string{"application/vnd.sas.content.folder+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/folders/folders/{folderId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /folders/{folderId}
Replaces an existing folder.
Body parameter
{
"name": "Test Folder 1",
"description": "A Test Folder",
"type": "folder"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| If-Match | header | string | false | The ETag that was returned from a GET, POST, or PUT of this folder. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the folder. If the folder has been updated since this time, the update fails. |
| body | body | folderIn | true | Folder |
Example responses
200 Response
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The folder was updated. | folder |
| 400 | Bad Request | The request was invalid. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified timestamp. |
errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this folder. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Make a partial update to a folder
Code samples
# You can also use wget
curl -X PATCH https://example.com/folders/folders/{folderId} \
-H 'Content-Type: application/vnd.sas.content.folder+json' \
-H 'Accept: application/vnd.sas.content.folder+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"name": "Test Folder 1",
"description": "A Test Folder",
"type": "folder"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder+json',
'Accept':'application/vnd.sas.content.folder+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/folders/folders/{folderId}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder+json',
'Accept': 'application/vnd.sas.content.folder+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.patch('https://example.com/folders/folders/{folderId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder+json"},
"Accept": []string{"application/vnd.sas.content.folder+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/folders/folders/{folderId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /folders/{folderId}
Updates the provided fields of a folder. The client can provide a sparsely populated object, and only the non-null fields contribute to the updates. A body such as { "name": "NewFolderName" } causes the folder to have its name changed, but no other field is affected. The full resulting object is returned in the response.
Body parameter
{
"name": "Test Folder 1",
"description": "A Test Folder",
"type": "folder"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| If-Match | header | string | false | The ETag that was returned from a GET, POST, or PUT of this folder. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the folder. If the folder has been updated since this time, the update fails. |
| body | body | folderIn | true | A sparsely populated Folder object. Only the fields being updated need to be provided. |
Example responses
200 Response
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The folder was updated. | folder |
| 400 | Bad Request | The request was invalid. The JSON was malformed, or invalid for the request. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. Changing the name as requested would cause a naming conflict. | errorResponse |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified timestamp. |
errorResponse |
| 422 | Unprocessable Entity | The request cannot be processed. One or more elements of the body are invalid. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The RFC 1123 date string representing the timestamp of the last update to this folder. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Get the folders for a given set of delegate names
Code samples
# You can also use wget
curl -X GET https://example.com/folders/delegateFolders \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/folders/delegateFolders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://example.com/folders/delegateFolders', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/delegateFolders", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /delegateFolders
Returns the folders for the given set of delegate names, or all delegate folders if no names are provided.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| name | query | string | false | The name of the delegate (including the leading '@') desired. Multiple values of the name parameter can be provided. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | folderCollection |
Find an object by path
Code samples
# You can also use wget
curl -X POST https://example.com/folders/paths \
-H 'Content-Type: application/vnd.sas.content.folder.path+json' \
-H 'Accept: application/vnd.sas.summary+json'
const inputBody = '{
"items": [
"string"
],
"contentType": "string",
"typeDefName": "string",
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder.path+json',
'Accept':'application/vnd.sas.summary+json'
};
fetch('https://example.com/folders/paths',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder.path+json',
'Accept': 'application/vnd.sas.summary+json'
}
r = requests.post('https://example.com/folders/paths', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder.path+json"},
"Accept": []string{"application/vnd.sas.summary+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/folders/paths", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /paths
Find an object, if it exists, by path. The client provides an ordered list of parent folder names, the object name, and the object content type.
Body parameter
{
"items": [
"string"
],
"contentType": "string",
"typeDefName": "string",
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | path | true | The set of parent names, the object name, and the object content type. |
Example responses
200 Response
{
"id": "string",
"name": "string",
"type": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The object was found and returned as a summary object. | summary |
| 400 | Bad Request | The request was invalid. The request body was malformed or is absent. | errorResponse |
| 404 | Not Found | No object with the specified type exists at the requested path. | errorResponse |
Validate that a member can be named or renamed to the given value without creating a conflict
Code samples
# You can also use wget
curl -X PUT https://example.com/folders/commons/validations/folders/{folderId}/members/{memberId}/name?value=string&type=string \
-H 'Accept: application/vnd.sas.validation+json'
const headers = {
'Accept':'application/vnd.sas.validation+json'
};
fetch('https://example.com/folders/commons/validations/folders/{folderId}/members/{memberId}/name?value=string&type=string',
{
method: 'PUT',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.validation+json'
}
r = requests.put('https://example.com/folders/commons/validations/folders/{folderId}/members/{memberId}/name', params={
'value': 'string', 'type': 'string'
}, headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.validation+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/folders/commons/validations/folders/{folderId}/members/{memberId}/name", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /commons/validations/folders/{folderId}/members/{memberId}/name
This endpoint can be used by a client to test whether creating or renaming a member would create a naming conflict before actually attempting the operation. When creating a new member, a memberId of @new indicates that the attempted operation would create a new member, where a folderId of @root is a placeholder representing the root level of the folder hierarchy. For example,
PUT /commons/validations/folders/@root/members/@new/name?value=TestFolder1&type=folder
would check if one could successfully create a root folder named TestFolder1 and respond appropriately.
PUT /commons/validations/folders/@myFolder/members/@new/name?value=TestReport1&type=report
would check whether a new member named TestReport1 of type report could be added to the user's My Folder.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string | true | The identifier of the folder whose members are to be checked. A value of @root indicates checking a root-level folder, and type must be folder. |
| memberId | path | string | true | If a rename is being attempted, the identifier of the member being renamed. If a new member is being created, the @new placeholder is used. |
| value | query | string | true | The name to be tested. |
| type | query | string | true | The type of the member to be tested. Members of the same type have to be named uniquely, so both the new name and type are required. |
| typeDefName | query | string | false | The Type definition name to test against. This must match exactly with the desired value. A null value will be compared with null values in the repository. |
Example responses
200 Response
{
"version": 0,
"valid": true,
"error": {
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The new name is acceptable based on the current state of the repository. | validation |
| 400 | Bad Request | The request was invalid. | errorResponse |
Member
Contains the operations for the folder member resource.
Get a list of folder members
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folders/{folderId}/members \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string'
};
fetch('https://example.com/folders/folders/{folderId}/members',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/folders/folders/{folderId}/members', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folders/{folderId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folders/{folderId}/members
Returns a list of folder members. Standard paging, filtering, and sorting options are available. The media type of the returned collection items is application/vnd.sas.content.folder.member. Default sorting for this collection is name:ascending, unless the folder is of the history folder type. Default sorting for history folders is added:descending, which orders the elements starting with the most recently added.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| start | query | integer(int64) | false | Offset of first member to return. The default value is 0. |
| limit | query | integer(int64) | false | Maximum number of members to return. The default value is 20. |
| filter | query | string | false | Filter criteria for returned members. See Filtering in REST APIs. For example, you can filter for a member with a given name as a way to test if a folder already has a member with that name: ?filter=eq(name, 'bobsyouruncle') |
| sortBy | query | string | false | Sort returned collection of members. See Sorting in REST APIs. The member collection can be sorted by folders first by using sortBy=eq(contentType,'folder'):descending Use :ascending to soft by folders last. Specifying sortBy=eq(contentType,'folder'):descending,name:ascending,type:ascending sorts by folders first, then by name, then by type. |
| recursive | query | boolean | false | If true, the members of the requested folder, plus all of its descendants, are returned in a flat list (no order is guaranteed). Reference members that refer to folders are not followed unless the followReferences parameter is true. The default value of this parameter is false. |
| followReferences | query | boolean | false | If true, references to other folders are followed when returning the recursive list of members. If recursive is false, then the value of this parameter is meaningless. The default value of this parameter is false. |
| Accept-Language | header | string | false | Enumerates the languages that the client prefers to use for the response. This can be used to provide localized data where available. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. A list of folder members was returned. | memberCollection |
| 400 | Bad Request | The request was invalid. An invalid filter or combination of request parameters was provided. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
Add a member to a folder
Code samples
# You can also use wget
curl -X POST https://example.com/folders/folders/{folderId}/members \
-H 'Content-Type: application/vnd.sas.content.folder.member+json' \
-H 'Accept: application/vnd.sas.content.folder.member+json'
const inputBody = '{
"name": "Test Report",
"uri": "/reports/reports/1234567890",
"type": "CHILD",
"contentType": "report"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder.member+json',
'Accept':'application/vnd.sas.content.folder.member+json'
};
fetch('https://example.com/folders/folders/{folderId}/members',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder.member+json',
'Accept': 'application/vnd.sas.content.folder.member+json'
}
r = requests.post('https://example.com/folders/folders/{folderId}/members', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder.member+json"},
"Accept": []string{"application/vnd.sas.content.folder.member+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/folders/folders/{folderId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /folders/{folderId}/members
Adds a new member to the folder. If the member type is 'child' and the object referenced is already a member of any folder (including the specified parent), this operation fails with a 409 status (conflict). If the object being added is a folder, this method checks that the name is unique (among other members that are of the same type). If a name collision occurs, a 409 status is returned.
Body parameter
Sample body when creating a folder member.
{
"name": "Test Report",
"uri": "/reports/reports/1234567890",
"type": "CHILD",
"contentType": "report"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| abortOnMetadataFailure | query | boolean | false | If true, the member creation is aborted if the GET to retrieve the member metadata fails. If false, the member creation succeeds regardless of the metadata retrieval status. The default value is false. |
| body | body | #/components/requestBodies/folderIn | false | none |
Example responses
200 Response
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Here is an example of using the POST method to create a member in My Folder.
{
"id": "2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/reports/reports/1234567890",
"added": "2019-08-08T12:59:08.775Z",
"type": "child",
"name": "Test Report",
"parentFolderUri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"contentType": "report",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"type": "application/vnd.sas.content.folder.member"
},
{
"method": "GET",
"rel": "up",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d",
"type": "application/vnd.sas.content.folder"
},
{
"method": "GET",
"rel": "getResource",
"href": "/reports/reports/1234567890",
"uri": "/reports/reports/1234567890",
"type": "application/vnd.sas.summary"
},
{
"method": "PUT",
"rel": "putResource",
"href": "/reports/reports/1234567890",
"uri": "/reports/reports/1234567890"
},
{
"method": "DELETE",
"rel": "deleteResource",
"href": "/reports/reports/1234567890",
"uri": "/reports/reports/1234567890"
},
{
"method": "GET",
"rel": "ancestors",
"href": "/folders/ancestors?childUri=/reports/reports/1234567890",
"uri": "/folders/ancestors?childUri=/reports/reports/1234567890",
"type": "application/vnd.sas.content.folder.ancestor"
},
{
"method": "PUT",
"rel": "update",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"type": "application/vnd.sas.content.folder.member"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f"
},
{
"method": "PUT",
"rel": "validateRename",
"href": "/folders/commons/validations/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f/name?value={newname}&type={newtype}",
"uri": "/folders/commons/validations/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f/name?value={newname}&type={newtype}",
"type": "application/vnd.sas.validation"
},
{
"method": "GET",
"rel": "transferExport",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"responseType": "application/vnd.sas.transfer.object"
},
{
"method": "PUT",
"rel": "transferImportUpdate",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members/2ec3501d-4201-4e7d-8de6-0e2c4a7a022f",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
},
{
"method": "POST",
"rel": "transferImport",
"href": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"uri": "/folders/folders/6e6aa6e9-7c6a-4491-84fd-84051031a44d/members",
"type": "application/vnd.sas.transfer.object",
"responseType": "application/vnd.sas.summary"
}
],
"version": 1
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The member was updated. | member |
| 201 | Created | A member was created. | member |
| 400 | Bad Request | The request was invalid. There was an attempt to make a folder its own parent. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. The URI already exists as a child in this folder or another folder. | errorResponse |
| 422 | Unprocessable Entity | History creation failed because the metadata retrieval failed. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Location | string | The URI to the newly created object. | |
| 200 | Etag | string | A tag that identifies this revision of this object. | |
| 201 | Location | string | The URI of the newly created member. |
Get a folder member
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folders/{folderId}/members/{memberId} \
-H 'Accept: application/vnd.sas.content.folder.member+json'
const headers = {
'Accept':'application/vnd.sas.content.folder.member+json'
};
fetch('https://example.com/folders/folders/{folderId}/members/{memberId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.content.folder.member+json'
}
r = requests.get('https://example.com/folders/folders/{folderId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.content.folder.member+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folders/{folderId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folders/{folderId}/members/{memberId}
Returns the specified member.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| memberId | path | string | true | Member id. |
Example responses
200 Response
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The folder member was returned. | member |
| 404 | Not Found | No member exists at the requested path. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 timestamp representing the last time this member was updated. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Remove a member from a folder
Code samples
# You can also use wget
curl -X DELETE https://example.com/folders/folders/{folderId}/members/{memberId} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/folders/folders/{folderId}/members/{memberId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.delete('https://example.com/folders/folders/{folderId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/folders/folders/{folderId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /folders/{folderId}/members/{memberId}
Removes the specified member from the folder. This does not delete the target resource. The proper way to delete a resource is to use the resource's persistence service to delete it. Using that service generates an event that causes the folders service to clean up any members that have that target resource's URI.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| memberId | path | string | true | Member id. |
Example responses
404 Response
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The member was deleted. | None |
| 404 | Not Found | No member exists at the requested path. | errorResponse |
Update a folder member
Code samples
# You can also use wget
curl -X PUT https://example.com/folders/folders/{folderId}/members/{memberId} \
-H 'Content-Type: application/vnd.sas.content.folder.member+json' \
-H 'Accept: application/vnd.sas.content.folder.member+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder.member+json',
'Accept':'application/vnd.sas.content.folder.member+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/folders/folders/{folderId}/members/{memberId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder.member+json',
'Accept': 'application/vnd.sas.content.folder.member+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.put('https://example.com/folders/folders/{folderId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder.member+json"},
"Accept": []string{"application/vnd.sas.content.folder.member+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/folders/folders/{folderId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /folders/{folderId}/members/{memberId}
Replaces an existing folder member. Changing the parentUri affects a move operation. Neither the URI or the type of the member can be changed.
Body parameter
{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| memberId | path | string | true | Member id. |
| If-Match | header | string | false | The ETag that was returned from a GET, POST, or PUT of this folder. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the folder. If the folder has been updated since this time, the update fails. |
| body | body | memberIn | true | Member. |
Example responses
200 Response
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The member was updated. | member |
| 400 | Bad Request | The request was invalid. The JSON or some other element was malformed. | errorResponse |
| 404 | Not Found | No member exists at the requested path. | errorResponse |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified timestamp. The ETag provided does not match the current version of the object, or the last modified date does not match. |
errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this member. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Make a partial update to a folder member
Code samples
# You can also use wget
curl -X PATCH https://example.com/folders/folders/{folderId}/members/{memberId} \
-H 'Content-Type: application/vnd.sas.content.folder.member+json' \
-H 'Accept: application/vnd.sas.content.folder.member+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder.member+json',
'Accept':'application/vnd.sas.content.folder.member+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/folders/folders/{folderId}/members/{memberId}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder.member+json',
'Accept': 'application/vnd.sas.content.folder.member+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.patch('https://example.com/folders/folders/{folderId}/members/{memberId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder.member+json"},
"Accept": []string{"application/vnd.sas.content.folder.member+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/folders/folders/{folderId}/members/{memberId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /folders/{folderId}/members/{memberId}
Updates the provided fields of a member. The client can provide a sparsely populated object, and only the non-null fields contribute to the updates. So, a body like { "name": "NewMemberName" } causes the member to have its name changed, but no other field is affected. The full resulting object is returned in the response.
Body parameter
{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific folder, or of one of the delegate strings @myFolder, @appDataFolder, @myHistory, @myFavorites, or @public. |
| memberId | path | string | true | Member id. |
| If-Match | header | string | false | The ETag that was returned from a GET, POST, or PUT of this folder. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the folder. If the folder has been updated since this time, the update fails. |
| body | body | memberIn | true | A sparsely populated member. Only the non-null fields are updated in the persisted member. |
Example responses
200 Response
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The member was updated. | member |
| 400 | Bad Request | The request was invalid. The JSON or some other element was malformed. | errorResponse |
| 404 | Not Found | No member exists at the requested path. | errorResponse |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. The name change requested would create a naming conflict. | errorResponse |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified timestamp. |
errorResponse |
| 422 | Unprocessable Entity | One or more elements of the body is invalid. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The RFC 1123 date string representing the timestamp of the last update to this member. | |
| 200 | Etag | string | A tag that identifies this revision of this object. |
Update the modification date for a history member
Code samples
# You can also use wget
curl -X POST https://example.com/folders/folders/{folderId}/histories \
-H 'Content-Type: application/vnd.sas.content.folder.member+json' \
-H 'Accept: application/vnd.sas.content.folder.member+json'
const inputBody = '{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}';
const headers = {
'Content-Type':'application/vnd.sas.content.folder.member+json',
'Accept':'application/vnd.sas.content.folder.member+json'
};
fetch('https://example.com/folders/folders/{folderId}/histories',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.content.folder.member+json',
'Accept': 'application/vnd.sas.content.folder.member+json'
}
r = requests.post('https://example.com/folders/folders/{folderId}/histories', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.content.folder.member+json"},
"Accept": []string{"application/vnd.sas.content.folder.member+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/folders/folders/{folderId}/histories", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /folders/{folderId}/histories
Updates the modification date for a history member. If the object URI exists as a reference in the history folder, the information including the added field is updated. If it does not exist, a new member is added, and an eviction is performed if the folder is already at the maximum members threshold.
Body parameter
{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| folderId | path | string(object-id) | true | The identifier of a specific history folder, or the delegate string: @myHistory. |
| abortOnMetadataFailure | query | boolean | false | If true, if the GET to retrieve the member metadata fails, abort the member creation. If false, the member creation succeeds regardless of the metadata retrieval status. The default value is false. |
| body | body | memberIn | true | Member. |
Example responses
200 Response
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The member was updated. | member |
| 201 | Created | A member was created. | member |
| 400 | Bad Request | The request was invalid. A folder type other than a history folder was referenced, or the body does not contain valid JSON. | errorResponse |
| 404 | Not Found | No folder exists at the requested path. | errorResponse |
| 422 | Unprocessable Entity | History creation failed because the metadata retrieval failed. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Location | string | The URI of the created or updated object. | |
| 200 | Last-Modified | string | The RFC 1123 timestamp representing the last time this member was updated. | |
| 200 | Etag | string | A tag that identifies this revision of this object. | |
| 201 | Location | string | The URI of the created or updated object. | |
| 201 | Last-Modified | string | The ISO8601 timestamp that represents the last time this member was updated. | |
| 201 | Etag | string | A tag that identifies this revision of this object. |
Metainfo
Contains the operations that retrieve information about folders (such as ancestors, types, and so on).
Get ancestors for a list of resource URIs
Code samples
# You can also use wget
curl -X POST https://example.com/folders/ancestors \
-H 'Content-Type: application/json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '[
"string"
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/folders/ancestors',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.post('https://example.com/folders/ancestors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/folders/ancestors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /ancestors
Get the ancestors of a set of URIs. Each URI is represented in the result as an Ancestor object.
Body parameter
[
"string"
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| allowPartialPath | query | boolean | false | Allow a partial path from the item if the user doesn't have access to all the folders in the path. |
| body | body | array[string] | true | The list of URIs for which to retrieve ancestry. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"childUri": "string",
"ancestors": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
],
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The ancestors for each URI was returned. | ancestorCollection |
| 400 | Bad Request | The request was invalid. The body was malformed or is missing. | errorResponse |
Get a resource's ancestors
Code samples
# You can also use wget
curl -X GET https://example.com/folders/ancestors?childUri=string \
-H 'Accept: application/vnd.sas.content.folder.ancestor+json'
const headers = {
'Accept':'application/vnd.sas.content.folder.ancestor+json'
};
fetch('https://example.com/folders/ancestors?childUri=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.content.folder.ancestor+json'
}
r = requests.get('https://example.com/folders/ancestors', params={
'childUri': 'string'
}, headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.content.folder.ancestor+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/ancestors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /ancestors
Get the ancestors of a resource by URI as a flat list, ordered starting with the parent folder of the resource, and continuing up to the root folder.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| childUri | query | string | true | The URI of the target resource whose ancestry is desired. |
| allowPartialPath | query | boolean | false | Allow a partial path from the item if the user doesn't have access to all the folders in the path. |
Example responses
200 Response
{
"childUri": "string",
"ancestors": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The member was found and the ancestry was returned. In the case of a root folder, a 200 HTTP status code and an empty list of ancestors is returned. | ancestor |
| 204 | No Content | No ancestors were found for the URI. | None |
| 400 | Bad Request | No childUri parameter was provided. | errorResponse |
Get a list of acceptable folder types
Code samples
# You can also use wget
curl -X GET https://example.com/folders/folderTypes \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/folders/folderTypes',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://example.com/folders/folderTypes', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/folderTypes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /folderTypes
Retrieves the list of folder types that are recognized by the folders service. Returns a collection of application/vnd.sas.content.folder.type+json objects.
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"label": "string",
"userAssignable": true,
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | folderTypeCollection |
Get a list of known delegate-represented folders
Code samples
# You can also use wget
curl -X GET https://example.com/folders/delegateInfo \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/folders/delegateInfo',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://example.com/folders/delegateInfo', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/folders/delegateInfo", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /delegateInfo
Returns the set of delegates known to the folders service.
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"folderName": "string",
"folderType": "string",
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | delegateCollection |
Schemas
baseCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2)
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the collection. |
| start | integer | false | none | The zero-based index of the first item in the collection. |
| limit | integer | false | none | The number of items that were requested for the collection. |
| count | integer(int64) | false | none | If populated indicates the number of items in the collection. |
| accept | string | false | none | A space-delimited list of media types from which an Accept header may be constructed. |
| links | [link] | false | none | The links that apply to the collection. |
| version | integer | false | none | The version number of the collection representation. This representation is version 2. |
errorResponse
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | false | none | The error message. |
| id | string | false | none | The string ID for the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| errors | [errorResponse] | false | none | Any additional errors that occurred |
| links | [link] | false | none | The links that apply to the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
link
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
Link
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| method | string | false | none | The HTTP method to invoke this endpoint. |
| rel | string | false | none | The relationship of this URL to the object. |
| uri | string | false | none | The relative URI of the REST endpoint. |
| href | string | false | none | The full URL of the REST endpoint. |
| type | string | false | none | The media type consumed/produced. |
summary
{
"id": "string",
"name": "string",
"type": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Resource Summary
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string | true | none | The unique identifier for the resource. |
| name | string | false | none | The name of the resource. |
| type | string | false | none | The type of the resource. |
| description | string | false | none | The description of the resource. |
| createdBy | string | false | none | The user who created the resource. |
| creationTimeStamp | string(date-time) | false | none | The timestamp in YYYY-MM-DDThh:mm:ss.sssZ format when the resource was created. |
| modifiedBy | string | false | none | The user who most recently modified the resource. |
| modifiedTimeStamp | string(date-time) | false | none | The timestamp in YYYY-MM-DDThh:mm:ss.sssZ format when the resource was last modified. |
| links | [link] | true | none | The links that apply to the resource. |
| version | integer | true | none | The version number of the resource. This representation is version 1. |
validation
{
"version": 0,
"valid": true,
"error": {
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
},
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
]
}
Validation Response
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | true | none | This media type's schema version number. This representation is version 1. |
| valid | boolean | true | none | true if and only if the validation was successful. |
| error | errorResponse | false | none | The representation of an error. |
| links | [link] | false | none | An array of links to related resources and actions. |
folderIn
{
"name": "Test Folder 1",
"description": "A Test Folder",
"type": "folder"
}
Folder Schema
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | Localizable folder name. |
| description | string | false | none | Localizable folder description. |
| folderType | string | false | none | Specialized subtype for this folder. The default value is 'folder'. |
| parentFolderUri | string | false | none | The URI of this folder's parent folder. This is writable by the client. In order to perform a move, PUT this folder with an updated parentFolderUri pointing to the new parent. It is valid for this field to be null, which indicates a root folder. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
folder
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Folder
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(object-id) | false | none | Folder id. |
| name | string | false | none | Localizable folder name. |
| description | string | false | none | Folder description. |
| parentFolderUri | string | false | none | The URI of this folder's parent folder. This is writable by the client. In order to perform a move, PUT this folder with an updated parentFolderUri pointing to the new parent. It is valid for this field to be null, which indicates a root folder. |
| creationTimeStamp | string(date-time) | false | none | Timestamp of folder creation. |
| modifiedTimeStamp | string(date-time) | false | none | Timestamp of last folder modification. |
| createdBy | string | false | none | The name of the user who created this folder. |
| modifiedBy | string | false | none | The name of the last user who modified this object. |
| type | string | false | none | The folder type. |
| iconUri | string(relative URI) | false | none | The folder icon URI. |
| memberCount | integer | false | none | The number of members in the folder. |
| links | [link] | false | none | Links that apply to this object. Includes "self", "members", and "delete". |
| properties | object | false | none | A collection of name/value pairs that help describe the folder. |
| » additionalProperties | string | false | none | none |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
memberIn
{
"name": "Test Object",
"type": "child",
"uri": "/objekts/e8cdb3af-30d8-423d-92a1-6f3bf1dffbb9",
"contentType": "objekt"
}
Member Schema
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| uri | string(relative URI) | true | none | The URI of the item that the member represents. The service does not make any attempt to validate this field, so it can be anything. However, if this is a folder, it MUST be the folder's URI. It should come from the folder's "self" link, and not be assembled from pieces. |
| type | string | true | none | Must be "child" or "reference". Child members are deleted when the parent folder is deleted. Child members that rely on SAS authorization checking inherit authorization settings from the parent folder. An object can be a child of one and only one folder. Reference members have no such restrictions. Any member object can be referenced from an unrestricted number of containers. |
| parentFolderUri | string | false | none | The URI of this member's parent folder. This is writable by the client. In order to perform a move, PUT this member with an updated parentFolderUri pointing to the new parent. |
| name | string | true | none | Localizable name of the member object. This attribute is persisted with the folder for performance reasons. For SAS managed objects, this value is intended to be synchronized with the attribute persisted with the object. |
| description | string | false | none | Localizable description of the member object. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| creationTimeStamp | string(date-time) | false | none | Timestamp of member object creation. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| modifiedTimeStamp | string(date-time) | false | none | Timestamp of last member object modification. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| contentType | string | false | none | Member object type. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| typeDefName | string | false | none | (version 2) If the resource has a subtype that applies, the client can specify it when creating the member. This gives the client navigating the members more information for filtering, sorting, or searching for matching members. |
| iconUri | string(relative URI) | false | none | Member object icon URI. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| orderNum | integer | false | none | Optional ordering specifier to provide user ordering of members. When retrieving members, if no other ordering is specified, members are ordered by this field in ascending order. The values do not have to be sequential; the results are ordered according to the values provided. The values also do not have to be unique. However, duplicates result in arbitrary ordering of records with duplicate values. |
| version | integer | false | none | This media type's schema version number. This representation is version 2. |
member
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
Member
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(object-id) | false | none | Member id. |
| uri | string(relative URI) | false | none | The URI of the item that the member represents. The service does not make any attempt to validate this field, so it can be anything. However, if this is a folder, it MUST be the folder's URI. It should come from the folder's "self" link, and not be assembled from pieces. |
| added | string(date-time) | false | none | Timestamp when member was last added to folder. |
| type | string | false | none | Must be "child" or "reference". Child members are deleted when the parent folder is deleted. Child members that rely on SAS authorization checking inherit authorization settings from the parent folder. An object can be a child of one and only one folder. Reference members have no such restrictions. Any member object can be referenced from an unrestricted number of containers. |
| parentFolderUri | string | false | none | The URI of this member's parent folder. This is writable by the client. In order to perform a move, PUT this member with an updated parentFolderUri pointing to the new parent. |
| name | string | false | none | Localizable name of the member object. This attribute is persisted with the folder for performance reasons. For SAS managed objects, this value is intended to be synchronized with the attribute persisted with the object. |
| description | string | false | none | Localizable description of the member object. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| createdBy | string | false | none | The username of the user who created the object represented by this member. |
| creationTimeStamp | string(date-time) | false | none | Timestamp of member object creation. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| modifiedBy | string | false | none | The username of the user who last modified the object represented by this member. |
| modifiedTimeStamp | string(date-time) | false | none | Timestamp of last member object modification. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| contentType | string | false | none | Member object type. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| typeDefName | string | false | none | (version 2) If the resource has a subtype that applies, the client can specify it when creating the member. This gives the client navigating the members more information for filtering, sorting, or searching for matching members. |
| iconUri | string(relative URI) | false | none | Member object icon URI. Member attribute is synchronized with attribute of member object for SAS managed objects. |
| orderNum | integer | false | none | Optional ordering specifier to provide user ordering of members. When retrieving members, if no other ordering is specified, members are ordered by this field in ascending order. The values do not have to be sequential; the results are ordered according to the values provided. They also do not have to be unique. However, duplicates result in arbitrary ordering of records with duplicate values. |
| links | [link] | false | none | Links that apply to this object. Links for members include "self" and "delete". |
| version | integer | false | none | This media type's schema version number. This representation is version 2. |
folderCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Folder Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Folder Collection | any | false | none | A collection of folders. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [folder] | false | none | The actual results of a query. |
memberCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"uri": "string",
"added": "2019-08-24T14:15:22Z",
"type": "string",
"parentFolderUri": "string",
"name": "string",
"description": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"contentType": "string",
"typeDefName": "string",
"iconUri": "string",
"orderNum": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0
}
]
}
Member Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Member Collection | any | false | none | A collection of folder members. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [member] | false | none | The actual results of a query. |
ancestor
{
"childUri": "string",
"ancestors": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
],
"version": 0
}
Ancestor Type
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| childUri | string | false | none | The URI whose ancestry was requested. |
| ancestors | [folder] | false | none | An ordered list of the folders that parent the URI, starting with the immediate parent. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
ancestorCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"childUri": "string",
"ancestors": [
{
"id": "string",
"name": "string",
"description": "string",
"parentFolderUri": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"type": "string",
"iconUri": "string",
"memberCount": 0,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
],
"version": 0
}
]
}
Ancestor Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Ancestor Collection | any | false | none | A collection of ancestor entries that are returned from an ancestors request. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [ancestor] | false | none | The collection of ancestor results. |
folderType
{
"name": "string",
"label": "string",
"userAssignable": true,
"version": 0
}
Folder Type
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the folder type. This is the value that goes in the folderType field of a folder. |
| label | string | false | none | The localizable label that can be presented to a user. |
| userAssignable | boolean | false | none | True if the type is acceptable to use in a folder being created by a client. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
folderTypeCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"label": "string",
"userAssignable": true,
"version": 0
}
]
}
Folder Type Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Folder Type Collection | any | false | none | A collection of folder types. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [folderType] | false | none | The collection of folder types. |
delegate
{
"name": "string",
"folderName": "string",
"folderType": "string",
"version": 0
}
Delegate
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The delegate name, always starting with '@'. |
| folderName | string | false | none | The folder name of the delegate, for example, for @myFolder, My Folder. |
| folderType | string | false | none | The value of the type field for this delegate. For example, for @myFolder, myFolder. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
delegateCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"type": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"folderName": "string",
"folderType": "string",
"version": 0
}
]
}
Delegate Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Delegate Collection | any | false | none | A collection of delegate objects. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [delegate] | false | none | The collection of delegate definitions. |
path
{
"items": [
"string"
],
"contentType": "string",
"typeDefName": "string",
"version": 0
}
Path
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| items | [string] | false | none | An ordered list of parent folder names, with the desired object's name at the end of the list. |
| contentType | string | false | none | The content type of the object to return. Must match the content type of the Member entry. |
| typeDefName | string | false | none | The type definition name of the member being requested. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Projects
Base URLs:
- https://example.com/projects
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Projects API provides support for creating projects to group a set of objects, referenced resources, and participants (users or groups).
Usage Notes
Overview
A project is a container that groups a set of resources along with a set of participants (users or groups). This can be used for collaborative purposes where one or more participants are working on a set of related resources. The resources contained in a project are referenced through a URI that points to that resource. The Projects API has no other knowledge of the target resource. That resource might be in the SAS service sphere, it might be external, or it might not actually exist at all. When a resource is removed from a project, no attempt is made to delete the underlying resource. However, if a target resource that is managed by a SAS service is deleted, that service fires an event and the Projects API removes that resource from any projects that contained it.
Resource Relationships
- A project is backed by a folder from the Folders API
- When a project is created, a corresponding folder is created with the same name under the "Projects" root folder. A project contains a folderUri pointing to this folder.
- Any resources in this folder are considered to be part of the project.
- Clients can add or remove resources from the project by using the folderUri along with the Folders API directly.
- References to resources (in the form of a resourceUri) can be stored directly in the Projects service using the /projects/{projectId}/resources endpoint.
- When retrieving these resources, the Projects API attempts a GET request on the resourceUri with an Accept header of "application/json".
- If the Projects service receives a successful response, the service attempts to populate the "name", "description", and "contentType" fields of the
application/vnd.sas.project.resourceobject from fields of the same name from the response body. If any of those fields are not found, they are left blank. - Errors fetching the resourceUri are ignored.
- Participants can be either users or groups from the Identity service and they are associated to projects with a role. The only roles are "owner" and "contributor".
- When a new project is created, the user creating the project is automatically the owner. Only the owner of a project or an administrator can delete a project.
- A project can contain more than one owner, and only an owner of a project or an administrator can add another participant as an owner.
- Only an owner or administrator can add participants to a project or remove participants from a project.
- If there is only one owner in a project, that owner cannot be removed until another owner is added (either by promoting an existing contributor or adding a new participant as an owner).
- Users can be participants of multiple projects.
- When a group is added as a participant, the role applies to all members of the group (and transitively for groups within groups).
- If a user is both an explicit participant and a member of a participant group, and there is a difference in the roles, then the elevated role holds. For example, if a user is added explicitly as a contributor and they are a member of a group that has been added as an owner, then that user is considered an owner.
The Projects API can also be used to retrieve information about various project-related activities. These activities include the following: * Project created/renamed/deleted * Project description changed * Project avatar changed * Participant added/modified/removed * Resource added/modified/removed * Folder member added/modified/removed * Comment added/modified/removed
Terminology
project
a container that groups a set of resources along with a set of participants.
participant
a SAS user or group.
role
assigned to each participant to determine their level of access. Different permissions are associated with different roles.
resource
an atomic unit of data to which a project applies. These could be a SAS folder member, a data resource (such as a dataSource or dataTable), or some other item identified with a URI.
activity
an event (or events) related to a project. These could be created/modified/deleted events for the project itself, a participant or resource, or a member of the underlying folder.
Error Codes
The list below contains the set of error codes that are used for following error conditions.
| Http Status Code | Error Code | Description |
|---|---|---|
| 400 | 18900 | Project creation failed. |
| 400 | 18904 | Project ID did not match ID in request url. |
| 400 | 18905 | Provided project description exceeds its maximum length. |
| 400 | 18906 | Provided project name exceeds its maximum length. |
| 400 | 18907 | Provided project image uri exceeds its maximum length. |
| 400 | 18908 | Provided property name exceeds its maximum length. |
| 400 | 18909 | Provided property value exceeds its maximum length. |
| 400 | 18910 | Provided project ID exceeds its maximum length. |
| 400 | 18911 | Provided project ID already exists. |
| 400 | 18912 | Required project ID was not specified. |
| 400 | 18913 | Required project name was not specified. |
| 400 | 18915 | Provided IDentity uri exceeds its maximum length. |
| 400 | 18916 | Identity was not found. |
| 400 | 18917 | Unexpected status code for identity returned. |
| 400 | 18918 | Invalid participant role. |
| 400 | 18919 | Project must have an owner. |
| 400 | 18920 | Duplicate project property specified. |
| 400 | 18921 | Self link for user ID not found. |
| 400 | 18922 | Invalid participant identity uri. |
| 400 | 18924 | Participant identity uri not specified. |
| 400 | 18925 | Property name not specified. |
| 400 | 18926 | Property value not specified. |
| 400 | 18929 | Resource uri not specified. |
| 400 | 18931 | Invalid project name. |
| 400 | 18932 | Required participant ID was not specified. |
| 400 | 18933 | Participant ID did not match ID in request url. |
| 400 | 18934 | Provided participant ID exceeds its maximum length. |
| 400 | 18938 | Project update failed. |
| 400 | 18939 | Required resource ID was not specified. |
| 400 | 18940 | Provided resource ID exceeds its maximum length. |
| 400 | 18941 | Resource ID did not match ID in request url. |
| 400 | 18942 | Provided resource uri exceeds its maximum length. |
| 400 | 18943 | Invalid resource uri. |
| 400 | 18944 | Resource identified by resourceUri was not found. |
| 400 | 18945 | Unexpected status code for resource uri returned. |
| 400 | 18946 | Transfer object is missing content. |
| 400 | 18947 | Invalid connector type for transfer object. |
| 400 | 18950 | Participant identity uri cannot be modified. |
| 404 | 18901 | Project was not found. |
| 404 | 18914 | Participant was not found. |
| 404 | 18928 | Resource was not found. |
| 409 | 18923 | Project name already exists. |
| 409 | 18927 | Provided participant identity uri already exists. |
| 409 | 18930 | Provided resource uri already exists. |
| 409 | 18937 | Project folder already exists. |
| 412 | 18902 | ETag did not match for conditional put request. |
| 428 | 18903 | Required ETag for conditional put was not specified. |
| 500 | 18935 | Projects root folder missing. |
| 500 | 18948 | Error removing folder members for transfer operation. |
| 500 | 18949 | Error adding folder members for transfer operation. |
Operations
Projects
Contains the operations for the Project resource.
Get projects
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: application/vnd.sas.project.summary+json'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'application/vnd.sas.project.summary+json'
};
fetch('https://example.com/projects/projects',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'application/vnd.sas.project.summary+json'
}
r = requests.get('https://example.com/projects/projects', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"application/vnd.sas.project.summary+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects
Returns a list of projects. Standard paging, filtering, and sorting options are provided. The media type of the returned collection items is either application/vnd.sas.project.summary (default), or application/vnd.sas.project depending on the Accept-Item header. Default sorting for this collection is name:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | false | The desired project representation. If no Accept-Item is specified, application/vnd.sas.project.summary items are returned. |
| start | query | integer | false | The offset of the first project to return. The default is 0. |
| limit | query | integer | false | The maximum number of projects to return. The default is 20. |
| filter | query | string(filter-criteria) | false | The criteria for filtering the projects. See Filtering in REST APIs. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the projects. See Sorting in REST APIs. |
| resourceUri | query | string(uri) | false | Return projects containing only a resource with the specified resourceUri. This should be the URI of the underlying resource object itself and not the vnd.sas.project.resource object's URI. |
| identityUri | query | string(uri) | false | Return projects containing only a participant with the specified identityUri. This should be the URI of the actual user or group object from the Identities service. |
Enumerated Values
| Parameter | Value |
|---|---|
| Accept-Item | application/vnd.sas.project.summary+json |
| Accept-Item | application/vnd.sas.project+json |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The list of projects was returned. | projectCollection |
| 400 | Bad Request | The request was invalid. An invalid filter or combination of request parameters was provided. | error2 |
Create a new project
Code samples
# You can also use wget
curl -X POST https://example.com/projects/projects \
-H 'Content-Type: application/vnd.sas.project+json' \
-H 'Accept: application/vnd.sas.project+json'
const inputBody = '{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.project+json',
'Accept':'application/vnd.sas.project+json'
};
fetch('https://example.com/projects/projects',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project+json',
'Accept': 'application/vnd.sas.project+json'
}
r = requests.post('https://example.com/projects/projects', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project+json"},
"Accept": []string{"application/vnd.sas.project+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/projects/projects", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /projects
Creates a new empty project. Resources can be added to the project using the /projects/{projectId}/resources endpoint. Participants can be added to the project using the /projects/{projectId}/participants endpoint. Name uniqueness across projects is enforced. Only the name, description, imageUri, and properties fields are editable.
Body parameter
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | createProject | true | none |
Example responses
201 Response
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The project was created. | project |
| 400 | Bad Request | The request was invalid. | error2 |
| 409 | Conflict | The project name already exists. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI of the newly created project. | |
| 201 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this project. | |
| 201 | ETag | string | A tag that identifies the current revision of the object. |
Get project
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId} \
-H 'Accept: application/vnd.sas.project+json'
const headers = {
'Accept':'application/vnd.sas.project+json'
};
fetch('https://example.com/projects/projects/{projectId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.project+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.project+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}
Returns the specified project. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
Example responses
200 Response
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | project |
| 404 | Not Found | The project does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this project. | |
| 200 | ETag | string | A tag that identifies the current revision of the object. |
Update project
Code samples
# You can also use wget
curl -X PUT https://example.com/projects/projects/{projectId} \
-H 'Content-Type: application/vnd.sas.project+json' \
-H 'Accept: application/vnd.sas.project+json' \
-H 'If-Match: string'
const inputBody = '{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.project+json',
'Accept':'application/vnd.sas.project+json',
'If-Match':'string'
};
fetch('https://example.com/projects/projects/{projectId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project+json',
'Accept': 'application/vnd.sas.project+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/projects/projects/{projectId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project+json"},
"Accept": []string{"application/vnd.sas.project+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/projects/projects/{projectId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /projects/{projectId}
Replaces an existing project. Only the name, description, imageUri, and properties fields are editable.
Body parameter
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project and MUST exactly match project.id sent in the body of the request. |
| If-Match | header | string | true | The ETag that was returned from a GET, POST, or PUT request of this project. |
| body | body | updateProject | true | none |
Example responses
200 Response
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project was updated. | project |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The project does not exist. | error2 |
| 409 | Conflict | The request could not be completed. The project name already exists. | error2 |
| 412 | Precondition Failed | The ETag provided does not match the current version of the object. | error2 |
| 428 | Precondition Required | The ETag was not provided when updating an existing type. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this project. | |
| 200 | ETag | string | A tag that identifies the current revision of the object. |
Delete project
Code samples
# You can also use wget
curl -X DELETE https://example.com/projects/projects/{projectId} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/projects/projects/{projectId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.delete('https://example.com/projects/projects/{projectId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/projects/projects/{projectId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /projects/{projectId}
The specified project is deleted along with all participants and resources. If keepFolder=true is not specified, the underlying folder and all its content are deleted also.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| keepFolder | query | boolean | false | If true, the underlying folder and all its content is not deleted. The default is false. |
Example responses
404 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The project was deleted. | None |
| 404 | Not Found | The project does not exist. | error2 |
Resources
Contains the operations for a Resource.
Get project resources
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId}/resources \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/projects/projects/{projectId}/resources',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}/resources', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}/resources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}/resources
Returns a list of project resources. Standard paging, filtering, and sorting options are available. The media type of the returned collection items is application/vnd.sas.project.resource. Default sorting for this collection is name:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| start | query | integer(int64) | false | The offset of the first resource to return. The default is 0. |
| limit | query | integer(int64) | false | Maximum number of resources to return. The default is 20. |
| filter | query | string(filter-criteria) | false | The criteria for filtering the resources. See Filtering in REST APIs. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the resources. See Sorting in REST APIs. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project resources were returned. | resourceCollection |
| 404 | Not Found | The project does not exist. | error2 |
Add resource to project
Code samples
# You can also use wget
curl -X POST https://example.com/projects/projects/{projectId}/resources \
-H 'Content-Type: application/vnd.sas.project.resource+json' \
-H 'Accept: application/vnd.sas.project.resource+json'
const inputBody = '{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
}
}';
const headers = {
'Content-Type':'application/vnd.sas.project.resource+json',
'Accept':'application/vnd.sas.project.resource+json'
};
fetch('https://example.com/projects/projects/{projectId}/resources',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project.resource+json',
'Accept': 'application/vnd.sas.project.resource+json'
}
r = requests.post('https://example.com/projects/projects/{projectId}/resources', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project.resource+json"},
"Accept": []string{"application/vnd.sas.project.resource+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/projects/projects/{projectId}/resources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /projects/{projectId}/resources
Adds a new resource reference to the project. If the resource object referenced is already a member of this project, this operation fails with a 409 status (conflict).
Body parameter
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| body | body | createResource | true | none |
Example responses
201 Response
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A new resource was created. | resource |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The project does not exist. | error2 |
| 409 | Conflict | The request could not be completed. The URI already exists as a resource of this project. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI of the newly created resource. | |
| 201 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this project. | |
| 201 | ETag | string | A tag that identifies this revision of this object. |
Get project resource
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId}/resources/{resourceId} \
-H 'Accept: application/vnd.sas.project.resource+json'
const headers = {
'Accept':'application/vnd.sas.project.resource+json'
};
fetch('https://example.com/projects/projects/{projectId}/resources/{resourceId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.project.resource+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}/resources/{resourceId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.project.resource+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}/resources/{resourceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}/resources/{resourceId}
Returns the specified resource. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| resourceId | path | string | true | Unique identifier of the resource. |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project's resource was returned. | resource |
| 404 | Not Found | The project or resource does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 timestamp representing the last time this member was updated. | |
| 200 | ETag | string | A tag that identifies this revision of this object. |
Update project resource
Code samples
# You can also use wget
curl -X PUT https://example.com/projects/projects/{projectId}/resources/{resourceId} \
-H 'Content-Type: application/vnd.sas.project.resource+json' \
-H 'Accept: application/vnd.sas.project.resource+json' \
-H 'If-Match: string'
const inputBody = '{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.project.resource+json',
'Accept':'application/vnd.sas.project.resource+json',
'If-Match':'string'
};
fetch('https://example.com/projects/projects/{projectId}/resources/{resourceId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project.resource+json',
'Accept': 'application/vnd.sas.project.resource+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/projects/projects/{projectId}/resources/{resourceId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project.resource+json"},
"Accept": []string{"application/vnd.sas.project.resource+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/projects/projects/{projectId}/resources/{resourceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /projects/{projectId}/resources/{resourceId}
Replaces an existing project resource.
Body parameter
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| resourceId | path | string | true | The identifier of a specific resource. |
| If-Match | header | string | true | The ETag that was returned from a GET, POST, or PUT of this object. |
| body | body | updateResource | true | none |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project resource was updated. | resource |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The project or resource does not exist. | error2 |
| 409 | Conflict | The request could not be completed. The URI already exists as a resource of this project. | error2 |
| 412 | Precondition Failed | The ETag provided does not match the current version of the object. | error2 |
| 428 | Precondition Required | The ETag was not provided when updating an existing type. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this member. | |
| 200 | ETag | string | A tag that identifies this revision of this object. |
Remove resource from project
Code samples
# You can also use wget
curl -X DELETE https://example.com/projects/projects/{projectId}/resources/{resourceId} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/projects/projects/{projectId}/resources/{resourceId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.delete('https://example.com/projects/projects/{projectId}/resources/{resourceId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/projects/projects/{projectId}/resources/{resourceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /projects/{projectId}/resources/{resourceId}
Removes the specified resource from the project. This does not delete the target resource. The proper way to delete a resource is to use the resource's persistence service to delete it. That should generate an event that causes the projects service to clean up any members that have that target resource's URI.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| resourceId | path | string | true | The identifier of a specific resource. |
Example responses
404 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The resource was deleted. | None |
| 404 | Not Found | The project or resource does not exist. | error2 |
Participants
Contains the operations for a Participant resource.
Get project participants
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId}/participants \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/projects/projects/{projectId}/participants',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}/participants', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}/participants", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}/participants
Returns a list of project participants. Standard paging, filtering, and options are available. The media type of the returned collection items is application/vnd.sas.project.participant. Default sorting for this collection is name:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| start | query | integer(int64) | false | The offset of the first participant to return. The default is 0. |
| limit | query | integer(int64) | false | Maximum number of participants to return. The default is 20. |
| filter | query | string(filter-criteria) | false | The criteria for filtering the participants. See Filtering in REST APIs. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the participants. See Sorting in REST APIs. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | participantCollection |
| 404 | Not Found | The project does not exist. | error2 |
Add participant to project
Code samples
# You can also use wget
curl -X POST https://example.com/projects/projects/{projectId}/participants \
-H 'Content-Type: application/vnd.sas.project.participant+json' \
-H 'Accept: application/vnd.sas.project.participant+json'
const inputBody = '{
"identityUri": "https://example.com",
"role": "contributor",
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.project.participant+json',
'Accept':'application/vnd.sas.project.participant+json'
};
fetch('https://example.com/projects/projects/{projectId}/participants',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project.participant+json',
'Accept': 'application/vnd.sas.project.participant+json'
}
r = requests.post('https://example.com/projects/projects/{projectId}/participants', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project.participant+json"},
"Accept": []string{"application/vnd.sas.project.participant+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/projects/projects/{projectId}/participants", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /projects/{projectId}/participants
Adds a new participant to the project. If the participant referenced is already a participant of this project, this operation fails with a 409 status (conflict).
Body parameter
{
"identityUri": "https://example.com",
"role": "contributor",
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| body | body | createParticipant | true | none |
Example responses
201 Response
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A participant was created. | participant |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The project does not exist. | error2 |
| 409 | Conflict | The request could not be completed. The URI already exists as a participant of this project. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | The URI of the newly created participant | |
| 201 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this project. | |
| 201 | ETag | string | A tag that identifies this revision of this object. |
Get project participant
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId}/participants/{participantId} \
-H 'Accept: application/vnd.sas.project.participant+json'
const headers = {
'Accept':'application/vnd.sas.project.participant+json'
};
fetch('https://example.com/projects/projects/{projectId}/participants/{participantId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.project.participant+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}/participants/{participantId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.project.participant+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}/participants/{participantId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}/participants/{participantId}
Returns the specified participant. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| participantId | path | string | true | The identifier of a specific participant. |
Example responses
200 Response
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project participant was returned. | participant |
| 404 | Not Found | The project or participant does not exist. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 timestamp representing the last time this participant was updated. | |
| 200 | ETag | string | A tag that identifies this revision of this object. |
Update project participant
Code samples
# You can also use wget
curl -X PUT https://example.com/projects/projects/{projectId}/participants/{participantId} \
-H 'Content-Type: application/vnd.sas.project.participant+json' \
-H 'Accept: application/vnd.sas.project.participant+json' \
-H 'If-Match: string'
const inputBody = '{
"id": "string",
"role": "contributor",
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.project.participant+json',
'Accept':'application/vnd.sas.project.participant+json',
'If-Match':'string'
};
fetch('https://example.com/projects/projects/{projectId}/participants/{participantId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.project.participant+json',
'Accept': 'application/vnd.sas.project.participant+json',
'If-Match': 'string'
}
r = requests.put('https://example.com/projects/projects/{projectId}/participants/{participantId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.project.participant+json"},
"Accept": []string{"application/vnd.sas.project.participant+json"},
"If-Match": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/projects/projects/{projectId}/participants/{participantId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /projects/{projectId}/participants/{participantId}
Replaces an existing project participant.
Body parameter
{
"id": "string",
"role": "contributor",
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| participantId | path | string | true | The identifier of a specific participant. |
| If-Match | header | string | true | The ETag that was returned from a GET, POST, or PUT of this object. |
| body | body | updateParticipant | true | none |
Example responses
200 Response
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The participant was updated. | participant |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | The project or participant does not exist. | error2 |
| 409 | Conflict | The request could not be completed. The URI already exists as a participant of this project. | error2 |
| 412 | Precondition Failed | The ETag provided does not match the current version of the object. | error2 |
| 428 | Precondition Required | The ETag was not provided when updating an existing type. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Last-Modified | string | The ISO8601 date string representing the timestamp of the last update to this participant. | |
| 200 | ETag | string | A tag that identifies this revision of this object. |
Remove participant from project
Code samples
# You can also use wget
curl -X DELETE https://example.com/projects/projects/{projectId}/participants/{participantId} \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/projects/projects/{projectId}/participants/{participantId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': '*/*'
}
r = requests.delete('https://example.com/projects/projects/{projectId}/participants/{participantId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/projects/projects/{projectId}/participants/{participantId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /projects/{projectId}/participants/{participantId}
Removes the specified participant from the project. This does not delete the identity from the Identities service. If the corresponding identity is deleted from the Identity service, an event is generated and any associated participants are deleted. Since a project must have at least one owner, the last owner cannot be deleted. It is possible that the last owner could be removed if the corresponding identity is deleted from the Identities service. The project would be visible only to administrators who can delete the project or add a new owner.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| participantId | path | string | true | The identifier of a specific participant. |
Example responses
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The participant was removed. | None |
| 400 | Bad Request | The request was invalid. Cannot delete the last owner. A project must have at least one owner. | error2 |
| 404 | Not Found | The project or participant does not exist. | error2 |
Activities
Contains the operations for an Activity resource.
Get project activities
Code samples
# You can also use wget
curl -X GET https://example.com/projects/projects/{projectId}/activities \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/projects/projects/{projectId}/activities',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/projects/projects/{projectId}/activities', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/projects/{projectId}/activities", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /projects/{projectId}/activities
Returns a list of project activities. Standard paging, filtering, and options are available. The media type of the returned collection items is application/vnd.sas.project.activity. Default sorting for this collection is timeStamp:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| projectId | path | string(object-id) | true | The identifier of a specific project. |
| start | query | integer(int64) | false | The offset of the first activity to return. The default is 0. |
| limit | query | integer(int64) | false | Maximum number of activities to return. The default is 20. |
| filter | query | string(filter-criteria) | false | The criteria for filtering the activities. See Filtering in REST APIs. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the activities. See Sorting in REST APIs. |
| since | query | string(date-time) | false | To get activities occurred since the timestamp. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"resourceName": "string",
"resourceType": "string",
"projectUris": [
"https://example.com"
],
"action": "string",
"user": "string",
"timeStamp": "2019-08-24T14:15:22Z",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The project activities were returned. | activityCollection |
| 404 | Not Found | The project does not exist. | error2 |
Get activities across all projects
Code samples
# You can also use wget
curl -X GET https://example.com/projects/activities \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/projects/activities',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/projects/activities', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/activities", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /activities
Returns a list of activities across all projects. Standard paging, filtering, and options are available. The media type of the returned collection items is application/vnd.sas.project.activity. Default sorting for this collection is timeStamp:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer(int64) | false | The offset of the first activity to return. The default is 0. |
| limit | query | integer(int64) | false | Maximum number of activities to return. The default is 20. |
| filter | query | string(filter-criteria) | false | The criteria for filtering the activities. See Filtering in REST APIs. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the activities. See Sorting in REST APIs. |
| resourceUri | query | string(uri) | false | Return activities with the specified resourceUri. |
| since | query | string(date-time) | false | To get activities occurred since the timestamp. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"resourceName": "string",
"resourceType": "string",
"projectUris": [
"https://example.com"
],
"action": "string",
"user": "string",
"timeStamp": "2019-08-24T14:15:22Z",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Returned project activities. | activityCollection |
Roles
Contains the operations for a Role resource.
Get the set of valid roles for a project
Code samples
# You can also use wget
curl -X GET https://example.com/projects/roles \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/projects/roles',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/projects/roles', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/roles", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /roles
Returns the set of valid roles for participants of a project. The media type of the returned collection items is application/vnd.sas.project.role. Default sorting for this collection is name:ascending. HEAD is also supported and returns status and headers only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer(int64) | false | The offset of the first role to return. The default is 0. |
| limit | query | integer(int64) | false | Maximum number of roles to return. The default is 20. |
| sortBy | query | string(sort-criteria) | false | The criteria for sorting the activities. See Sorting in REST APIs. |
Example responses
200 Response
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"version": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The set of valid roles for participants of a project was returned. | roleCollection |
Root
Contains the operation for the root resource.
Get a list of top-level links
Code samples
# You can also use wget
curl -X GET https://example.com/projects/ \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/projects/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/projects/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/projects/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level collections through the API. HEAD is also supported and returns status and headers only.
Example responses
200 Response
{
"version": 1,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | api |
| 404 | Not Found | The request was invalid. The service is not available. | error2 |
FixUp
Synchronizes a projects database with folders.
Code samples
# You can also use wget
curl -X PUT https://example.com/projects/projects/@root \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/projects/projects/@root',
{
method: 'PUT',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'text/plain'
}
r = requests.put('https://example.com/projects/projects/@root', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/plain"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/projects/projects/@root", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /projects/@root
This endpoint is used when the "Projects" folder has been deleted from the Folder service by an administrator. All of the projects need to be restored. Restarting the projects service restores the "Projects" folder, but not all the folders that were in it prior to deletion. This end point restores these folders.
Example responses
400 Response
{"message":"string","id":"string","errorCode":0,"httpStatusCode":0,"details":["string"],"remediation":"string","errors":[null],"links":[{"method":"string","rel":"string","uri":"string","href":"string","title":"string","type":"string","itemType":"string","responseType":"string","responseItemType":"string"}],"version":0}
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | None |
| 400 | Bad Request | The request was invalid. | error2 |
Schemas
createProject
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Create Project
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | The identifier of a specific project. |
| description | string | false | none | The project's description. |
| imageUri | string(uri) | false | none | URI to image used as the project avatar. If a URI is not supplied on a POST request, then a default URI is substituted. Null or blank values are allowed on a PUT request. |
| properties | object | false | none | Additional properties that could be specified for the project. |
| » additionalProperties | string | false | none | none |
| version | integer | false | none | The version of the object. |
updateProject
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string"
}
Update Project
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | createProject | false | none | The representation used to create a new project. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string(object-id) | false | none | The identifier of a specific project. |
project
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Project
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Project | any | false | none | The representation of a project. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | updateProject | false | none | The representation used to update a project. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » folderUri | string(uri) | false | none | URI of the project's folder. This is a read-only property. |
| » userCount | integer | false | none | The number of participants in the project with type 'user'. This is a read-only property. |
| » groupCount | integer | false | none | The number of participants in the project with type 'group'. This is a read-only property. |
| » createdBy | string | false | none | The user who created this project. |
| » creationTimeStamp | string(date-time) | false | none | The timestamp of the project's creation. |
| » modifiedBy | string | false | none | The user who last modified this project. |
| » modifiedTimeStamp | string(date-time) | false | none | The timestamp of the last project modification. |
| » links | links | false | none | Links to related resources and operations. |
createResource
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
}
}
Create Resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resourceUri | string(uri) | true | none | The URI of the item that the resource represents. |
| version | integer | false | none | The version of the object. |
| properties | object | false | none | Additional properties that could be specified for the resource. |
| » additionalProperties | string | false | none | none |
updateResource
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string"
}
Update Resource
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | createResource | false | none | The representation used to create a new resource. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string(object-id) | false | none | The identifier of a specific resource. |
resource
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Resource | any | false | none | The representation of a resource. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | updateResource | false | none | The representation used to update a resource. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » name | string | false | none | Name of the resource object. This attribute is read-only and is obtained from the target object if possible. This attribute cannot be used in a filter query. |
| » description | string | false | none | Description of the resource object. This attribute is read-only and is obtained from the target object if possible. This attribute cannot be used in a filter query. |
| » contentType | string | false | none | Resource object type. This should match a type from the Types service. This attribute is read-only and is obtained from the target object if possible. This attribute cannot be used in a filter query. |
| » statusCode | integer | false | none | HTTP status code returned by the resourceUri. This is a read-only property. |
| » errorMessage | string | false | none | Error message returned by the resourceUri. This is a read-only property. |
| » createdBy | string | false | none | The user who added the resource. |
| » creationTimeStamp | string(date-time) | false | none | The timestamp of the resource object's creation. |
| » modifiedBy | string | false | none | The user who last updated the resource. |
| » modifiedTimeStamp | string(date-time) | false | none | The timestamp of the last resource object modification. |
| » links | links | false | none | Links to related resources and operations. |
createParticipant
{
"identityUri": "https://example.com",
"role": "contributor",
"version": 0
}
Create Participant
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| identityUri | string(uri) | true | none | The URI of the participant. This must be a valid URI pointing to a user or group from the Identities service. |
| role | string | false | none | The role of the participant in the project. |
| version | integer | false | none | The version of the object. |
Enumerated Values
| Property | Value |
|---|---|
| role | owner |
| role | contributor |
updateParticipant
{
"id": "string",
"role": "contributor",
"version": 0
}
Update Participant
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(object-id) | false | none | The identifier of a specific participant. |
| role | string | false | none | The role of the participant in the project. |
| version | integer | false | none | The version of the object. |
Enumerated Values
| Property | Value |
|---|---|
| role | owner |
| role | contributor |
participant
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Participant
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(object-id) | false | none | The identifier of a specific participant. |
| identityUri | string(uri) | false | none | The URI of the participant. This must be a valid URI pointing to a user or group from the Identities service. |
| role | string | false | none | The role of the participant in the project. |
| version | integer | false | none | The version of the object. |
| name | string | false | none | The name of the participant. This attribute is read-only and is obtained from the Identities service. This attribute cannot be used in a filter query. |
| type | string | false | none | The type of participant from the Identities service. This attribute is read-only and is obtained from the Identities service. This attribute cannot be used in a filter query. |
| avatarUri | string(uri) | false | none | The participant avatar URI. This attribute is read-only and is obtained from the Identities service. This attribute cannot be used in a filter query. |
| createdBy | string | false | none | The user who added this participant. |
| creationTimeStamp | string(date-time) | false | none | The timestamp of the participant object's creation. |
| modifiedBy | string | false | none | The user who last updated this participant. |
| modifiedTimeStamp | string(date-time) | false | none | The timestamp of the last participant object modification. |
| links | links | false | none | Links to related resources and operations. |
Enumerated Values
| Property | Value |
|---|---|
| role | owner |
| role | contributor |
| type | user |
| type | group |
activity
{
"resourceUri": "https://example.com",
"resourceName": "string",
"resourceType": "string",
"projectUris": [
"https://example.com"
],
"action": "string",
"user": "string",
"timeStamp": "2019-08-24T14:15:22Z",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
Activity
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resourceUri | string(uri) | false | none | The URI of the resource that is the target of this activity. |
| resourceName | string | false | none | The name of the resource that is the target of this activity. |
| resourceType | string | false | none | The type of the resource that is the target of this activity. |
| projectUris | [string] | false | none | The URIs of the projects containing the resource that is the target of this activity. |
| action | string | false | none | The action associated with this activity (such as create, update, and delete.). |
| user | string | false | none | The authenticated user that triggered the activity. |
| timeStamp | string(date-time) | false | none | The date and time that the activity was triggered. |
| properties | object | false | none | Additional properties that could be specified for the activity type. |
| » additionalProperties | string | false | none | none |
| version | integer | false | none | The version of the object. |
role
{
"id": "string",
"name": "string",
"description": "string",
"version": 0
}
Role
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string | false | none | The identifier of a specific role. |
| name | string | false | none | The localized name of the role. |
| description | string | false | none | The localized description of the role. |
| version | integer | false | none | The version of the object. |
projectCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"name": "string",
"description": "string",
"imageUri": "https://example.com",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0,
"id": "string",
"folderUri": "https://example.com",
"userCount": 0,
"groupCount": 0,
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Project Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Project Collection | any | false | none | A collection of project representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [project] | false | none | The array of project representations. |
resourceCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"version": 0,
"properties": {
"property1": "string",
"property2": "string"
},
"id": "string",
"name": "string",
"description": "string",
"contentType": "string",
"statusCode": 0,
"errorMessage": "string",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Resource Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Resource Collection | any | false | none | A collection of resource representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [resource] | false | none | The array of resource representations. |
participantCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"identityUri": "https://example.com",
"role": "contributor",
"version": 0,
"name": "string",
"type": "user",
"avatarUri": "https://example.com",
"createdBy": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedBy": "string",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Participant Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Participant Collection | any | false | none | A collection of participant representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [participant] | false | none | The array of participant representations. |
activityCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"resourceName": "string",
"resourceType": "string",
"projectUris": [
"https://example.com"
],
"action": "string",
"user": "string",
"timeStamp": "2019-08-24T14:15:22Z",
"properties": {
"property1": "string",
"property2": "string"
},
"version": 0
}
]
}
Activity Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Activity Collection | any | false | none | A collection of activity representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [activity] | false | none | The array of activity representations. |
roleCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0,
"items": [
{
"id": "string",
"name": "string",
"description": "string",
"version": 0
}
]
}
Role Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Role Collection | any | false | none | A collection of role representations. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection | false | none | This is a base schema used to define paginated collections of resources. This base schema is extended by other schemas in APIs by adding an 'items' array property. These extensions define the application/vnd.sas.collection media type (version 2) |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [role] | false | none | The array of role representations. |
baseCollection
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Properties
None
links
[
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
Links
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Links | [link] | false | none | Links to related resources and operations. |
api
{
"version": 1,
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
API
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | integer | true | none | The version number of the API representation. This is version 1. |
| links | [link] | true | none | The API's top-level links. |
error
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Properties
None
error2
{
"message": "string",
"id": "string",
"errorCode": 0,
"httpStatusCode": 0,
"details": [
"string"
],
"remediation": "string",
"errors": [
null
],
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | false | none | The message for the error. |
| id | string | false | none | The string ID for the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| errors | [error2] | false | none | Any additional errors that occurred. |
| links | [link] | false | none | The links that apply to the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
baseCollection2
{
"name": "string",
"start": 0,
"limit": 0,
"count": 0,
"accept": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
],
"version": 0
}
Base Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | The name of the collection. |
| start | integer(int64) | false | none | The zero-based index of the first item in the collection. |
| limit | integer | false | none | The number of items that were requested for the collection. |
| count | integer(int64) | false | none | If populated indicates the number of items in the collection. |
| accept | string | false | none | A space-delimited list of media types from which an Accept header may be constructed. |
| links | [link] | false | none | The links that apply to the collection. |
| version | integer | false | none | The version number of the collection representation. This representation is version 2. |
link
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
Link
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| method | string | false | none | The HTTP method for the link. |
| rel | string | true | none | The relationship of the link to the resource. |
| uri | string | false | none | The relative URI for the link. |
| href | string | false | none | The URL for the link. |
| title | string | false | none | The title for the link. |
| type | string | false | none | The media type or link type for the link. |
| itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
Externally Defined Media Types
application/vnd.sas.api
The application/vnd.sas.api media type is returned from a GET of the top-level context. It contains the links for basic operations on the service.
Link Relations
The link relations for the base URL (root of the API).
| Relation | Method | Description |
|---|---|---|
projects |
GET |
Returns a collection of projects. |
URI: /projects/projects. |
||
Item type: application/vnd.sas.project.summary. |
||
Response type: application/vnd.sas.collection. |
||
createProject |
POST |
Creates a new project. |
URI: /projects/projects. |
||
Response Type: application/vnd.sas.project |
||
activity |
GET |
Returns a collection of activities across all projects. |
URI: /projects/activities. |
||
Item type: application/vnd.sas.project.activity. |
||
Response Type: application/vnd.sas.collection. |
||
roles |
GET |
Returns a collection of valid roles for project participants. |
URI: /projects/roles. |
||
Item type: application/vnd.sas.project.role. |
||
Response Type: application/vnd.sas.collection. |
application/vnd.sas.project
The application/vnd.sas.project media type represents the data describing a project.
Link relations
| Relation | Method | Description |
|---|---|---|
self |
GET |
Retrieves the project resource. |
URI: /projects/projects/{projectId}. |
||
Response Type: application/vnd.sas.project. |
||
alternate |
GET |
Retrieves the project summary resource. |
URI: /projects/projects/{projectId}. |
||
Response Type: application/vnd.sas.project.summary. |
||
update |
PUT |
Updates the project resource. |
URI: /projects/project/{projectId}. |
||
Response Type: application/vnd.sas.project. |
||
delete |
DELETE |
Deletes the project resource. |
URI: /projects/projects/{projectId}. |
||
folder |
GET |
Retrieves the underlying folder for the project. |
URI: /folders/folders/{folderId}. |
||
Response Type: application/vnd.sas.content.folder. |
||
resources |
GET |
Retrieves the project resources. |
URI: /projects/projects/{projectId}/resources. |
||
Response Type: application/vnd.sas.collection. |
||
Item Type: application/vnd.sas.project.resource. |
||
addResource |
POST |
Adds a new project resource. |
URI: /projects/projects/{projectId}/resources. |
||
Response Type: application/vnd.sas.project.resource. |
||
participants |
GET |
Retrieves the project participants. |
URI: /projects/projects/{projectId}/participants. |
||
Response Type: application/vnd.sas.collection. |
||
Item Type: application/vnd.sas.project.participant. |
||
addParticipant |
POST |
Adds a new project participant. |
URI: /projects/projects/{projectId}/participants. |
||
Response Type: application/vnd.sas.project.participant. |
||
comments |
GET |
Retrieves the comments attached to the project. |
URI: /comments/comments?resourceUri={projectUri}. |
||
Response Type: application/vnd.sas.collection. |
||
Item Type: application/vnd.sas.comment. |
||
createComment |
POST |
Creates a comment attached to the project. |
URI: /comments/comments. |
||
Response Type: application/vnd.sas.comment. |
||
activities |
GET |
Retrieves the project-related activities. |
URI: /projects/projects/{projectId}/activities. |
||
Response Type: application/vnd.sas.collection. |
||
Item Type: application/vnd.sas.project.activity. |
application/vnd.sas.project.summary
The application/vnd.sas.project.summary media type describes the summary details of a project.
Link Relations
application/vnd.sas.project.summary has the following links of the application/vnd.sas.project media type:
* self
* delete
The following links of application/vnd.sas.project are not included:
* alternate
* update
* folder
* resources
* addResource
* participants
* addParticipant
* comments
* createComment
* activities
application/vnd.sas.project.resource
The application/vnd.sas.project.resource media type describes data representing a resource contained in a project.
These are resource references that are persisted directly in the Project Service and not the backing folder.
Link Relations
| Relation | Method | Description | |
|---|---|---|---|
self |
GET |
Retrieves the resource. | |
URI: /projects/projects/{projectId}/resources/{resourceId}. |
|||
Response Type: application/vnd.sas.project.resource. |
|||
update |
PUT |
Updates the resource. | |
URI: /projects/projects/{projectId}/resources/{resourceId}. |
|||
Response Type: application/vnd.sas.project.resource. |
|||
delete |
DELETE |
Deletes a resource. | |
URI: /projects/projects/{projectId}/resources/{resourceId}. |
|||
projects |
GET |
Retrieves the projects containing the resource. | |
URI: /projects/projects?resourceUri={resourceUri}. |
|||
Response Type: application/vnd.sas.collection. |
|||
Item Type: application/vnd.sas.project.summary. |
|||
up |
GET |
Gets the parent project. | |
URI: /projects/projects/{projectId}. |
|||
Response Type: application/vnd.sas.project. |
application/vnd.sas.project.participant
The application/vnd.sas.project.participant media type describes data representing a participant associated with a project.
Link Relations
| Relation | Method | Description | |
|---|---|---|---|
self |
GET |
Retrieves the participant data. | |
URI: /projects/projects/{projectId}/participants/{participantId}. |
|||
Response Type: [application/vnd.sas.project.participant](#application-vnd.sas.project.participant. |
|||
update |
PUT |
Updates the participant data. | |
URI: /projects/projects/{projectId}/participants/{participantId}. |
|||
Response Type: application/vnd.sas.project.participant. |
|||
delete |
DELETE |
Deletes the participant data. | |
URI: /projects/projects/{projectId}/participants/{participantId}. |
|||
projects |
GET |
Retrieves the projects containing this participant. | |
URI: /projects/projects?identityUri={identityUri}. |
|||
Response Type: application/vnd.sas.collection. |
|||
Item Type: application/vnd.sas.project.summary. |
|||
up |
GET |
Gets the participant's project. | |
URI: /projects/projects/{projectId}. |
|||
Response Type: application/vnd.sas.project. |
application/vnd.sas.project.activity
The application/vnd.sas.project.activity media type represents the data describing certain events related to a project. These could be created/modified/deleted events for the project itself, a participant or resource, or a member of the underlying folder.
These activities could be used to display an "activity feed", allowing users to see relevant information about changes to projects, including changes to their participants and content.
Link Relations
There are no links associated with activities as they are not mutable, and they are not individually retrievable.
application/vnd.sas.project.role
The application/vnd.sas.project.role media type represents a valid role for participants that are added to projects.
Roles determine the level of permissions that a participant has within the project.
Link Relations
There are no links associated with roles as they are not mutable, and they are not individually retrievable.
Methods in this API that operate on a collection support the following features:
* Pagination - The default page limit is set to 50 for all collections. This limit can be modified by specifying the ?limit query parameter when applicable.
* Sorting- A default sort order of ascending by name is automatically applied to the contents of the collections. An alternate sort order can be specified via the ?sortBy query parameter. A sort order can be applied only to the simple fields of a resource. Methods within this API do not support the various strength options as outlined by the sorting guidelines.
* Filtering - An optional ?filter parameter can be specified to query the exact set of items that should be included within the collection. Standard functional notation is supported.
* Standard functions are supported.
* The list of fields that can be searched on for projects by default include the following: name, description, creationTimeStamp, modifiedTimeStamp
* Example query strings are listed below:
* Filter by the name field of a project - ?filter=contains(name,"myProject")
* Filter by the name field startingWith - ?filter=startsWith(name,"myProj")
* Filter by name or description field - ?filter=or(contains(name,"myProject"),contains(description,"my project"))
Collection Resources
Path: /projects
This API provides collections of projects.
Links
The projects representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection of projects. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection of projects. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Path: /projects/{projectId}/resources
This API provides collections of project resources.
Links
The resources representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Path: /projects/{projectId}/participants
This API provides collections of project participants.
Links
The participants representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Path: /projects/{projectId}/activities
This API provides collections of project activities.
Links
The activities representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Path: /activities
This API provides collections of activities.
Links
The activities representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Path: /roles
This API provides collections of roles.
Links
The roles representation is application/vnd.sas.collection.
The response includes the following links:
| Relation | Method | Description | |
|---|---|---|---|
collection |
GET |
Returns a link to the collection. | |
Response type: application/vnd.sas.collection. |
|||
self |
GET |
Returns a link to the current page in the collection. | |
Response type: application/vnd.sas.collection. |
|||
first |
GET |
Returns a link to the first page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
prev |
GET |
Returns a link to the previous page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
next |
GET |
Returns a link to the next page of collection results. | |
Response type: application/vnd.sas.collection. |
|||
last |
GET |
Returns a link to the last page of collection results. | |
Response type: application/vnd.sas.collection. |
Deletion Behavior
When a project is deleted, the project, backing folder and all its content, resources, and participants are deleted. You do have the option to keep the backing folder.
Since a project must have at least one participant with a role of "owner", the last owner cannot be deleted. It is possible to have a project with no owners, if the identity of that owner is deleted from the Identities service. The project would be visible only to administrators who could delete the project or add a new owner.
Authorization Behavior
The authorizations of the project folder are synchronized with the project's participants. Project owners and contributors have permissions to read the project folder, as well as to add and remove members. Project owners also have read/write/add/remove/delete permissions for everything underneath the project folder. Owners and contributors can also add and remove resources from the project, but no other authorizations are implied on these resources. It is expected that the underlying storage mechanisms for these resources enforce their own security.
These authorizations are applied:
/projects
: authenticated-users: read
/projects/projects
: authenticated-users: read, create
: Projects collection is filtered by read permission on individual projects
/projects/projects/{projectId}
: owners: read, update, delete
: contributors: read
/projects/projects/{projectId}/participants/**
: owners: read, create, update, delete
: contributors: read
/projects/projects/{projectId}/resources/**
: owners: read, create, update, delete
: contributors: read, create, update, delete
/projects/projects/{projectId}/activities/**
: owners: read
: contributors: read
/projects/activities
: authenticated-users: read
: Activities collection is filtered by read permission on project associated with each activity
/projects/roles
: authenticated-users: read
These authorizations are applied to the backing folder:
/folders/folders/{folderId}
: owners: read, add, remove
: contributors: read, add, remove
/folders/folders/{folderId}/**
: owners: read, add, remove, update, delete
: contributors: read, add, remove, update, delete
Relationships
Base URLs:
- https://example.com/relationships
Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Relationships API manages the storage and discovery of relationships, and the retrieval of networks of relationship data.
Usage Notes
Overview
The Relationships API manages a repository of relationships, relationship types, and references.
Relationships
A relationship describes how two resources are connected. A relationship contains a subject resource, the related resource, and the relationship type.
Relationship Types
A relationship type describes the nature of the relationship between two resources. The relationship type includes a name, label, and description.
Relationships are either directional or non-directional. Directional relationships have a different role from related resource to the subject. For directional relationships, a partner name, partner label, and partner description are provided. Non-directional relationships have the same role to and from the subject to the related resource.
The set of relationship types is immutable.
The relationships types:
| Type Name | Label | Description | Partner Label | Partner Description | Directional |
|---|---|---|---|---|---|
| Dependent | Is dependent on | An object is dependent on another object when it cannot function or be defined without that related object being present. For example, a job could be dependent on a table. | Impacts | This object impacts the other. | true |
| Contains | Contains | An object contains another object when the included object does not exist without the object that includes it. For example, a table contains a column. | Is contained by | Is contained by the other. | true |
| Parent | Is parent of | An object is the parent of any object that cannot be located or found within a hierarchy without the parent object. | Is child of | Is the child of the other. | true |
| Associated | Is associated with | An object is associated with another object through a known or unknown system or method. For example, a table is associated with another table via foreign key -> primary key |
false | ||
| Equivalent | Is equal to | An object is equal to another object if it represents the same object accessed through another method or system. | false | ||
| Synonymous | Is synonymous with | An object is synonymous with another object if it is alike in meaning or significance. | false |
References
A reference is a metadata representation of a data asset or process. Networks of relationship data can contain URI references to multiple resources.
References can also contain metadata about resources from third-party applications for which the metadata would not be immediately available to users of this API.
Because the metadata about references is in the relationships repository, the metadata and the relationships network can be quickly retrieved.
A reference must have a resource URI and a content type. The resource URI is an address for the location of resource. The content type identifies the type of resource referenced, and typically corresponds to a registered type in the Object Type Registry Service.
The relationships service assigns an ID to the reference. The reference ID is used in the {referenceId} in the resource paths in this API, and the "id" member of a reference. The reference has an analysis time stamp indicating the time that the relationships for this resource were obtained. The reference can also have a source. The source is an indicator of the context from where this referenced resource was obtained. For example, a table modeled by Erwin in model.erx and stored in Oracle can be used by SAS for reporting and used by a third-party application for an ETL process. An import from each source would result in four references. The sources would be model.erx, JDBC connection information, sas, and the name of the third-party file or connection.
The reference caches information about the resource, including name, createdBy, modifiedBy, createdTimeStamp, modifiedTimeStamp. The created and modified members contain the user ID that created or modified the referenced resource. For third-party resources where the user ID of the original resource is unavailable, the user ID from the create/update request is used. The time stamps are the created and modified time stamps of the referenced resource. For third-party resources where an original time stamp is unavailable, the time stamp of the source file or the analysis time stamp is used.
Error Codes
The Relationships API uses the standard error response type application/vnd.sas.error to propagate all error messages and codes to the consumer.
The range of error codes assigned to the Relationships API is: 10600 - 10699
| HTTP Status Code | Error Code | Description |
|---|---|---|
| 400 | 10600 | No resource exists at the specified path. |
| 400 | 10601 | The JSON Patch is invalid. |
| 400 | 10602 | Invalid direction parameter. Valid values: to, from, both. |
| 409 | 10603 | A reference exists with the specified resource URI. |
| 409 | 10604 | A reference exists with the specified ID. |
| 409 | 10605 | A reference exists with a different id using the specified resource URI. |
| 412 | 10606 | The reference has been updated after you retrieved it. |
| 412 | 10607 | The value of the "if-match" header does not match the value of the current item. |
| 404 | 10608 | The reference was not found. |
| 409 | 10609 | A relationship exists with the specified relationship ID. |
| 409 | 10610 | A relationship exists with the specified resource URI, and related resource URI. |
| 404 | 10611 | Relationship type not found. |
| 409 | 10612 | The resource URI has already been added during this request. |
| 404 | 10613 | The relationship was not found. |
| 400 | 10614 | Only one of resourceUri or referenceId is allowed. |
| 400 | 10615 | If direction is provided, either resourceUri or referenceId must also be provided. |
| 400 | 10616 | An invalid patch operation was provided. This endpoint supports only "remove" operations. |
| 400 | 10617 | The ID in the URI does not match the ID in the body of the request. |
| 412 | 10618 | The PUT request must include an Etag in the "if-match" header or a last-modified timestamp in the "if-unmodified-since" header. |
| 409 | 10619 | A relationship already exists between the specified resource URI and the related resource URI. |
| 409 | 10620 | A job is already running. |
| 404 | 10621 | Job was not found. |
| 400 | 10622 | Invalid search options. |
Security
The Relationships API follows the common rules for SAS REST APIs, and requires authentication for all operations.
GET operations are allowed for all authenticated users.
POST, PUT, and DELETE operations require that a user be a SAS administrator or a SAS service.
Operations
Root
The operations for root.
Get the top-level links
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/ \
-H 'Accept: application/vnd.sas.api+json' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json',
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/relationships/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.api+json',
'Accept': 'application/vnd.sas.api+json'
}
r = requests.get('https://example.com/relationships/', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.api+json"},
"Accept": []string{"application/vnd.sas.api+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level collections surfaced through this API. These top level links will include "relationships", "types", and "references".
Authorization: Any authenticated user.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept | header | string | false | The desired representation for the response. |
Enumerated Values
| Parameter | Value |
|---|---|
| Accept | application/vnd.sas.api+json |
| Accept | application/json |
Example responses
200 Response
{
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"version": 1
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK. | api |
| 404 | Not Found | The service was not avaialable. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Relationships Management
The operations for relationships management.
Get a paginated list of relationships
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/relationships \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/relationships/relationships',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/relationships/relationships', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/relationships", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /relationships
Returns a paginated collection of relationships. The subject(s) are specified using either the resourceUri or the referenceId query parameter. Using resourceUri or referenceId in the filter parameter can conflict with the resourceUri or referenceId query parameter. Standard paging, filtering, and sorting options are provided. The media type of the returned items in the collection is application/vnd.sas.relationship+json. References may also be queried using POST /relationships#withQuery with the query string in the request body.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| resourceUri | query | string | false | The subject or subjects for which to get relationships. Specify multiple subjects by using the `' |
| referenceId | query | string | false | The ID of the subject or subjects for which to get relationships. Specify multiple subjects by using the `' |
| depth | query | integer(int32) | false | How deep to traverse the relationships tree. A value >1 specifies a recursive traversal through the list of related resources up to the specified depth. A value of -1 returns all relationships for all resources. The default setting is 1, which returns only direct relationships of the resource. |
| direction | query | string | false | The direction of the relationships to return. A relationship is defined as a resource URI "to" a related resource URI. A direction value of "from" returns relationships where the resource(s) indicated by the resourceUri or referenceId parameter is the related resource. A value of "both" returns all relationships that include the resource(s) indicated by the resourceUri or referenceId parameter. |
| start | query | integer(int64) | false | The 0-based start index of a paginated request. |
| limit | query | integer(int32) | false | The maximum number of items to return in this request. |
| sortBy | query | string(sort-criteria) | false | The sort criteria for returned relationships. Supports the following fields in either ascending or descending order: id, type, resourceUri, referenceId, relatedResourceUri, relatedReferenceId, source, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy. |
| filter | query | string(filter-criteria) | false | An expression for filtering the collection. Valid expressions include eq(member,"string"). Allowed members: id, resourceUri, type, relatedResourceUri, source, resource.type. The resource.type criteria is applied to each resource and related resource. When depth > 1, the relationship type and resource.type criteria are applied at each level. Relationships that are filtered out for a given level are not used to search the next level. |
Detailed descriptions
resourceUri: The subject or subjects for which to get relationships. Specify multiple subjects by using the '|' separator.
referenceId: The ID of the subject or subjects for which to get relationships. Specify multiple subjects by using the '|' separator.
depth: How deep to traverse the relationships tree. A value >1 specifies a recursive traversal through the list of related resources up to the specified depth. A value of -1 returns all relationships for all resources. The default setting is 1, which returns only direct relationships of the resource.
direction: The direction of the relationships to return. A relationship is defined as a resource URI "to" a related resource URI. A direction value of "from" returns relationships where the resource(s) indicated by the resourceUri or referenceId parameter is the related resource. A value of "both" returns all relationships that include the resource(s) indicated by the resourceUri or referenceId parameter.
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | relationshipCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Add a relationship
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/relationships \
-H 'Content-Type: application/vnd.sas.relationship+json' \
-H 'Accept: application/vnd.sas.relationship+json'
const inputBody = '{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.relationship+json',
'Accept':'application/vnd.sas.relationship+json'
};
fetch('https://example.com/relationships/relationships',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.relationship+json',
'Accept': 'application/vnd.sas.relationship+json'
}
r = requests.post('https://example.com/relationships/relationships', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.relationship+json"},
"Accept": []string{"application/vnd.sas.relationship+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/relationships", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /relationships
Adds a new relationship. A relationship requires a resource, a related resource and the relationship type. A resource can be specified by either a resource URI or a reference ID. The related resource can be defined by either a related resource URI or a related reference ID. Relationship uniqueness is defined by the combination of the resource and the related resource. If an invalid reference ID is provided a 404 is returned. If a reference does not exist for a resource URI a reeference will be created. When possible, additional resource information is queried and added to the reference. For resources external to the SAS system, the client should provide additional reference information. Attempting to add a relationship that already exists leaves the existing relationship unchanged.
Body parameter
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | createRelationship | true | A relationship. |
Example responses
201 Response
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The relationship was added. | relationship |
| 400 | Bad Request | The request was invalid. | error2 |
| 409 | Conflict | A relationship already exists between the resource URI and related resource URI. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | uri | Location (URL) of the new relationship. |
| 201 | ETag | string | The entity tag for the relationship. | |
| 201 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the relationship was last modified. |
Delete relationships
Code samples
# You can also use wget
curl -X PATCH https://example.com/relationships/relationships \
-H 'Content-Type: application/json-patch' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '[
{
"op": "delete",
"path": "/873f4dd0-14b1-4aa1-85d6-178c24171de"
},
{
"op": "delete",
"path": "/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"op": "delete",
"path": "/73b889d8-6a06-47df-a368-4b1e91cf39da"
}
]';
const headers = {
'Content-Type':'application/json-patch',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/relationships/relationships',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json-patch',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.patch('https://example.com/relationships/relationships', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json-patch"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/relationships/relationships", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /relationships
Delete a list of relationships. Uses a JSON Patch body with "op" : "remove" on a specific relationship ID. Clients which do not support PATCH can use POST and specify a query parameter of ?_method=PATCH. All referenced resources must exist for the PATCH to be applied.
Body parameter
[
{
"op": "delete",
"path": "/873f4dd0-14b1-4aa1-85d6-178c24171de"
},
{
"op": "delete",
"path": "/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"op": "delete",
"path": "/73b889d8-6a06-47df-a368-4b1e91cf39da"
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | multiDeleteCollection | false | The relationships. |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. The relationships were deleted. | relationshipCollection |
| 400 | Bad Request | The request was invalid. | error2 |
| 422 | Unprocessable Entity | Unprocessable entity. | error2 |
Check if relationship exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/relationships/relationships/{relationshipId}
fetch('https://example.com/relationships/relationships/{relationshipId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/relationships/relationships/{relationshipId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/relationships/relationships/{relationshipId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /relationships/{relationshipId}
Returns whether or not a relationship with the specified ID exists, along with appropriate headers.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| relationshipId | path | string | true | The relationship ID. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. The relationship exists. | None |
| 404 | Not Found | No relationship exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the relationship. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the relationship was last modified. |
Get a relationship
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/relationships/{relationshipId} \
-H 'Accept: application/vnd.sas.relationship+json'
const headers = {
'Accept':'application/vnd.sas.relationship+json'
};
fetch('https://example.com/relationships/relationships/{relationshipId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.relationship+json'
}
r = requests.get('https://example.com/relationships/relationships/{relationshipId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.relationship+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/relationships/{relationshipId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /relationships/{relationshipId}
Returns an existing relationship.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| relationshipId | path | string | true | The relationship ID. |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | relationship |
| 404 | Not Found | No relationship exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the relationship. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the relationship was last modified. |
Update a relationship
Code samples
# You can also use wget
curl -X PUT https://example.com/relationships/relationships/{relationshipId} \
-H 'Content-Type: application/vnd.sas.relationship+json' \
-H 'Accept: application/vnd.sas.relationship+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.relationship+json',
'Accept':'application/vnd.sas.relationship+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/relationships/relationships/{relationshipId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.relationship+json',
'Accept': 'application/vnd.sas.relationship+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.put('https://example.com/relationships/relationships/{relationshipId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.relationship+json"},
"Accept": []string{"application/vnd.sas.relationship+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/relationships/relationships/{relationshipId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /relationships/{relationshipId}
The PUT will fail if the ID in the body does match not the relationshipId. Only the type field can be updated.
Body parameter
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| relationshipId | path | string | true | The relationship ID. |
| If-Match | header | string | false | The eEag that was returned from a GET, POST, or PUT of this relationship. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the relationship. If the relationship has been updated since this time, the update will fail. |
| body | body | updateRelationship | true | The relationship. |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | relationship |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | No reference exists at the requested path. | None |
| 409 | Conflict | A conflict exists with an existing relationship. | None |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified time stamp. |
error2 |
| 428 | Precondition Required | The request headers did not include an If-Match or If-Unmodified-Since precondition. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Location | string | uri | Location (URL) of the new reference. |
| 200 | ETag | string | The entity tag for the reference. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the reference was last modified. |
Remove a relationship
Code samples
# You can also use wget
curl -X DELETE https://example.com/relationships/relationships/{relationshipId}
fetch('https://example.com/relationships/relationships/{relationshipId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/relationships/relationships/{relationshipId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/relationships/relationships/{relationshipId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /relationships/{relationshipId}
Removes the specified relationship. This operation will not remove references even if there are no relationships which use the referenced resource.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| relationshipId | path | string | true | The relationship ID. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The relationship was deleted. | None |
| 404 | Not Found | No relationship exists at the requested path. | None |
Update or create relationships
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/relationships#multiPost \
-H 'Content-Type: application/vnd.sas.collection+json' \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.collection+json',
'Accept':'application/vnd.sas.collection+json',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/relationships/relationships#multiPost',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.collection+json',
'Accept': 'application/vnd.sas.collection+json',
'If-Unmodified-Since': 'string'
}
r = requests.post('https://example.com/relationships/relationships#multiPost', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.collection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/relationships#multiPost", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /relationships#multiPost
A relationship requires a resource, a related resource, and a relationship type. A resource can be specified by either a resource URI or a reference ID. The related resource can be defined by either a related resource URI or a related reference ID. Relationship uniqueness is defined by the combination of the resource and the related resource. When the ID is provided, this operation performs a full replacement of the relationship. When no ID is provided, and the relationship is not unique, the relationship is not updated. The parameter ?onConflict=update can be used to update existing relationships with a matching resource and related URIs. The ID field cannot be updated during this operation. The response is a collection of application/vnd.sas.relationship resources. When a resource creation or update fails, the collection includes an application/vnd.sas.error object that describes why the operation failed. If an invalid reference ID is provided a 404 is returned. If a reference does not exist for a resource URI a reeference will be created. When possible, additional resource information is queried and added to the reference. For resources external to the SAS system, the client should provide additional reference information. The media type application/vnd.sas.collection+json is required for this endpoint to prevent ambiguity with other POST operations to this collection.
Body parameter
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| onConflict | query | string | false | How to handle conflicts when a reference already exists. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the relationship. If the relationship has been updated since this time, the update will fail. This header is only required when the onConflict='update' parameter is specified, and is only applied to relationships being updated. |
| body | body | createRelationshipCollection | true | A collection of application/vnd.sas.relationship resources. |
Enumerated Values
| Parameter | Value |
|---|---|
| onConflict | update |
| onConflict | ignore |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | relationshipCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Get paginated list of relationships via query
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/relationships#withQuery \
-H 'Content-Type: application/vnd.sas.relationship.query+json' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '{
"resourceUri": [
"string"
],
"referenceId": [
"string"
],
"depth": 0,
"direction": "string",
"filter": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.relationship.query+json',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/relationships/relationships#withQuery',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.relationship.query+json',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.post('https://example.com/relationships/relationships#withQuery', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.relationship.query+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/relationships#withQuery", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /relationships#withQuery
Returns a paginated collection of relationships. Standard paging, filtering, and sorting options are provided. The media type of the returned items in the collection is application/vnd.sas.relationship+json. This call is an extended GET operation and therefore idempotent.
Body parameter
{
"resourceUri": [
"string"
],
"referenceId": [
"string"
],
"depth": 0,
"direction": "string",
"filter": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer(int64) | false | The 0-based start index of a paginated request. |
| limit | query | integer(int32) | false | The maximum number of items to return in this request. |
| sortBy | query | string(sort-criteria) | false | The sort criteria supports the following fields in ascending or descending order: id, type, resourceUri, referenceId, relatedResourceUri, relatedReferenceId, source, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy. |
| body | body | relationshipQuery | true | relationshipQuery |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | relationshipCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Relationships Types Management
The operations for relationships types management.
Get relationships types
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/types \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Language':'string'
};
fetch('https://example.com/relationships/types',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/relationships/types', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/types", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /types
Returns a collection of relationships types. The media type of the returned collection items is application/vnd.sas.relationship.type+json. Accept-Language is specified to return locale-specific labels and descriptions.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Language | header | string | false | The lanaguage/locale to use for localizable content. |
| start | query | integer | false | The starting index of the first reference in a page. |
| limit | query | integer | false | The maximum number of references to return in this page of results. The actual number of returned references may be less if the collection has been exhausted. |
| filter | query | string(filter-criteria) | false | Filter criteria for returned references. Filters are supported on the following top level fields for references: name, description, directional, label, partnerName, partnerDescription, partnerLabel. |
| sortBy | query | string(sort-criteria) | false | Sort returned resources. The sort criteria supports the following fields in ascending or descending order: name, description, directional, label, partnerName, partnerDescription, partnerLabel. |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"name": "string",
"description": "string",
"label": "string",
"partnerLabel": "string",
"partnerDescription": "string",
"directional": true,
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | typeCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Get relationship type
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/types/{typeName} \
-H 'Accept: application/vnd.sas.relationship.type+json' \
-H 'Accept-Language: string'
const headers = {
'Accept':'application/vnd.sas.relationship.type+json',
'Accept-Language':'string'
};
fetch('https://example.com/relationships/types/{typeName}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.relationship.type+json',
'Accept-Language': 'string'
}
r = requests.get('https://example.com/relationships/types/{typeName}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.relationship.type+json"},
"Accept-Language": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/types/{typeName}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /types/{typeName}
Returns information about a relationship type. The default return media type is application/vnd.sas.relationship.type+json. To return locale-specific labels and descriptions, specify an Accept-Language.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Language | header | string | false | The lanaguage/locale to use for localizable content. |
| typeName | path | string | true | The type name. |
Example responses
200 Response
{
"name": "string",
"description": "string",
"label": "string",
"partnerLabel": "string",
"partnerDescription": "string",
"directional": true,
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | type |
| 404 | Not Found | No type exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
References Management
The operations for references management.
Get references
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/references \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: application/vnd.sas.summary+json'
const headers = {
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'application/vnd.sas.summary+json'
};
fetch('https://example.com/relationships/references',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'application/vnd.sas.summary+json'
}
r = requests.get('https://example.com/relationships/references', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"application/vnd.sas.summary+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/references", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references
Returns a collection of references. Standard paging, filtering, and sorting options are provided. The default media type of the returned items in the collection is application/vnd.sas.relationship.reference+json. References may also be queried using POST /references#withQuery with the query string in the request body.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | false | An alternative media type that the service recognizes. Optional. If the service can not provide the media type, a 406 response is returned. |
| start | query | integer | false | The starting index of the first reference in a page. |
| limit | query | integer | false | The maximum number of references to return in this page of results. The actual number of returned references may be less if the collection has been exhausted. |
| filter | query | string(filter-criteria) | false | Filter criteria for returned references. Filters are supported on the following top level fields for references: id, name, resourceUri, type, source, analysisTimeStamp, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy. |
| sortBy | query | string(sort-criteria) | false | Sort the returned resources. The sort criteria supports the following fields in ascending or descending order: id, name, resourceUri, type, source, analysisTimeStamp, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy. |
Enumerated Values
| Parameter | Value |
|---|---|
| Accept-Item | application/vnd.sas.summary+json |
| Accept-Item | application/vnd.sas.relationship.reference+json |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | referenceCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Create a new reference
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/references \
-H 'Content-Type: application/vnd.sas.relationship.reference+json' \
-H 'Accept: application/vnd.sas.relationship.reference+json'
const inputBody = '{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}';
const headers = {
'Content-Type':'application/vnd.sas.relationship.reference+json',
'Accept':'application/vnd.sas.relationship.reference+json'
};
fetch('https://example.com/relationships/references',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.relationship.reference+json',
'Accept': 'application/vnd.sas.relationship.reference+json'
}
r = requests.post('https://example.com/relationships/references', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.relationship.reference+json"},
"Accept": []string{"application/vnd.sas.relationship.reference+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/references", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /references
The resource URI must be set by the client within the request body, and this URI must be unique across the entire system.
Body parameter
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | createReference | true | The new reference. |
Example responses
201 Response
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The reference was created. | reference |
| 400 | Bad Request | The request was invalid. | error2 |
| 405 | Method Not Allowed | Method Not Allowed. The resource was not allowed to be created. | None |
| 409 | Conflict | There was a conflict. A reference exists with the resource URI. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Location | string | uri | Location (URL) of the new reference. |
| 201 | ETag | string | The entity tag for the reference. | |
| 201 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the reference was last modified. |
Delete references
Code samples
# You can also use wget
curl -X PATCH https://example.com/relationships/references \
-H 'Content-Type: application/json-patch' \
-H 'Accept: application/vnd.sas.collection+json'
const inputBody = '[
{
"op": "delete",
"path": "/873f4dd0-14b1-4aa1-85d6-178c24171de"
},
{
"op": "delete",
"path": "/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"op": "delete",
"path": "/73b889d8-6a06-47df-a368-4b1e91cf39da"
}
]';
const headers = {
'Content-Type':'application/json-patch',
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/relationships/references',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json-patch',
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.patch('https://example.com/relationships/references', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json-patch"},
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://example.com/relationships/references", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /references
Delete a list of references. Uses a JSON Patch body with "op" : "remove" on a specific reference ID. Clients which do not support PATCH can use POST and specify a query parameter of ?_method=PATCH. All referenced resources must exist for the PATCH to be applied.
Body parameter
[
{
"op": "delete",
"path": "/873f4dd0-14b1-4aa1-85d6-178c24171de"
},
{
"op": "delete",
"path": "/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"op": "delete",
"path": "/73b889d8-6a06-47df-a368-4b1e91cf39da"
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | multiDeleteCollection | false | references |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | referenceCollection |
| 400 | Bad Request | The request was invalid. | error2 |
| 422 | Unprocessable Entity | Unprocessable entity. | error2 |
Update or create references
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/references#multiPost \
-H 'Content-Type: application/vnd.sas.collection+json' \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}
]
}';
const headers = {
'Content-Type':'application/vnd.sas.collection+json',
'Accept':'application/vnd.sas.collection+json',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/relationships/references#multiPost',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.collection+json',
'Accept': 'application/vnd.sas.collection+json',
'If-Unmodified-Since': 'string'
}
r = requests.post('https://example.com/relationships/references#multiPost', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.collection+json"},
"Accept": []string{"application/vnd.sas.collection+json"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/references#multiPost", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /references#multiPost
Updates or creates references. When the ID is provided for a reference in the collection, the operation performs a full replacement of the reference. If no ID is provided, and the resource URI is not unique in the system, the reference is not updated (the default). The parameter ?onConflict=update can be used to update existing references with a matching resource URI. The ID field can not be updated during this operation. If the reference does not exist, one is created. The response will be a collection of application/vnd.sas.relationship.reference resources. If a reference creation or update fails, the collection will include an application/vnd.sas.error object that describes why the reference failed. The specific media type of application/vnd.sas.collection+json is required for this endpoint to prevent ambiguity with other POST operations to this collection.
Body parameter
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| onConflict | query | string | false | How to handle conflicts when a reference already exists. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the reference. If the reference has been updated since this time, the update will fail. This header is required only when the onConflict='update' parameter is specified and is applied only to updated references. |
| body | body | createReferenceCollection | true | A collection of application/vnd.sas.relationship.reference resources. |
Enumerated Values
| Parameter | Value |
|---|---|
| onConflict | update |
| onConflict | ignore |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | referenceCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Get a paginated list of references
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/references#withQuery \
-H 'Content-Type: text/plain' \
-H 'Accept: application/vnd.sas.collection+json' \
-H 'Accept-Item: application/vnd.sas.summary+json'
const inputBody = 'string';
const headers = {
'Content-Type':'text/plain',
'Accept':'application/vnd.sas.collection+json',
'Accept-Item':'application/vnd.sas.summary+json'
};
fetch('https://example.com/relationships/references#withQuery',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'text/plain',
'Accept': 'application/vnd.sas.collection+json',
'Accept-Item': 'application/vnd.sas.summary+json'
}
r = requests.post('https://example.com/relationships/references#withQuery', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"text/plain"},
"Accept": []string{"application/vnd.sas.collection+json"},
"Accept-Item": []string{"application/vnd.sas.summary+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/references#withQuery", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /references#withQuery
Returns a paginated collection of references. Standard paging, filtering, and sorting options are provided. The default media type of the returned items in the collection is application/vnd.sas.relationship.reference+json. This call is an extended GET operation and therefore idempotent. The body of the request contains the query parameters and filters to apply to the request. To find references with the content type of table the body of the request would be eq(contentType, "table").
Body parameter
string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Accept-Item | header | string | false | An alternative media type that the service recognizes. Optional. If the service can not provide the media type, a 406 response is returned. |
| start | query | integer | false | The starting index of the first reference in a page. |
| limit | query | integer | false | The maximum number of references to return in this page of results. The actual number of returned references can be less if the collection has been exhausted. |
| sortBy | query | string(sort-criteria) | false | Sort the returned resources. The sort criteria supports the following fields in ascending or descending order: id, name, resourceUri, type, source, analysisTimeStamp, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy. |
| body | body | filterText | true | The filter criteria for returned references. Filters are supported on the following top level fields for references: id, name, resourceUri, type, source, analysisTimeStamp, modifiedTimeStamp, creationTimeStamp, createdBy, and modifiedBy. |
Enumerated Values
| Parameter | Value |
|---|---|
| Accept-Item | application/vnd.sas.summary+json |
| Accept-Item | application/vnd.sas.relationship.reference+json |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | referenceCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Get reference
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/references/{referenceId} \
-H 'Accept: application/vnd.sas.relationship.reference+json'
const headers = {
'Accept':'application/vnd.sas.relationship.reference+json'
};
fetch('https://example.com/relationships/references/{referenceId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.relationship.reference+json'
}
r = requests.get('https://example.com/relationships/references/{referenceId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.relationship.reference+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/references/{referenceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/{referenceId}
Returns information about a single reference based on its unique id. The default media type returned is application/vnd.sas.relationship.reference+json.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| referenceId | path | string | true | reference id |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | reference |
| 404 | Not Found | No reference exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the reference. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the reference was last modified. |
Check if reference exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/relationships/references/{referenceId}
fetch('https://example.com/relationships/references/{referenceId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/relationships/references/{referenceId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/relationships/references/{referenceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /references/{referenceId}
Returns whether or not a reference with the specified ID exists, along with appropriate headers.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| referenceId | path | string | true | The reference ID. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. The reference exists. | None |
| 404 | Not Found | No reference exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | ETag | string | The entity tag for the reference. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the reference was last modified. |
Update a reference
Code samples
# You can also use wget
curl -X PUT https://example.com/relationships/references/{referenceId} \
-H 'Content-Type: application/vnd.sas.resources.reference+json' \
-H 'Accept: application/vnd.sas.resources.reference+json' \
-H 'If-Match: string' \
-H 'If-Unmodified-Since: string'
const inputBody = '{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string"
}';
const headers = {
'Content-Type':'application/vnd.sas.resources.reference+json',
'Accept':'application/vnd.sas.resources.reference+json',
'If-Match':'string',
'If-Unmodified-Since':'string'
};
fetch('https://example.com/relationships/references/{referenceId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/vnd.sas.resources.reference+json',
'Accept': 'application/vnd.sas.resources.reference+json',
'If-Match': 'string',
'If-Unmodified-Since': 'string'
}
r = requests.put('https://example.com/relationships/references/{referenceId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.resources.reference+json"},
"Accept": []string{"application/vnd.sas.resources.reference+json"},
"If-Match": []string{"string"},
"If-Unmodified-Since": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/relationships/references/{referenceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /references/{referenceId}
Update a reference. The resourceUri can not be updated during this operation. The PUT will fail if the ID in the body does not match the referenceId.
Body parameter
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| referenceId | path | string | true | The reference ID. |
| If-Match | header | string | false | The Etag that was returned from a GET, POST, or PUT of this reference. |
| If-Unmodified-Since | header | string | false | The value of the lastModified date of the reference. If the reference has been updated since this time, the update will fail. |
| body | body | updateReference | true | The reference. |
Example responses
200 Response
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | reference |
| 400 | Bad Request | The request was invalid. | error2 |
| 404 | Not Found | No reference exists at the requested path. | None |
| 412 | Precondition Failed | The If-Match request header did not match the resource's entity tag, or the If-Unmodified-Since request header did not match the resource's last modified time stamp. |
error2 |
| 428 | Precondition Required | The request headers did not include an If-Match or If-Unmodified-Since precondition. |
error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Location | string | uri | The URL of the reference. |
| 200 | ETag | string | The entity tag for the reference. | |
| 200 | Last-Modified | string | date-time | The time stamp in EEE, dd MMM yyyy HH:mm:ss GMT format when the reference was last modified. |
Delete a reference
Code samples
# You can also use wget
curl -X DELETE https://example.com/relationships/references/{referenceId}
fetch('https://example.com/relationships/references/{referenceId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/relationships/references/{referenceId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/relationships/references/{referenceId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /references/{referenceId}
Deletes the specified reference and permanently removes it from the system along with the relationships which use this reference.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| referenceId | path | string | true | The reference ID. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The reference was deleted. | None |
| 404 | Not Found | No reference exists at the requested path. | None |
Get the list values for a reference source
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/references/referenceSources \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/relationships/references/referenceSources',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.collection+json'
}
r = requests.get('https://example.com/relationships/references/referenceSources', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.collection+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/references/referenceSources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/referenceSources
Provides a list of distinct values used for a reference source.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| start | query | integer(int64) | false | The 0-based start index of a paginated request. |
| limit | query | integer(int32) | false | The maximum number of items to return in this request. |
Example responses
200 Response
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
"string"
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. The collection returned will include an item for each distinct value present in the sytem for the reference source member. | sourceValuesCollection |
| 400 | Bad Request | The request was invalid. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Jobs Management
The operations for jobs management.
Get a job
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/jobs/{jobId} \
-H 'Accept: application/vnd.sas.relationship.job.load+json'
const headers = {
'Accept':'application/vnd.sas.relationship.job.load+json'
};
fetch('https://example.com/relationships/jobs/{jobId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.relationship.job.load+json'
}
r = requests.get('https://example.com/relationships/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.relationship.job.load+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Get a job.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The job ID. |
Example responses
200 Response
{
"id": "string",
"state": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"endTimeStamp": "2019-08-24T14:15:22Z",
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok. | loadJob |
| 404 | Not Found | No job exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Remove a job
Code samples
# You can also use wget
curl -X DELETE https://example.com/relationships/jobs/{jobId}
fetch('https://example.com/relationships/jobs/{jobId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/relationships/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/relationships/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Removes the specified job. Job will be stopped if it is running.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The job ID. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | The job was deleted. | None |
| 404 | Not Found | No job exists at the requested path. | None |
Get the state of the job
Code samples
# You can also use wget
curl -X GET https://example.com/relationships/jobs/{jobId}/state \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/relationships/jobs/{jobId}/state',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'text/plain'
}
r = requests.get('https://example.com/relationships/jobs/{jobId}/state', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/plain"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/relationships/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Returns the state of the job: running, completed, or failed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| jobId | path | string | true | The job ID. |
Example responses
200 Response
"string"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The state of the job. | string |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | The media type of the response body. |
Load metadata for types
Code samples
# You can also use wget
curl -X POST https://example.com/relationships/jobs \
-H 'Accept: application/vnd.sas.relationship.job.load+json'
const headers = {
'Accept':'application/vnd.sas.relationship.job.load+json'
};
fetch('https://example.com/relationships/jobs',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.relationship.job.load+json'
}
r = requests.post('https://example.com/relationships/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.relationship.job.load+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/relationships/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Loads metadata for types.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| type | query | string | false | The type or types for which to load relationships. Default is all types. |
Example responses
202 Response
{
"id": "string",
"state": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"endTimeStamp": "2019-08-24T14:15:22Z",
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 202 | Accepted | The request was accepted. | loadJob |
| 409 | Conflict | Unable to accept the request. | error2 |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 202 | Location | string | uri | The URL of the job. |
Schemas
createReference
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}
Create reference
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resourceUri | string(uri) | true | none | The URI of the resource that this reference represents. |
| contentType | string | false | none | The type of the resource this refers to. This will be "report", or "storedprocess" or whatever type string is appropriate for the resource. The type should be registered with the types service so that services that retrieve this resource can look up the correct media type and endpoints for retrieving resources of this type. Also, it is very important that this value matches the type field of the summary representation (that is, the application/vnd.sas.summary+json representation). |
| source | string | false | none | Source for this reference. This is an indicator of the context from which the referenced resource was obtained. For a resource external to the deployment the source value is defined either by the process providing the resource inforamtion or is user-defined. For resources populated from within the deployment the default value is sas. |
| analysisTimeStamp | string(date-time) | false | none | Time stamp of the relationship analysis for this reference. |
| creationTimeStamp | string(date-time) | false | none | Time stamp of the creation of the referenced resource not this resource. For a resource external to the deployment, where an original time stamp is unavailable, the time stamp of the source file or the analysis time stamp will be used. |
| modifiedTimeStamp | string(date-time) | false | none | Time stamp of last modification of the referenced resource not this resource. For a resource external to the deployment, where an original time stamp is unavailable, the time stamp of the source file or the analysis time stamp will be used. |
| createdBy | string | false | none | The id of the user who created the referenced resource not this resource. For a resource external to the deployment, where the original user id is unavailable, the user id from the create / update request will be used. |
| modifiedBy | string | false | none | The id of the last user who modified the referenced resource not this resource. For a resource external to the deployment, where the original user id is unavailable, the user id from the create / update request will be used. |
| name | string | false | none | The name of the referenced resource. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
createReferenceCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0
}
]
}
Create references collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Create references collection | any | false | none | A collection used to create multiple references. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [createReference] | false | none | The array of application/vnd.sas.relationship.reference representations. |
referenceCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
References collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| References collection | any | false | none | A collection of references. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [reference] | false | none | The array of application/vnd.sas.relationship.reference representations. |
updateReference
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string"
}
Update reference resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Update reference resource | any | false | none | The reference to update. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | createReference | false | none | Used to create a single reference. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | false | none | System-assigned unique ID for this object. |
reference
{
"resourceUri": "https://example.com",
"contentType": "string",
"source": "string",
"analysisTimeStamp": "2019-08-24T14:15:22Z",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"name": "string",
"version": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Reference resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Reference resource | any | false | none | A reference contains basic information about a resource for which there is a relationship. This is the application/vnd.sas.relationship.reference media type. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | updateReference | false | none | The reference to update. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » links | [link] | false | none | Links that apply to this object. If provider is read only, the links will include "self", "alternate", and "relationships". If provider is not read only, the links will include "self", "alternate", "delete", "update", and "relationships". |
relationshipCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Relationships collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Relationships collection | any | false | none | A collection of relationships. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [relationship] | false | none | The array of application/vnd.sas.relationship representations. |
createRelationshipCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}
]
}
Create relationships collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Create relationships collection | any | false | none | A collection used to create multiple relationships. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [createRelationship] | false | none | The array of application/vnd.sas.relationship representations. |
createRelationship
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0
}
Create relationship
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resourceUri | string(uri) | true | none | The URI of the subject resource of this relationship. |
| referenceId | string | false | none | The id of the reference for the subject resource. |
| type | string | true | none | The id of this relationship type. |
| relatedResourceUri | string(uri) | true | none | The URI of the related resource of this relationship. |
| relatedReferenceId | string | false | none | The id of the reference for the related resource. |
| source | string(uri) | false | none | The source of this relationship. Typically the URI of the resource that manages this relationship. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
updateRelationship
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string"
}
Update relationship resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Update relationship resource | any | false | none | Update relationship resource. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | createRelationship | false | none | Used to create a single relationship. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | false | none | System-assigned unique ID for this object. |
relationship
{
"resourceUri": "https://example.com",
"referenceId": "string",
"type": "string",
"relatedResourceUri": "https://example.com",
"relatedReferenceId": "string",
"source": "https://example.com",
"version": 0,
"id": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"modifiedTimeStamp": "2019-08-24T14:15:22Z",
"createdBy": "string",
"modifiedBy": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Relationship resource
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Relationship resource | any | false | none | The connection between a subject resource and a related resource. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | updateRelationship | false | none | Update relationship resource. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » creationTimeStamp | string(date-time) | false | none | Timestamp of relationship creation. |
| » modifiedTimeStamp | string(date-time) | false | none | Timestamp of last relationship modification. |
| » createdBy | string | false | none | The id of the user who created the relationship. |
| » modifiedBy | string | false | none | The id of the last user who modified the relationship. |
| » links | [link] | false | none | Links that apply to this object. If provider is read only, the links will include "self". If provider is not read only, the links will include "self", "delete", "update". |
typeCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
{
"name": "string",
"description": "string",
"label": "string",
"partnerLabel": "string",
"partnerDescription": "string",
"directional": true,
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
]
}
Relationship types collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Relationship types collection | any | false | none | A collection of relationship types. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [type] | false | none | The array of application/vnd.sas.relationship.type representations. |
type
{
"name": "string",
"description": "string",
"label": "string",
"partnerLabel": "string",
"partnerDescription": "string",
"directional": true,
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Relationship type
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | Identifier for the relationship type. |
| description | string | false | none | Description of the relationship type. |
| label | string | false | none | Label for the relationship from the subject to the target. |
| partnerLabel | string | false | none | Label of the relationship from the target to the subject. |
| partnerDescription | string | false | none | Description of the relationship from the target to the subject. |
| directional | boolean | false | none | Set to true if the role for the relationship type is depends upon the direction of the relationship. Set to false if the relationship is bi-directional. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
| links | [link] | false | none | Links that apply to this relationship type. Includes "self". |
sourceValuesCollection
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0,
"items": [
"string"
]
}
Distinct values collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Distinct values collection | any | false | none | A collection of distinct source values. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | baseCollection2 | false | none | A collection of objects. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » items | [string] | false | none | The collection of source values. |
multiDeleteCollection
[
{
"op": "delete",
"path": "/873f4dd0-14b1-4aa1-85d6-178c24171de"
},
{
"op": "delete",
"path": "/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"op": "delete",
"path": "/73b889d8-6a06-47df-a368-4b1e91cf39da"
}
]
Multi-delete collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Multi-delete collection | [multiDelete] | false | none | A collection of resources to remove. |
multiDelete
{
"op": "delete",
"path": "string"
}
JSONPatch document
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| op | string | true | none | Operation set to 'remove'. |
| path | string | true | none | The id of the resource to remove. |
Enumerated Values
| Property | Value |
|---|---|
| op | delete |
relationshipQuery
{
"resourceUri": [
"string"
],
"referenceId": [
"string"
],
"depth": 0,
"direction": "string",
"filter": "string"
}
Relationship query
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resourceUri | [string] | false | none | The subject or subjects for which to get relationships. |
| referenceId | [string] | false | none | The ID of subject or subjects for which to get relationships. |
| depth | integer | false | none | The value used to control how deep to traverse the relationships tree. A value greater than 1 implies a recursive traversal through the list of related resources up to the specified depth. A value of -1 will result in all relationships for all resources returned. The default setting is 1, which implies only direct relationships of the resource will be returned. |
| direction | string | false | none | The value used to control the direction of the relationships returned. A relationship is defined as resource uri "to" related resource uri. A value of "from" will return relationships where the resource(s) indicated by the resourceUri or referenceId parameter is the related resource. A value of "both" will return all relationships that include the resource(s) indicated by the resourceUri or referenceId parameter. |
| filter | string | false | none | An expression for filtering the collection. Valid expressions include eq(member,\"string\"). Allowed members are id, resourceUri, type, relatedResourceUri, source, and resource.type. The resource.type criteria is applied to each resource and related resource. When depth > 1, the relationship type and resource.type criteria are applied at each level. Relationships that are filtered out for a given level are not used to search the next level. |
loadJob
{
"id": "string",
"state": "string",
"creationTimeStamp": "2019-08-24T14:15:22Z",
"endTimeStamp": "2019-08-24T14:15:22Z",
"version": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
]
}
Job that loads metadata
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string | false | none | System-assigned unique ID for this object. |
| state | string | false | none | The job's state, one of running, completed, or failed. |
| creationTimeStamp | string(date-time) | false | none | Timestamp of job creation. |
| endTimeStamp | string(date-time) | false | none | Timestamp of job creation. |
| version | integer | false | none | This media type's schema version number. This representation is version 1. |
| links | [link] | false | none | Links that apply to this job type. Includes "self". |
filterText
"string"
Filter text
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Filter text | string(filter-criteria) | false | none | The filter criteria. |
api
{
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"version": 1
}
API
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| links | [link] | false | none | The API's top-level links. |
| version | integer | false | none | The version number of the API representation. This is version 1. |
error2
{
"details": [
"string"
],
"errorCode": 0,
"errors": [
null
],
"httpStatusCode": 0,
"id": "string",
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"message": "string",
"remediation": "string",
"version": 0
}
Error
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| details | [string] | false | none | Messages that provide additional details about the cause of the error. |
| errorCode | integer | false | none | The numeric ID for the error. |
| errors | [error2] | false | none | Any additional errors that occurred. |
| httpStatusCode | integer | true | none | The HTTP status code for the error. |
| id | string | false | none | The string ID for the error. |
| links | [link] | false | none | The links that apply to the error. |
| message | string | false | none | The message for the error. |
| remediation | string | false | none | A message that describes how to resolve the error. |
| version | integer | true | none | The version number of the error representation. This representation is version 2. |
baseCollection2
{
"accept": "string",
"count": 0,
"limit": 0,
"links": [
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
],
"name": "string",
"start": 0,
"version": 0
}
Base Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| accept | string | false | none | A space-delimited list of media types from which an Accept header may be constructed. |
| count | integer(int64) | false | none | If populated indicates the number of items in the collection. |
| limit | integer | false | none | The number of items that were requested for the collection. |
| links | [link] | false | none | The links that apply to the collection. |
| name | string | false | none | The name of the collection. |
| start | integer(int64) | false | none | The zero-based index of the first item in the collection. |
| version | integer | false | none | The version number of the collection representation. This representation is version 2. |
link
{
"href": "string",
"itemType": "string",
"method": "string",
"rel": "string",
"responseItemType": "string",
"responseType": "string",
"title": "string",
"type": "string",
"uri": "string"
}
Link
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| href | string | false | none | The URL for the link. |
| itemType | string | false | none | If this is a link to a container, itemType is the media type or link type for the items in the container. |
| method | string | false | none | The HTTP method for the link. |
| rel | string | false | none | The relationship of the link to the resource. |
| responseItemType | string | false | none | The media type or link type of the items in the response body for a PUT, POST, or PATCH operation. |
| responseType | string | false | none | The media type or link type of the response body for a PUT, POST, or PATCH operation. |
| title | string | false | none | The title for the link. |
| type | string | false | none | The media type or link type for the link. |
| uri | string | false | none | The relative URI for the link. |
Examples
Media Type Samples
application/vnd.sas.collection
A paginated, filterable, sortable collection of resource representations. In this API, this is a collection of application/vnd.sas.relationship, application/vnd.sas.relationship.reference, or application/vnd.sas.relationship.type representations.
See application/vnd.sas.collection.
application/vnd.sas.summary+json
Represents a summary of a resource.
See application/vnd.sas.summary
application/vnd.sas.error
Represents an error response.
See application/vnd.sas.error.
application/vnd.sas.relationship
Provides relationship information. The schema is at relationship.
application/vnd.sas.relationship+json
Here is an example of the JSON representation of this media type.
{
"version": 1,
"resourceUri": "/tables/654",
"referenceId": "03896389-6c4c-4e94-a5c0-5e76646b7667",
"id": "873f4dd0-14b1-4aa1-85d6-178c24171de",
"relatedResourceUri": "/libraries/452",
"relatedReferenceId": "1113970d-43ef-4635-8da5-abe32e9f8712",
"source": "/libraries/452",
"type": "associated",
"creationTimeStamp": "2015-09-22T21:20:43.454Z",
"modifiedTimeStamp": "2015-09-22T21:20:43.454Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de",
"uri": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de",
"type": "application/vnd.sas.relationship"
},
{
"method": "PUT",
"rel": "update",
"href": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de",
"uri": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de",
"type": "application/vnd.sas.relationship"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de",
"uri": "/relationships/relationships/873f4dd0-14b1-4aa1-85d6-178c24171de"
}
]
}
application/vnd.sas.relationship.type
Provides descriptive information and labels for predefined relationship types. The schema is at relationshipType
application/vnd.sas.relationship.type+json
Here is an example of the JSON representation of this media type.
{
"version": 1,
"name": "dependent",
"description": "Any application modeling a depends upon relationship between entities. An object depends upon an object when it cannot function or be defined without that related object being present. Job->Table",
"label": "Is dependent on",
"directional": true,
"partnerLabel": "Impacts",
"partnerDescription": "This object impacts the other.",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/relationships/types/dependent",
"uri": "/relationships/types/dependent",
"type": "application/vnd.sas.relationship.type"
}
]
}
application/vnd.sas.relationship.reference
A reference to a resource. The reference includes the location and media type, and will cache certain information about the resource like the name, creationTimeStamp, createdBy, modifiedTimeStamp, and modifiedBy.
The schema is at reference.
application/vnd.sas.relationship.reference+json
Here is an example of the JSON representation of this media type.
{
"version": 1,
"id": "57657df4-f11b-46d7-a551-060b1605ee4e",
"resourceUri": "/libraries/123",
"contentType": "library",
"source": "sas",
"name": "BIDdata",
"analysisTimestamp": "2015-09-22T21:20:43.454Z",
"creationTimeStamp": "2015-09-22T21:20:43.454Z",
"modifiedTimeStamp": "2015-09-22T21:20:43.454Z",
"createdBy": "bob",
"modifiedBy": "bob",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e",
"type": "application/vnd.sas.relationship.reference"
},
{
"method": "PUT",
"rel": "update",
"href": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e",
"type": "application/vnd.sas.relationship.reference"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/references/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"method": "GET",
"rel": "relationships",
"href": "/relationships/relationships?referenceId=57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/relationships?referenceId=57657df4-f11b-46d7-a551-060b1605ee4e",
"type:": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.relationship.reference"
}
]
}
application/vnd.sas.relationship.query
Provides query parameters for searching relationships. The query can include a list of resource URIs or reference IDs, depth, direction, and a filter.
The schema is at relationshipQuery.
application/vnd.sas.relationship.query+json
Here is an example of the JSON representation of this media type.
{
"version": 1,
"referenceIds": ["57657df4-f11b-46d7-a551-060b1605ee4e"],
"filter": "eq(type, 'Contains')"
}
application/vnd.sas.relationship.job.load
Provides the state of the job.
The schema is at loadJob
application/vnd.sas.relationship.job.load+json
Here is an example of the JSON representation of this media type.
{
"version" : 1,
"id" : "a8b86fc0-d4f1-4d35-91ae-6ae35335ed97",
"state" : "running",
"creationTimeStamp" : "2015-03-18T10:20:00Z",
"endTimeStamp" : "2015-03-18T11:24:00Z",
"links" : [
{
"method": "GET",
"rel": "self",
"href": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e",
"type": "application/vnd.sas.relationship.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e",
"uri": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e"
},
{
"method": "GET",
"rel": "state",
"href": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e/state",
"uri": "/relationships/jobs/57657df4-f11b-46d7-a551-060b1605ee4e/state",
"type" : "text/plain"
}
]
}
Resource Relationships

## Root
Path: /
The root of the API. This resource contains links the top-level resources in the API. The top-level links include relationships, relationship types, references, and jobs.
| Relation | Method | Description |
|---|---|---|
| relationships | GET | Returns the first page of the collection of relationships. |
| URI: /relationships | ||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.relationship |
||
| createRelationship | POST | Adds a new relationship. |
| URI: /relationships | ||
Request type: application/vnd.sas.relationship |
||
Response type: application/vnd.sas.relationship |
||
| types | GET | Returns the first page of the collection of relationship types. |
| URI: /types | ||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.relationship.type |
||
| references | GET | Returns the first page of the collection of references. |
| URI: /references | ||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.relationship.reference |
||
| createReference | POST | Adds a new resource reference. |
| URI: /references | ||
Request type: application/vnd.sas.relationship.reference |
||
Response type: application/vnd.sas.relationship.reference |
||
| startLoad | POST | Loads relationships for types supporting relationships. |
| URI: /jobs | ||
Request type: application/vnd.sas.relationship.job.load |
||
Response type: application/vnd.sas.relationship.job.load |
Relationships
Path: /relationships
This API provides collections of relationships. Members of the /relationships collection are relationships, /relationships/{relationshipId}.
Links
The relationships collection representation is application/vnd.sas.collection.
The collection items are application/vnd.sas.relationship resources.
These types apply to the response for the self, collection, prev, next, first, and last links, below.
Responses include the following links.
| Relation | Method | Description |
|---|---|---|
| relationshipsQuery | POST | Returns the first page of the collection of relationships. Enables query parameters to be passed in the body of the request. |
| createRelationship | POST | Adds a new relationship to the collection. |
Present only on the /relationships collection if the user has create permission. |
||
Request type: application/vnd.sas.relationship |
||
Response type: application/vnd.sas.relationship |
||
| updateRelationships | POST | Updates or creates relationships in the collection. The input is a collection of application/vnd.sas.relationship resources. If a relationship does not already exist, one is created. |
Present only on the /relationships collection if the user has create permission. |
||
| patchRelationships | PATCH | Deletes a list of relationships. Uses a JSON Patch body with "op" : "remove" on a specific relationship id. Clients that do not support PATCH can use POST and specify a query parameter of ?_method=PATCH. |
Present only on the /relationships collection if the user has create permission. |
||
| self | GET | Returns the current page from the collection. |
| collection | GET | Returns the first page of the collection, without sorting or filtering criteria. |
| prev | GET | Returns the previous page of resources from the collection. |
| Present if not at the start of the collection. | ||
| next | GET | Returns the next page of resources from the collection. |
| Present if not at the end of the collection. | ||
| first | GET | Returns the first page of resources from the collection. |
| Present if not at the start of the collection. | ||
| last | GET | Returns the last page of resources from the collection. |
| Present if not at the end of the collection. |
Sorting and Filtering
The subject(s) are specified using the resourceUri or referenceId query parameter. Use of resourceUri or referenceId in the filter parameter can create a conflict with the resourceUri or referenceId query parameter. These collections can be sorted and filtered using the ?sortBy= and ?filter= query parameters.
The default sort order for the /relationships collection is by id.
Filtering and sorting can use the following members of the relationship:
idtyperelatedResourceUrirelatedReferenceIdsourcemodifiedTimeStampcreationTimeStampcreatedBymodifiedBy
Filtering can also be done using the following members of the reference using resource or relatedResource.
contentTypesource
Request relationships for a single subject using resourceUri:
?resourceUri=/table/123
Request relationships for multiple subjects:
?resourceUri=/table/123|/report/345
Request relationships for a single subject using referenceId:
?referenceId=03896389-6c4c-4e94-a5c0-5e76646b7667
Request relationships for multiple subjects:
?referenceId=1113970d-43ef-4635-8da5-abe32e9f8712|a374fac5-3be6-43ce-ac4b-6c0f96ea61fc
Note that clients must URL encode the | character as %7c.
Filter by relationship type:
?resourceUri=/table/123&filter=contains(type,"associated")
Filter by reference content type:
?resourceUri=/table/123&filter=contains(relatedResource.contentType, "report")
Combining filters:
?resourceUri=/table/123&filter=and(contains(relatedResource.contentType, "report"), contains(type,"dependent"))
Relationship
Path: /relationships/{relationshipId}
A specific relationship.
Links
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the full/complete representation of the relationship. |
| update | PUT | Updates a relationship. |
| Present only if the user has create permission. | ||
| delete | DELETE | Deletes the relationship. |
| Present only if the user has create permission. |
Relationship types
Path: /types
Links
The types collection representation is application/vnd.sas.collection.
The collection items are application/vnd.sas.relationship.types resources.
These types apply to the response for the self, collection, prev, next, first, and last links below.
Responses include the following links.
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the current page from the collection. |
| collection | GET | Returns the first page of the collection, without sorting or filtering criteria. |
| prev | GET | Returns the previous page of resources from the collection. |
| Present if not at the start of the collection. | ||
| next | GET | Returns the next page of resources from the collection. |
| Present if not at the end of the collection. | ||
| first | GET | Returns the first page of resources from the collection. |
| Present if not at the start of the collection. | ||
| last | GET | Returns the last page of resources from the collection. |
| Present if not at the end of the collection. |
Sorting and Filtering
These collections can be sorted and filtered using the ?sortBy= and ?filter= query parameters.
The default sort order for the /types collection is by name.
Filtering and sorting can use the following members of the relationshipType:
namedescriptiondirectionallabelpartnerDescriptionpartnerLabel
Relationship type
Path: /types/{typeName}
A specific relationship type.
Links
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the full/complete representation of the relationship type. |
References
Path: /references
This API provides collections of references.
Members of the /references collection are references, /references/{referenceId}.
Links
The references collection representation is application/vnd.sas.collection.
The collection items are application/vnd.sas.relationship.reference resources.
These types apply to the response for the self, collection, prev, next, first, and last links, below.
Responses include the following links.
| Relation | Method | Description |
|---|---|---|
| referencesQuery | POST | Returns the first page of the collection of references. Allows for query parameters to be passed in the body of the request. |
| createReference | POST | Adds a new reference to the collection. |
This link is available only on the /references collection if the user has create permission. |
||
Request type: application/vnd.sas.relationship.reference |
||
Response type: application/vnd.sas.relationship.reference |
||
| updateReferences | POST | Updates or creates references in the collection. The input is a collection of application/vnd.sas.relationship.reference resources. If a reference does not already exist, one is created. |
This link is available only on the /references collection if the user has create permission. |
||
| patchReferences | PATCH | Deletes references in the collection. Uses a JSON Patch body with "op" : "remove" on a specific reference ID. Clients that do not support PATCH can use POST to specify a query parameter of ?_method=PATCH. |
This link is available only on the /references collection if the user has create permission. |
||
| self | GET | Returns the current page from the collection. |
| collection | GET | Returns the first page of the collection, without sorting or filtering criteria. |
| prev | GET | Returns the previous page of resources from the collection. This link is omitted if the current view is on the first page. |
| next | GET | Returns the next page of resources from the collection. This link is omitted if the current view is on the last page of the collection. |
| first | GET | Returns the first page of resources from the collection. This link is omitted if the current view is on the first page. |
| last | GET | Returns the last page of resources from the collection. This link is omitted if the current view is on the last page. |
Sorting and Filtering
These collections can be sorted and filtered using the ?sortBy= and ?filter= query parameters.
The default sort order for the /references collection is by id.
Filtering and sorting can use the following members of the reference:
idnameresourceUricontentTypesourceanalysisTimeStampmodifiedTimeStampcreationTimeStampcreatedBymodifiedBy
Reference
Path: /references/{referenceId}
A specific reference.
Links
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the full/complete representation of the reference. |
| alternate | GET | Returns a summary representation of the reference returns application/vnd.sas.summary. |
| updateReference | PUT | Updates a reference. |
| Present only if the user has create permission. | ||
| deleteReference | DELETE | Deletes the reference. |
| Present only if the user has create permission. |
Reference Sources
Path: `/references/referenceSources
This API provides a collection of distinct values for the source member of a reference.
Links
The referenceSources collection representation is application/vnd.sas.collection.
The collection items are String values.
These types apply to the response for the self, collection, prev, next, first, and last links below.
Responses include the following links.
| Relation | Method | Description |
|---|---|---|
| self | GET | Returns the current page from the collection. |
| collection | GET | Returns the first page of the collection, without sorting or filtering criteria. |
| prev | GET | Returns the previous page of resources from the collection. |
| Present if not at the start of the collection. | ||
| next | GET | Returns the next page of resources from the collection. |
| Present if not at the end of the collection. | ||
| first | GET | Returns the first page of resources from the collection. |
| Present if not at the start of the collection. | ||
| last | GET | Returns the last page of resources from the collection. |
| Present if not at the end of the collection. |
Sorting and Filtering
The default sort order for the /references/referenceSources collection is by source.
SAS Logon
Base URLs:
- https://example.com/sasLogon
Terms of service Email: SAS Developers Web: SAS Developers
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The SAS Logon API provides the standard OAuth protocol endpoints through which clients obtain access tokens to make API calls.
Terminology:
- Client: An application making protected resource requests on behalf of the resource owner and with its authorization.
Usage Notes
Overview
Most SAS Viya APIs require authentication for all operations, and many require authorization. For SAS Viya APIs, authentication and authorization require a valid access token. The SAS Logon API provides the standard OAuth protocol endpoints through which clients obtain access tokens to make subsequent API calls. Access tokens are obtained when a client makes a request and authenticates to the SAS Logon API with a valid form of authorization, which is expressed in the form of an authorization grant.
Developers must first have their SAS administrator register a client identifier. The SAS administrator then provides API developers with the client identifier and client secret to use in API calls. Developers must use the client identifier and secret in all API calls.
Operations
Client Administration
Contains the operations for administering the Client resource.
Return collection of clients
Code samples
# You can also use wget
curl -X GET https://example.com/sasLogon/oauth/clients \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/sasLogon/oauth/clients',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://example.com/sasLogon/oauth/clients', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/sasLogon/oauth/clients", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /oauth/clients
Returns the collection of clients registered.
Authorization: Bearer token with clients.read, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| filter | query | string | false | The SCIM filter for querying clients. The default is 'client_id pr'. |
| sortBy | query | string | false | The field to sort results by. The default is client_id. |
| sortOrder | query | string | false | The sort order of results by ascending or descending order. The default is ascending. |
| startIndex | query | integer | false | The index of the first result on which to begin the page. The default is 1. |
| count | query | integer | false | The number of results per page. The default is 100. |
Example responses
A GET request to list clients.
{
"items": [
{
"scope": [
"clients.read",
"clients.write"
],
"client_id": "XCUNhS",
"resource_ids": [
"none"
],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://ant.path.wildcard/**/passback/*",
"http://test1.com"
],
"autoapprove": [
"true"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "tCZeCV",
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name",
"lastModified": 1548439765963
}
],
"startIndex": 1,
"itemsPerPage": 1,
"totalResults": 1,
"schemas": [
"http://cloudfoundry.org/schema/scim/oauth-clients-1.0"
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | clientCollection |
| 400 | Bad Request | The request was invalid. An invalid query parameter was specified. | None |
Create client
Code samples
# You can also use wget
curl -X POST https://example.com/sasLogon/oauth/clients \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
const inputBody = '{
"scope": [
"clients.read",
"clients.write"
],
"client_id": "FYBc34",
"client_secret": "secret",
"resource_ids": [],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://test1.com",
"http://ant.path.wildcard/**/passback/*"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "mOxTVD",
"autoapprove": [
"true"
],
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://example.com/sasLogon/oauth/clients',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://example.com/sasLogon/oauth/clients', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sasLogon/oauth/clients", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /oauth/clients
Creates a new client.
Authorization: Bearer token with clients.write, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Body parameter
An example of a request body for creating a client
{
"scope": [
"clients.read",
"clients.write"
],
"client_id": "FYBc34",
"client_secret": "secret",
"resource_ids": [],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://test1.com",
"http://ant.path.wildcard/**/passback/*"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "mOxTVD",
"autoapprove": [
"true"
],
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | clientIn | true | The client to be created. |
Example responses
An example of performing a POST request to create a client
{
"scope": [
"clients.read",
"clients.write"
],
"client_id": "FYBc34",
"resource_ids": [
"none"
],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://ant.path.wildcard/**/passback/*",
"http://test1.com"
],
"autoapprove": [
"true"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "mOxTVD",
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name",
"lastModified": 1548439765169,
"required_user_groups": []
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | A client object was created. The secret is masked in the response. | client |
| 400 | Bad Request | The request was invalid. | errorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Content-Type | string | Type of returned content. |
Determine whether client exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/sasLogon/oauth/clients/{clientId}
fetch('https://example.com/sasLogon/oauth/clients/{clientId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sasLogon/oauth/clients/{clientId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sasLogon/oauth/clients/{clientId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /oauth/clients/{clientId}
Returns whether the client that is specified in the request exists.
Authorization: Bearer token with clients.read, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| clientId | path | string | true | The ID of the request client. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The requested client exists. | None |
| 404 | Not Found | No client exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | Type of returned content. |
Return client
Code samples
# You can also use wget
curl -X GET https://example.com/sasLogon/oauth/clients/{clientId} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('https://example.com/sasLogon/oauth/clients/{clientId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://example.com/sasLogon/oauth/clients/{clientId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/sasLogon/oauth/clients/{clientId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /oauth/clients/{clientId}
Returns the client that is specified in the request.
Authorization: Bearer token with clients.read, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| clientId | path | string | true | The ID of the requested client. |
Example responses
A GET request to retrieve client.
{
"scope": [
"clients.read",
"clients.write"
],
"client_id": "dm13Sn",
"resource_ids": [
"none"
],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://ant.path.wildcard/**/passback/*",
"http://test1.com"
],
"autoapprove": [
"true"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "KWIYYl",
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name",
"lastModified": 1548439766817,
"required_user_groups": []
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | client |
| 404 | Not Found | No client exists at the requested path. | None |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Content-Type | string | Type of returned content. |
Update client
Code samples
# You can also use wget
curl -X PUT https://example.com/sasLogon/oauth/clients/{clientId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
const inputBody = '{
"scope": [
"clients.new",
"clients.autoapprove"
],
"client_id": "P5yPMY",
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://redirect.url"
],
"autoapprove": [
"clients.autoapprove"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://example.com/sasLogon/oauth/clients/{clientId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('https://example.com/sasLogon/oauth/clients/{clientId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/sasLogon/oauth/clients/{clientId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /oauth/clients/{clientId}
Updates the existing client that is specified in the request. This method performs a full replacement of the client resource. The ID may not be changed.
Authorization: Bearer token with clients.write, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Body parameter
An example of a request body for updating a client
{
"scope": [
"clients.new",
"clients.autoapprove"
],
"client_id": "P5yPMY",
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://redirect.url"
],
"autoapprove": [
"clients.autoapprove"
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| clientId | path | string | true | The ID of the request client. |
| body | body | clientIn | true | The client to be updated. |
Example responses
An example of performing a PUT request to update a client
{
"scope": [
"clients.new",
"clients.autoapprove"
],
"client_id": "P5yPMY",
"resource_ids": [
"none"
],
"authorized_grant_types": [
"client_credentials"
],
"redirect_uri": [
"http://redirect.url"
],
"autoapprove": [
"clients.autoapprove"
],
"authorities": [
"clients.read",
"clients.write"
],
"token_salt": "9UnUQG",
"allowedproviders": [
"uaa",
"ldap",
"my-saml-provider"
],
"name": "My Client Name",
"lastModified": 1548439762286,
"required_user_groups": []
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded and the updated client object is returned. The secret is masked in the response. | client |
| 400 | Bad Request | The request was invalid. | errorResponse |
| 404 | Not Found | No client exists at the requested path. The requested client could not be updated. | None |
Delete client
Code samples
# You can also use wget
curl -X DELETE https://example.com/sasLogon/oauth/clients/{clientId}
fetch('https://example.com/sasLogon/oauth/clients/{clientId}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('https://example.com/sasLogon/oauth/clients/{clientId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://example.com/sasLogon/oauth/clients/{clientId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /oauth/clients/{clientId}
Deletes the client that is specified in the request.
Authorization: Bearer token with clients.write, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| clientId | path | string | true | The ID of the request client. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | client deleted | None |
| 404 | Not Found | No client exists at the requested path. The requested client could not be found or was deleted successfully. | None |
Change secret
Code samples
# You can also use wget
curl -X PUT https://example.com/sasLogon/oauth/clients/{clientId}/secret \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
const inputBody = '{
"clientId": "1le3s6",
"secret": "new_secret"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://example.com/sasLogon/oauth/clients/{clientId}/secret',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('https://example.com/sasLogon/oauth/clients/{clientId}/secret', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://example.com/sasLogon/oauth/clients/{clientId}/secret", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /oauth/clients/{clientId}/secret
Changes the secret for the client that is specified in the request.
Authorization: Bearer token with clients.write, clients.admin, zones.{zoneId}.admin, or equivalent (SASAdministrators) scope.
Body parameter
An example of a request body to change a secret.
{
"clientId": "1le3s6",
"secret": "new_secret"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| clientId | path | string | true | The ID of the request client. |
| body | body | clientSecretIn | true | The client secret information |
Example responses
An example of performing a PUT request to change a secret.
{
"status": "ok",
"message": "secret updated"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. The secret was updated. | None |
| 400 | Bad Request | The request was invalid. | errorResponse |
| 404 | Not Found | No client exists at the requested path. The requested client could not be updated. | None |
Response Schema
Obtain an access token to create a client
Code samples
# You can also use wget
curl -X POST https://example.com/sasLogon/oauth/clients/consul?serviceId=string \
-H 'Accept: application/json' \
-H 'X-Consul-Token: string'
const headers = {
'Accept':'application/json',
'X-Consul-Token':'string'
};
fetch('https://example.com/sasLogon/oauth/clients/consul?serviceId=string',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-Consul-Token': 'string'
}
r = requests.post('https://example.com/sasLogon/oauth/clients/consul', params={
'serviceId': 'string'
}, headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Consul-Token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sasLogon/oauth/clients/consul", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /oauth/clients/consul
Authenticate with Consul to obtain an OAuth access token for registering a new client.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| X-Consul-Token | header | string | false | A Consul ACL token. |
| callback | query | boolean | false | This setting should be false, normally, so the access token is delivered in the response to this request. If true, the access token is delivered via a callback to the /oauth/register endpoint of the service's registered address in Consul. |
| serviceId | query | string | true | The ID of the service or app that will be using the token to register a client. When using callback=true, this must match a service registered in Consul. |
Example responses
An example of using consul ACL token to obtain an OAuth access token that can be used to create a new client.
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImxlZ2FjeS10b2tlbi1rZXkiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiIzNTM4ZTQxNTEyNDY0NmU3YTJiZjA1NDBlNTM3MjNlNSIsInN1YiI6IjAzMzNiODlkLTc5MjUtNDllZS04N2Y3LTQ4YzY1Mzg2N2RlZCIsInNjb3BlIjpbIm9wZW5pZCIsImdyb3VwMSIsImdyb3VwMiIsImdyb3VwMyJdLCJjbGllbnRfaWQiOiJhcHAiLCJjaWQiOiJhcHAiLCJhenAiOiJhcHAiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX2lkIjoiMDMzM2I4OWQtNzkyNS00OWVlLTg3ZjctNDhjNjUzODY3ZGVkIiwib3JpZ2luIjoidWFhIiwidXNlcl9uYW1lIjoiYm9iIiwiZW1haWwiOiJub25lIiwiYXV0aF90aW1lIjoxNTIyMTY3MTY3LCJyZXZfc2lnIjoiOWEzYzI0ZWQiLCJpYXQiOjE1MjIxNjcxNjcsImV4cCI6MTUyMjIxMDM2NywiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLnNhcy5jb20vU0FTTG9nb24vb2F1dGgvdG9rZW4iLCJ6aWQiOiJ1YWEiLCJhdWQiOlsiYXBwIiwib3BlbmlkIl19.EOpYXf5acyiTn1wY5Tjr9vdu5Ez_UyPnYriMPlR9DkDTPtxxphdCiQweMEx8bjevWmFhDV-m4MDFm9F551F36cyhkpaXq39Xu6My_iDdc-xdAMvm04PHhz6p2NDSjCrmg9L5remIK-WQDyN3klkKNQvuN2V8jklVoXVMj_bBgpg",
"token_type": "bearer",
"expires_in": 43199,
"scope": "uaa.admin",
"jti": "fd558f0226df43cfbe12e044e3ac1d45"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. An access token has been provided. | None |
| 400 | Bad Request | The request was invalid. This is usually the result of an invalid Consul ACL token. | None |
| 404 | Not Found | No service exists at the requested path. The service could not be found in Consul. This is returned only when using callback=true. | None |
Response Schema
Authorization
Contains the operations for client authorization.
Grant access using client credentials
Code samples
# You can also use wget
curl -X POST https://example.com/sasLogon/oauth/token#client_credentials \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: string'
const inputBody = '{
"grant_type": "client_credentials"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization':'string'
};
fetch('https://example.com/sasLogon/oauth/token#client_credentials',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'Authorization': 'string'
}
r = requests.post('https://example.com/sasLogon/oauth/token#client_credentials', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"Authorization": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sasLogon/oauth/token#client_credentials", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /oauth/token#client_credentials
Obtains an access token based on client credentials that have been granted to the registered client application. The SAS Logon service verifies the supplied client credentials. If they are valid, an access token is returned. Obtaining access tokens via client credentials grant works only with SAS Viya APIs that do not enforce authorization.
Body parameter
An example of a request body for obtaining an access token using its client credentials
grant_type: client_credentials
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | false | The basic authorization header containing the registered OAuth client identifier and secret. Optional if this information is passed as part of the form data. |
| body | body | object | false | none |
| » client_id | body | string | false | The client identifier for the registered OAuth client and recipient of the token. Optional if this information is passed as part of the Authorization header. |
| » client_secret | body | string | false | The client secret for the registered OAuth client. Optional if this information is passed as part of the Authorization header. |
| » grant_type | body | string | true | The type of authentication used to obtain the token. In this case, 'client_credentials'. |
| » scope | body | string | false | The space-limited list of scopes. Defaults to get all the authorities registered to the client. |
Example responses
An example of a client application obtaining an access token using its client credentials
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImxlZ2FjeS10b2tlbi1rZXkiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiIzMjJmZGIyOTAyYzg0YTUxYTY2N2I5MGI5OWZhMWYwNiIsInN1YiI6ImFwcCIsImF1dGhvcml0aWVzIjpbInVhYS5ub25lIl0sInNjb3BlIjpbInVhYS5ub25lIl0sImNsaWVudF9pZCI6ImFwcCIsImNpZCI6ImFwcCIsImF6cCI6ImFwcCIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJyZXZfc2lnIjoiNjY4ZjYzYjkiLCJpYXQiOjE1MjIxNjY2MTEsImV4cCI6MTUyMjIwOTgxMSwiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLnNhcy5jb20vU0FTTG9nb24vb2F1dGgvdG9rZW4iLCJ6aWQiOiJ1YWEiLCJhdWQiOlsiYXBwIl19.VPuBsB2Yod-OKtt87nhjPFlkkhG3eN48CvFkbxvWli5hDYMihTmTBVTSuAAdqaZoesNwSICYWmjBbS0FJkIp5kNKxuxb8sEtwUa8zVS5FZy0D9Ocir1mS5Fgz7ox0u6YQDXKe_mC6tij8YaYzRxJiS-fcVe6vCaRjXHbIRqVQ3U",
"token_type": "bearer",
"expires_in": 43199,
"scope": "uaa.none",
"jti": "322fdb2902c84a51a667b90b99fa1f06"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » access_token | string | false | none | The access token to use for subsequent API calls. |
| » token_type | string | false | none | The type of access token issued (for example, 'bearer'). |
| » expires_in | integer | false | none | The number of seconds until the token expires. |
| » scope | string | false | none | The space-limited list of scopes authorized for this client. |
| » jti | string | false | none | The globally unique identifier for this token. |
Grant access using password
Code samples
# You can also use wget
curl -X POST https://example.com/sasLogon/oauth/token#password \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: string'
const inputBody = '{
"grant_type": "password",
"username": "bob",
"password": "bobspassword"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization':'string'
};
fetch('https://example.com/sasLogon/oauth/token#password',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'Authorization': 'string'
}
r = requests.post('https://example.com/sasLogon/oauth/token#password', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"Authorization": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sasLogon/oauth/token#password", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /oauth/token#password
Obtains an access token on behalf of an end user, using that user's authenticating credentials (such as username and password) along with the client identifier and the associated secret that have been registered with the SAS environment. The user credentials are validated. If they are valid, the SAS Logon API returns an access token. Obtaining access tokens on behalf of an end user is required for all SAS Viya APIs that support user and group authorization rules.
Body parameter
An example of a request body for obtaining an access token on behalf of an end user by providing the users password credentials
grant_type: password
username: bob
password: bobspassword
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | false | The basic authorization header containing the registered OAuth client identifier and secret. Optional if this information is passed as part of the form data. |
| body | body | object | false | none |
| » client_id | body | string | false | The client identifier for the registered OAuth client and recipient of the token. Optional if this information is passed as part of the Authorization header. |
| » client_secret | body | string | false | The client secret for the registered OAuth client. Optional if this information is passed as part of the Authorization header. |
| » grant_type | body | string | true | The type of authentication used to obtain the token. In this case, 'password'. |
| » response_type | body | string | false | The type of token that should be issued. |
| » username | body | string | true | The username of the end user for whom the client is obtaining an access token on behalf of. |
| » password | body | string | true | The end user's password. |
| » scope | body | string | false | The space-limited list of scopes. Usually omitted, defaults to the scope registered to the client. |
Example responses
An example of a client application obtaining an access token on behalf of an end user by providing the users password credentials
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImxlZ2FjeS10b2tlbi1rZXkiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiIzNTM4ZTQxNTEyNDY0NmU3YTJiZjA1NDBlNTM3MjNlNSIsInN1YiI6IjAzMzNiODlkLTc5MjUtNDllZS04N2Y3LTQ4YzY1Mzg2N2RlZCIsInNjb3BlIjpbIm9wZW5pZCIsImdyb3VwMSIsImdyb3VwMiIsImdyb3VwMyJdLCJjbGllbnRfaWQiOiJhcHAiLCJjaWQiOiJhcHAiLCJhenAiOiJhcHAiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX2lkIjoiMDMzM2I4OWQtNzkyNS00OWVlLTg3ZjctNDhjNjUzODY3ZGVkIiwib3JpZ2luIjoidWFhIiwidXNlcl9uYW1lIjoiYm9iIiwiZW1haWwiOiJub25lIiwiYXV0aF90aW1lIjoxNTIyMTY3MTY3LCJyZXZfc2lnIjoiOWEzYzI0ZWQiLCJpYXQiOjE1MjIxNjcxNjcsImV4cCI6MTUyMjIxMDM2NywiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLnNhcy5jb20vU0FTTG9nb24vb2F1dGgvdG9rZW4iLCJ6aWQiOiJ1YWEiLCJhdWQiOlsiYXBwIiwib3BlbmlkIl19.EOpYXf5acyiTn1wY5Tjr9vdu5Ez_UyPnYriMPlR9DkDTPtxxphdCiQweMEx8bjevWmFhDV-m4MDFm9F551F36cyhkpaXq39Xu6My_iDdc-xdAMvm04PHhz6p2NDSjCrmg9L5remIK-WQDyN3klkKNQvuN2V8jklVoXVMj_bBgpg",
"token_type": "bearer",
"expires_in": 43199,
"scope": "openid group1 group2 group3",
"jti": "322fdb2902c84a51a667b90b99fa1f06"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
| 400 | Bad Request | The request was invalid. | errorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » access_token | string | false | none | The access token to use for subsequent API calls. |
| » token_type | string | false | none | The type of access token issued (for example, 'bearer'). |
| » id_token | string | false | none | The OIDC token that may be used by the client to authenticate the end user. |
| » expires_in | integer | false | none | The number of seconds until the token expires. |
| » scope | string | false | none | The space-limited list of scopes authorized for this client. |
| » jti | string | false | none | The globally unique identifier for this token. |
Grant access using authorization code
Code samples
# You can also use wget
curl -X POST https://example.com/sasLogon/oauth/token#authorization_code \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: string'
const inputBody = '{
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"response_type": "string",
"code": "string",
"scope": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization':'string'
};
fetch('https://example.com/sasLogon/oauth/token#authorization_code',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'Authorization': 'string'
}
r = requests.post('https://example.com/sasLogon/oauth/token#authorization_code', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"Authorization": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sasLogon/oauth/token#authorization_code", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /oauth/token#authorization_code
Obtains an access token on behalf of an end user, using an authorization code provided by the user along with the client identifier and the associated secret that have been registered with the SAS environment. The authorization code is validated and can be used only once. If it is valid, the SAS Logon API returns an access token. Obtaining access tokens on behalf of an end user is required for all SAS Viya APIs that support user and group authorization rules.
Body parameter
client_id: string
client_secret: string
grant_type: string
response_type: string
code: string
scope: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | false | The basic authorization header containing the registered OAuth client identifier and secret. Optional if this information is passed as part of the form data. |
| body | body | object | false | none |
| » client_id | body | string | false | The client identifier for the registered OAuth client and recipient of the token. Optional if this information is passed as part of the Authorization header. |
| » client_secret | body | string | false | The client secret for the registered OAuth client. Optional if this information is passed as part of the Authorization header. |
| » grant_type | body | string | true | The type of authentication used to obtain the token. In this case, 'authorization_code'. |
| » response_type | body | string | false | The type of token that should be issued. |
| » code | body | string | true | The authorization code provided by the end user for whom the client is obtaining an access token on behalf of. |
| » scope | body | string | false | The space-limited list of scopes. Usually omitted, this value must match the scope in the authorization request. |
Example responses
200 Response
{
"access_token": "string",
"token_type": "string",
"id_token": "string",
"expires_in": 0,
"scope": "string",
"jti": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The request succeeded. | Inline |
| 400 | Bad Request | The request was invalid. | errorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » access_token | string | false | none | The access token to use for subsequent API calls. |
| » token_type | string | false | none | The type of access token issued (for example, 'bearer'). |
| » id_token | string | false | none | The OIDC token that may be used by the client to authenticate the end user. |
| » expires_in | integer | false | none | The number of seconds until the token expires. |
| » scope | string | false | none | The space-limited list of scopes authorized for this client. |
| » jti | string | false | none | The globally unique identifier for this token. |
Schemas
clientIn
{
"client_id": "string",
"authorized_grant_types": [
"string"
],
"redirect_uri": [
"string"
],
"scope": [
"string"
],
"resource_ids": [
"string"
],
"authorities": [
"string"
],
"autoapprove": [
"string"
],
"access_token_validity": 0,
"refresh_token_validity": 0,
"allowedproviders": [
"string"
],
"name": "string",
"token_salt": "string",
"createdwith": "string",
"approvals_deleted": true,
"required_user_groups": [
"string"
],
"client_secret": "string"
}
Client Input
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| client_id | string | true | none | The client identifier that is unique within identity zone. |
| authorized_grant_types | [string] | true | none | The list of grant types that can be used to obtain a token with this client. Types can include authorization_code, password, implicit, and client_credentials. |
| redirect_uri | [string] | true | none | The allowed URI pattern for redirect during authorization or "urn:ietf:wg:oauth:2.0:oob" for out-of-band delivery. |
| scope | [string] | false | none | The scopes allowed for the client to obtain on behalf of users, when using any grant type other than "client_credentials". Groups are treated as scopes. Therefore, the scopes that can be obtained by the client on behalf of a user will be the intersection of the user's groups and the scopes registered to the client via this property. Use the wildcard "" to match all groups. Since SAS Viya allows authorization rules to explicitly deny access to specific groups, SAS recommends always using "". The wildcard "*" will not match internal UAA scopes. This list should always include the scope "openid", which is used to assert the identity of the user that the client is acting on behalf of. For clients that only use the grant type "client_credentials" and therefore do not act on behalf of users, use the default scope "uaa.none". |
| resource_ids | [string] | false | none | The resources that the client is allowed to access. |
| authorities | [string] | false | none | The scopes that the client is able to grant itself when using the "client_credentials" grant type. Wildcards are not allowed. |
| autoapprove | [string] | false | none | The scopes that do not require user approval, or a simple Boolean value to apply to all scopes. |
| access_token_validity | integer | false | none | The time in seconds to access token expiration after it is issued. |
| refresh_token_validity | integer | false | none | The time in seconds to refresh token expiration after it is issued. |
| allowedproviders | [string] | false | none | The list of the origin keys (alias) for identity providers that the client is limited to. Null implies any identity provider is allowed. |
| name | string | false | none | The human-readable name for the client. |
| token_salt | string | false | none | A random string that is used to generate the client's revocation key. Change this value to revoke all active tokens for the client. |
| createdwith | string | false | none | The scope that the bearer token had when the client was created. |
| approvals_deleted | boolean | false | none | An indication whether the approvals were deleted for the client and an audit event was sent. |
| required_user_groups | [string] | false | none | A list of group names. If a user does not belong to all the required groups, the user will not be authenticated and no tokens are issued to this client for that user. If this field is not specified, authentication and token issuance proceeds normally. |
| client_secret | string | false | none | The secret string used for authenticating as this client. To support secret rotation this can be a space-delimited string of two secrets. This is required if the client allows authorization_code or client_credentials grant type. |
client
{
"client_id": "string",
"authorized_grant_types": [
"string"
],
"redirect_uri": [
"string"
],
"scope": [
"string"
],
"resource_ids": [
"string"
],
"authorities": [
"string"
],
"autoapprove": [
"string"
],
"access_token_validity": 0,
"refresh_token_validity": 0,
"allowedproviders": [
"string"
],
"name": "string",
"token_salt": "string",
"createdwith": "string",
"approvals_deleted": true,
"required_user_groups": [
"string"
],
"client_secret": "string",
"lastModified": 0
}
Client
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Client | any | false | none | The OAuth client information that is returned from the server response. |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | clientIn | false | none | The OAuth client information that is passed as input to the POST/PUT calls. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » lastModified | integer | false | none | The epoch (milliseconds) of the moment the client information was last altered. |
clientCollection
{
"startIndex": 0,
"itemsPerPage": 0,
"totalResults": 0,
"items": [
{
"client_id": "string",
"authorized_grant_types": [
"string"
],
"redirect_uri": [
"string"
],
"scope": [
"string"
],
"resource_ids": [
"string"
],
"authorities": [
"string"
],
"autoapprove": [
"string"
],
"access_token_validity": 0,
"refresh_token_validity": 0,
"allowedproviders": [
"string"
],
"name": "string",
"token_salt": "string",
"createdwith": "string",
"approvals_deleted": true,
"required_user_groups": [
"string"
],
"client_secret": "string",
"lastModified": 0
}
]
}
Client Collection
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| startIndex | integer | false | none | none |
| itemsPerPage | integer | false | none | none |
| totalResults | integer | false | none | none |
| items | [client] | false | none | [The OAuth client information that is returned from the server response.] |
clientSecretIn
{
"clientId": "string",
"oldSecret": "string",
"secret": "string",
"changeMode": "string"
}
Client Secret
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| clientId | string | true | none | The client identifier that is unique within identity zone. |
| oldSecret | string | false | none | The valid client secret before updating. This is optional if authenticated as an admin client. Otherwise, it is required. |
| secret | string | true | none | The new client secret. |
| changeMode | string | false | none | (Optional) The default is UPDATE. If change mode is set to ADD, then the new secret is added to the existing one. If the change mode is set to DELETE, then the old secret is deleted to support secret rotation. Only two client secrets are supported at any given time. |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.