Text Analytics (Deprecated)
Sentiment Analysis
Base URLs:
- https://example.com/sentiment
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 Sentiment Analysis API is used to perform sentiment analysis on natural language text documents according to a prebuilt or user-defined model. This API is deprecated and will be removed in a future release.
Usage Notes
Overview
The Sentiment Analysis API allows a client to assign a sentiment score to a document or a collection of documents. Knowing the sentiment of a document allows a client to better understand the overall tone of a document. Currently, this service supports document-level sentiment. For each document, the service returns a sentiment score and a probability for the sentiment score. A sentiment score is a string that contains one of three values: positive, negative, or neutral. The probability score is a number between 0.0 and 1.0 that indicates how positive or negative the score is.
This API provides two different interactions for scoring: scoring CAS tables containing documents and scoring documents that
are uploaded directly into the API. In both cases, the service uses an asynchronous execution model. The client creates an analysis
job that runs in the background after the Create operation returns. The API provides resource endpoints for checking the state of the job.
Then, when complete, the results are retrieved using either the /results
endpoint on the job, or by interacting with the
result table directly by using another SAS service such as the Row Sets API.
One of the values the API takes as input is a language
parameter. For English, the language
parameter must take the form
of en
(ISO-639-1 short code for English).
The language
parameter is used to select the sentiment binary model that scores the documents. The language
binaries are considered to be domain-independent because they are designed to work across different domains.
When scoring a table as input, the API views each row in the input table as a document. Thus, the API requires
two input parameters: documentIdVariable
and textVariable
. The documentIdVariable
is a unique identifier for the document
and the textVariable
is the actual document text. For example, consider a table containing tweets from @SASSoftware:
ID | Date Created | Message |
---|---|---|
850007368138018817 | Thu Apr 06 15:28:43 +0000 2017 | Real-time and #AI are changing marketing: join 9/13 #SASWebinar with special guest from @Forrester |
787452347508998458 | Thu Apr 06 12:54:02 +0000 2017 | US has over 4 million miles of roads that could have 10 million fully or semi autonomous cars by 2020 #IoT |
774598598680208850 | Thu Apr 06 12:28:22 +0000 2017 | Need help with your fight against #fraud? |
In this example, the documentIdVariable
is ID and the textVariable
is Message.
The API supports all models provided by SAS as well as user-defined models. The modelUri input parameter takes a URI to a CAS table containing one or more sentiment models.
Note that all table URI parameters should use the following form of values: "/casManagement/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}". Refer to examples with multiple URI parameters.
Terminology
job
a container for an asynchronous operation. A job supports a number of different operations such as checking state, canceling an operation, fetching results, and so on. All sentiment scoring operations are performed asynchronously.
language
a parameter that specifies which domain-independent sentiment model should be used for processing the input documents. This parameter is required when processing tables or uploaded documents. For English, the language parameter must take the form of "en". See ISO-639-1 short codes.
library
a container for inputs and outputs when you use CAS. Services such as Sentiment use a library to locate input data and store output tables that they create.
model
a parameter that is used to determine sentiment scores. A model is represented in binary format in a CAS table. Currently, the domain-independent sentiment models (based on language) are provided by SAS and developed by SAS linguists.
probability
a value between 0.0 and 1.0 that is directly related to the sentiment score assigned to the document. The sentiment service has a probability threshold default value of 0.5. If the probability is above the threshold, the document is positive. If the probability matches the threshold, the document is neutral. If the probability is below the threshold, the document is negative.
sentiment score
a score given to a document. This parameter contains a string with one of three values: positive, negative, or neutral.
table
the input for and the output from bulk processing. An input table must have both an ID column and a column that contains the text data. Additional columns can be included in an input table. Output tables are generated by the service. An output table contains three columns: id, sentiment, and probability.
Error Codes
HTTP Status Code | Error Code | Description |
---|---|---|
400 | 71205 | The request was invalid. The specified state value is not a valid state. |
400 | 71206 | The request was invalid. The specified state value is not a valid state. Only the state 'canceled' is permitted. |
400 | 71212 | The specified paging parameters (start or limit) are invalid. |
404 | 71200 | The specified job ID was not found. |
404 | 71202 | Results are not available yet because the job has not finished execution. |
404 | 71203 | Results are not available because the job was canceled. |
404 | 71204 | Results are not available because the job failed. More information might be available from the /errors endpoint. |
404 | 71210 | No CAS library exists at the requested path. The specified CAS library is invalid. |
404 | 71211 | The specified URI does not exist as the requested path. |
409 | 71201 | The job must be canceled before it can be deleted. |
409 | 71207 | The request could not be completed due to a conflict with the current state of the job. The job cannot be canceled because it has already completed. |
500 | 71208 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was fetching results. |
500 | 71208 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was storing the specified data. |
Operations
Root
Contains the operations for the Root resource.
Get a list of top-level resource links
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/ \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/sentiment/',
{
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/sentiment/', 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/sentiment/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of top-level resource links in this API.
Example responses
Returns a list of links to the top-level resources in this API.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "POST",
"rel": "startAnalysis",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.text.sentiment.job.request",
"responseType": "application/vnd.sas.text.sentiment.job"
}
]
}
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "POST",
"rel": "startAnalysis",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.text.sentiment.job.request",
"responseType": "application/vnd.sas.text.sentiment.job"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns a list of links to the top-level resources in this API. | 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 | [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. |
Retrieve headers for the API
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Retrieves header information for the API resource. Can also be used to check if the service is available.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. API resource links are available. | None |
Jobs
Contains the operations for creating and managing jobs.
Get a collection of jobs
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/sentiment/jobs',
{
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/sentiment/jobs', 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/sentiment/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs
Returns a list of sentiment analysis jobs that were created by the user.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering the domains. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting the collection. See Sorting in REST APIs. |
Example responses
The request succeeded. The current jobs are returned for the given user.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs?start=0&limit=10",
"uri": "/sentiment/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/",
"uri": "/sentiment/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.sentiment.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs",
"uri": "/sentiment/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs?start=0&limit=10",
"uri": "/sentiment/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/",
"uri": "/sentiment/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.sentiment.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current jobs are returned for the given user. | jobCollection |
Retrieve headers for job collection
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs
Retrieves header information for the collection of jobs. Can also be used to check if the collection exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting the collection. See Sorting in REST APIs. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The collection is available. | None |
Create a job to analyze table of documents
Code samples
# You can also use wget
curl -X POST https://example.com/sentiment/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.sentiment.job.request+json' \
-H 'Accept: application/vnd.sas.text.sentiment.job+json'
const inputBody = '{
"version": 1,
"description": "My table request",
"language": "en",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.sentiment.job.request+json',
'Accept':'application/vnd.sas.text.sentiment.job+json'
};
fetch('https://example.com/sentiment/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.text.sentiment.job.request+json',
'Accept': 'application/vnd.sas.text.sentiment.job+json'
}
r = requests.post('https://example.com/sentiment/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.sentiment.job.request+json"},
"Accept": []string{"application/vnd.sas.text.sentiment.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sentiment/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Even though this call returns immediately, the job might not be complete because the sentiment analysis task is running asynchronously. Other resources are provided to access more information about this job. The state link can be used to check the state of a job. When the state of the job is completed
, it is done. The results link is available to fetch its results only when the state of the job is completed
. If the state becomes 'error', the error link is available to get more information describing what went wrong. At any time, the log link can be used to fetch the plain text log of this job.
Body parameter
{
"version": 1,
"description": "My table request",
"language": "en",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | jobRequest | false | Indicates the analysis to create. |
Example responses
The request has been accepted for processing, but the processing has not been completed.
{
"version": 1,
"id": "<jobId>",
"state": "completed",
"language": "en",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "reviewbody",
"creationTimeStamp": "2017-09-08T20:15:13.273Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"id": "<jobId>",
"state": "completed",
"language": "en",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "reviewbody",
"creationTimeStamp": "2017-09-08T20:15:13.273Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: c5f136ac515c66f1",
"path: /sentiment/jobs/"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
No project or table exists at the requested path.
{
"errorCode": 71211,
"message": "Invalid inputUri supplied: \"/\".",
"details": [
"traceId: 22b49df4e7a58999",
"path: /sentiment/jobs/"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for processing, but the processing has not been completed. | job |
400 | Bad Request | The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid. | Inline |
404 | Not Found | No project or table exists at the requested path. | Inline |
409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. A job with the specified ID already exists. | None |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Create a job to analyze document
Code samples
# You can also use wget
curl -X POST https://example.com/sentiment/jobs#data \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.sentiment.job.request.documents+json' \
-H 'Accept: application/vnd.sas.text.sentiment.job+json'
const inputBody = '{
"version": 1,
"description": "My inline document request",
"language": "en",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to analyze.",
"This additional document to analyze"
]
}';
const headers = {
'Content-Type':'application/vnd.sas.text.sentiment.job.request.documents+json',
'Accept':'application/vnd.sas.text.sentiment.job+json'
};
fetch('https://example.com/sentiment/jobs#data',
{
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.text.sentiment.job.request.documents+json',
'Accept': 'application/vnd.sas.text.sentiment.job+json'
}
r = requests.post('https://example.com/sentiment/jobs#data', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.sentiment.job.request.documents+json"},
"Accept": []string{"application/vnd.sas.text.sentiment.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/sentiment/jobs#data", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs#data
Even though this call returns immediately, the job might not be complete because the sentiment analysis task is running asynchronously. Other resources can be used to check the state of an analysis and to fetch its results when complete.
Body parameter
{
"version": 1,
"description": "My inline document request",
"language": "en",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to analyze.",
"This additional document to analyze"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | jobRequestFromDocuments | false | Indicates the job to be created. |
Example responses
The request has been accepted for processing, but the processing has not been completed. The job was created and will run in the background.
{
"version": 1,
"id": "<jobId>",
"description": "My inline document request",
"state": "pending",
"language": "en",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"creationTimeStamp": "2022-03-14T19:37:44.192Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<uuid>/log",
"uri": "/sentiment/jobs/<uuid>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/sentiment/jobs/<uuid>/state?value=canceled",
"uri": "/sentiment/jobs/<uuid>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"id": "<jobId>",
"description": "My inline document request",
"state": "pending",
"language": "en",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"creationTimeStamp": "2022-03-14T19:37:44.192Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<uuid>/log",
"uri": "/sentiment/jobs/<uuid>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/sentiment/jobs/<uuid>/state?value=canceled",
"uri": "/sentiment/jobs/<uuid>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: c724093730a01c11",
"path: /sentiment/jobs/"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: c724093730a01c11",
"path: /sentiment/jobs/"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
No project or table exists at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: <traceId>",
"path: /sentiment/jobs/<jobId>"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: <traceId>",
"path: /sentiment/jobs/<jobId>"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
409 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
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for processing, but the processing has not been completed. The job was created and will run in the background. | job |
400 | Bad Request | The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid. | Inline |
404 | Not Found | No project or table exists at the requested path. | Inline |
409 | Conflict | A job with the specified ID already exists. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 409
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get a specific job
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.text.sentiment.job+json'
const headers = {
'Accept':'application/vnd.sas.text.sentiment.job+json'
};
fetch('https://example.com/sentiment/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.text.sentiment.job+json'
}
r = requests.get('https://example.com/sentiment/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.text.sentiment.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/sentiment/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Returns information about a specific bulk analysis.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Example responses
The request succeeded. Information about the job is returned.
{
"version": 1,
"id": "<jobId>",
"description": "My inline document request",
"state": "completed",
"language": "en",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"creationTimeStamp": "2022-03-14T19:37:44.192Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"id": "<jobId>",
"description": "My inline document request",
"state": "completed",
"language": "en",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"creationTimeStamp": "2022-03-14T19:37:44.192Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/<jobId>",
"uri": "/sentiment/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/<jobId>/state",
"uri": "/sentiment/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: a0cc835dba7ff07d",
"path: /sentiment/jobs/<jobId>"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: a0cc835dba7ff07d",
"path: /sentiment/jobs/<jobId>"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Information about the job is returned. | job |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Retrieve headers for a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs/{jobId}
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs/{jobId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}
Retrieves header information for a job. Can also be used to check if the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job header information is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Delete bulk analysis job from server
Code samples
# You can also use wget
curl -X DELETE https://example.com/sentiment/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/sentiment/jobs/{jobId}',
{
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/sentiment/jobs/{jobId}', 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/sentiment/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Enables a client to delete a bulk analysis. Jobs that have completed are not deleted automatically. A client needs to delete them when they no longer need access to the results. If a job is still running when it is deleted, it is canceled before the delete is processed.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Example responses
The specified job ID was not found.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The job was successfully deleted. | None |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the state of an existing job
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId}/state \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/sentiment/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/sentiment/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/sentiment/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Enables a client to check the state of a bulk analysis. This can be used to poll a running job in order to know when it is complete. Valid values are: pending, running, completed, canceled, and failed.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Example responses
The request succeeded. The current job state is available.
"completed"
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: d674d35397271a1a","path: /sentiment/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | taskState |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Retrieve headers for the state of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs/{jobId}/state
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs/{jobId}/state',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs/{jobId}/state')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/state
Retrieve header information for the state of an existing job. Can also be used to check if the job state exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Cancel a running job
Code samples
# You can also use wget
curl -X PUT https://example.com/sentiment/jobs/{jobId}/state?value=canceled \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/sentiment/jobs/{jobId}/state?value=canceled',
{
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/sentiment/jobs/{jobId}/state', params={
'value': 'canceled'
}, 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/sentiment/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /jobs/{jobId}/state
Enables a caller to cancel a running bulk analysis. This operation is available via the cancel link on the job only if the job can be canceled. A job is available to be canceled if it has not yet finished processing.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
value | query | string | true | Used to cancel a running job. |
Enumerated Values
Parameter | Value |
---|---|
value | canceled |
Example responses
The request succeeded. The state was successfully updated. The response contains the updated state.
"completed"
The request was invalid. The specified state value is not a valid state.
{"errorCode":71206,"message":"Only the state value of \"canceled\" is supported.","details":["traceId: 8091a8898cf6374c","path: /sentiment/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":400}
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: 4067c9b60e963803","path: /sentiment/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":404}
The request could not be completed. The job is not running. It could have already completed, canceled, or resulted in an error.
{"errorCode":71207,"message":"The job has completed, thus it can't be canceled.","details":["traceId: 7235e9f32b9af97d","path: /sentiment/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":409}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The state was successfully updated. The response contains the updated state. | taskState |
400 | Bad Request | The request was invalid. The specified state value is not a valid state. | Inline |
404 | Not Found | The specified job ID was not found. | Inline |
409 | Conflict | The request could not be completed. The job is not running. It could have already completed, canceled, or resulted in an error. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 409
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the result of a specified job
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId}/results \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/sentiment/jobs/{jobId}/results',
{
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/sentiment/jobs/{jobId}/results', 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/sentiment/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results
Allows a client to retrieve the results for a completed bulk analysis. This operation is available only when the job has a state value of completed. Instead of invoking this endpoint directly, users are recommended to wait for the results link to be available on the job. This link appears only when the results are available.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
start | query | integer | false | Indicates the start index for pagination. |
limit | query | integer | false | Indicates the limit parameter for pagination. |
Example responses
The request succeeded. The result of the job is available.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job.result"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>/results?start=0&limit=10",
"uri": "/sentiment/jobs/<jobId>/results?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job.result"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/jobs/<jobId>/",
"uri": "/sentiment/jobs/<jobId>/",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "documentSentimentTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_SENTIMENT_OUT_<jobId>",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_SENTIMENT_OUT_<jobId>",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.sentiment.job.result",
"start": 0,
"count": 2,
"items": [
{
"version": 1,
"id": "1",
"sentiment": "neutral",
"probability": 0.5,
"links": []
},
{
"version": 1,
"id": "2",
"sentiment": "neutral",
"probability": 0.5,
"links": []
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs/<jobId>/results",
"uri": "/sentiment/jobs/<jobId>/results",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job.result"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>/results?start=0&limit=10",
"uri": "/sentiment/jobs/<jobId>/results?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.sentiment.job.result"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/jobs/<jobId>/",
"uri": "/sentiment/jobs/<jobId>/",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "GET",
"rel": "documentSentimentTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_SENTIMENT_OUT_<jobId>",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_SENTIMENT_OUT_<jobId>",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.sentiment.job.result",
"start": 0,
"count": 2,
"items": [
{
"version": 1,
"id": "1",
"sentiment": "neutral",
"probability": 0.5,
"links": []
},
{
"version": 1,
"id": "2",
"sentiment": "neutral",
"probability": 0.5,
"links": []
}
],
"limit": 10,
"version": 2
}
The specified job ID was not found. It is also possible that the job is still running and the results are not yet available or the job was canceled.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: fc09d0c0ae0b8466",
"path: /sentiment/jobs/<jobId>/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: fc09d0c0ae0b8466",
"path: /sentiment/jobs/<jobId>/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The result of the job is available. | jobResult |
404 | Not Found | The specified job ID was not found. It is also possible that |
the job is still running and the results are not yet available or the job was canceled.|Inline|
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Retrieve headers for result of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs/{jobId}/results
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs/{jobId}/results',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs/{jobId}/results')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results
Retrieves header information for the result of a specific job. Can also be used to check if the job results exist.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
start | query | integer | false | Indicates the start index for pagination. |
limit | query | integer | false | Indicates the limit parameter for pagination. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The result of the job is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Get the log for a job as plain text
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId}/log \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/sentiment/jobs/{jobId}/log',
{
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/sentiment/jobs/{jobId}/log', 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/sentiment/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log
Enables a client to view the log for a bulk analysis. The log might be helpful in diagnosing problems with the job. This resource can be called regardless of whether the job is running.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Example responses
The request succeeded. The log for the job is available.
"\"2022-03-14T15:37:44.279 INFO s.t.s.t.AnalysisTask - [JOB_STARTING_EXECUTION] Starting job execution.\n2022-03-14T15:37:44.282 INFO s.t.s.t.AnalysisTask - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570\n2022-03-14T15:37:44.282 INFO s.t.s.t.AnalysisTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-14T15:37:44.592 INFO s.t.s.t.AnalysisTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-14T15:37:44.592 INFO s.t.s.t.AnalysisTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-14T15:37:44.595 INFO s.t.s.t.AnalysisTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-14T15:37:44.596 INFO s.t.s.t.AnalysisTask - [CAS_LOADING_ACTION_SET] Loading the \"sentimentAnalysis\" action set.\n2022-03-14T15:37:44.601 INFO s.t.s.t.AnalysisTask - NOTE: Added action set 'sentimentAnalysis'.\n2022-03-14T15:37:44.604 INFO s.t.s.t.AnalysisTask - [CAS_ACTION_SET_LOADED] The \"sentimentAnalysis\" action set was loaded.\n2022-03-14T15:37:44.605 INFO s.t.s.t.AnalysisTask - [CAS_CALLING_ACTION] Calling the \"applySent\" action.\n2022-03-14T15:37:44.605 INFO s.t.s.t.AnalysisTask - [CAS_LUA_STRING] LUA string: s:sentimentAnalysis_applySent{casOut={caslib=\"public\",name=\"<tableId>_SENTIMENT_OUT_<jobId>\",promote=true},docId=\"id\",language=\"english\",table={caslib=\"public\",name=\"<tableId>\"},text=\"text\"}\n2022-03-14T15:37:45.395 INFO s.t.s.t.AnalysisTask - [CAS_ACTION_COMPLETE] The \"applySent\" action is complete.\n2022-03-14T15:37:45.396 INFO s.t.s.t.AnalysisTask - [JOB_COMPLETED] Job completed. (00:00:01)\"\n"
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: 372704ed62b6e4f1","path: /sentiment/jobs/<jobId>/log"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log for the job is available. | string |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Retrieve headers for the job log
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs/{jobId}/log
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs/{jobId}/log',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs/{jobId}/log')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/log
Retrieves header information for the log for this job. Can also be used to check if the log exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Get the log for a job as log lines
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId}/log#collection \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/sentiment/jobs/{jobId}/log#collection',
{
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/sentiment/jobs/{jobId}/log#collection', 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/sentiment/jobs/{jobId}/log#collection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log#collection
Returns the log from this job formatted as a collection of application/vnd.sas.compute.log.line
objects.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
start | query | integer | false | Indicates the start index for pagination. |
limit | query | integer | false | Indicates the limit parameter for pagination. |
Example responses
This job's log.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>/log?start=0&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/jobs/<jobId>/",
"uri": "/sentiment/jobs/<jobId>/",
"type": "application/vnd.sas.text.sentiment.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 13,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.279 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.282 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.282 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.592 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.592 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.595 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.596 - [CAS_LOADING_ACTION_SET] Loading the \"sentimentAnalysis\" action set.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.601 - NOTE: Added action set 'sentimentAnalysis'.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.604 - [CAS_ACTION_SET_LOADED] The \"sentimentAnalysis\" action set was loaded.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.605 - [CAS_CALLING_ACTION] Calling the \"applySent\" action.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/sentiment/jobs/<jobId>/log",
"uri": "/sentiment/jobs/<jobId>/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/<jobId>/log?start=0&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"uri": "/sentiment/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/sentiment/jobs/<jobId>/",
"uri": "/sentiment/jobs/<jobId>/",
"type": "application/vnd.sas.text.sentiment.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 13,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.279 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.282 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.282 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.592 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.592 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.595 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.596 - [CAS_LOADING_ACTION_SET] Loading the \"sentimentAnalysis\" action set.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.601 - NOTE: Added action set 'sentimentAnalysis'.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.604 - [CAS_ACTION_SET_LOADED] The \"sentimentAnalysis\" action set was loaded.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-14T15:37:44.605 - [CAS_CALLING_ACTION] Calling the \"applySent\" action.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 372704ed62b6e4f1",
"path: /sentiment/jobs/<jobId>/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 372704ed62b6e4f1",
"path: /sentiment/jobs/<jobId>/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | This job's log. | logLineCollection |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get errors for a failed job
Code samples
# You can also use wget
curl -X GET https://example.com/sentiment/jobs/{jobId}/errors \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.error+json'
const headers = {
'Accept':'application/vnd.sas.error+json'
};
fetch('https://example.com/sentiment/jobs/{jobId}/errors',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.error+json'
}
r = requests.get('https://example.com/sentiment/jobs/{jobId}/errors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.error+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/sentiment/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/errors
Returns any errors that were raised as a result of a job. Note that the response might contain multiple errors via the nested errors
array member. This endpoint is available only when the job state is failed
. It is best accessed through the errors
link from the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Example responses
200 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
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 988dd55e5efeb02a",
"path: /sentiment/jobs/<jobId>/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 988dd55e5efeb02a",
"path: /sentiment/jobs/<jobId>/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The errors for the job are available. | Inline |
204 | No Content | The ID was found and there are no errors for this job. | None |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 200
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.error%2Bjson%3Bversion%3D2/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Retrieve headers for the job errors
Code samples
# You can also use wget
curl -X HEAD https://example.com/sentiment/jobs/{jobId}/errors
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/sentiment/jobs/{jobId}/errors',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/sentiment/jobs/{jobId}/errors')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/sentiment/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/errors
Retrieves header information for the job errors. Can also be used to check if errors exist for the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Errors are available. | None |
404 | Not Found | The specified job ID was not found. | None |
Schemas
baseJobRequest
{
"description": "string",
"language": "ar",
"modelUri": "string",
"outputTableNamePostfix": "string"
}
Common Job Request Properties
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | Indicates an optional string that can be used to describe in a human-readable format what this job represents. Its purpose is purely informative and it is not used for the analysis. |
language | string | true | none | Indicates a two-letter ISO 639-1 language that should be used to select the domain-independent sentiment model. |
modelUri | string | false | none | Indicates the URI to a CAS table that contains one or more sentiment model binaries. If left blank, the default model for the specified language is used. |
outputTableNamePostfix | string | false | none | Indicates text to add to the end of the output table names. If left blank, the server generates text. |
Enumerated Values
Property | Value |
---|---|
language | ar |
language | de |
language | en |
language | es |
language | fa |
language | fr |
language | it |
language | ja |
language | ko |
language | nl |
language | pt |
language | tr |
language | zh |
language | zh_cn |
language | zh_tw |
jobRequest
{
"description": "string",
"language": "ar",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0
}
Job Request for a Table
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for a Table | any | false | none | Indicates a bulk sentiment analysis request on a collection of documents. This is the application/vnd.sas.text.sentiment.job.request media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» inputUri | string | true | none | Indicates the URI containing the reference to the table containing the input documents. |
» documentIdVariable | string | true | none | Indicates the name of the column in the input table that contains the unique document ID. |
» textVariable | string | true | none | Indicates the name of the column in the input table that contains the actual document text. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
jobRequestFromDocuments
{
"description": "string",
"language": "ar",
"modelUri": "string",
"outputTableNamePostfix": "string",
"caslibUri": "string",
"documents": [
"string"
],
"version": 0
}
Job Request for Documents in the Request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for Documents in the Request | any | false | none | Indicates a request to create a sentiment analysis job from inline documents. This is the application/vnd.sas.text.sentiment.job.request.documents media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» caslibUri | string | true | none | Indicates the URI pointing to a caslib in which data will be stored. |
» documents | [string] | true | none | Indicates the text documents to categorize. These documents are identified in the order in which they are specified to the API, starting from 1 and proceeding sequentially. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
taskState
"pending"
Job State
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job State | string | false | none | Indicates the state of the job. |
Enumerated Values
Property | Value |
---|---|
Job State | pending |
Job State | running |
Job State | completed |
Job State | canceled |
Job State | failed |
job
{
"description": "string",
"language": "ar",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
Sentiment Analysis Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Sentiment Analysis Job | any | false | none | Indicates a sentiment analysis job. This is the application/vnd.sas.text.sentiment.job media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobRequest | false | none | Indicates a bulk sentiment analysis request on a collection of documents. This is the application/vnd.sas.text.sentiment.job.request media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id | string | true | none | Indicates the ID that uniquely defines the analysis job. |
» state | taskState | true | none | Indicates the state of the job. |
» creationTimeStamp | string | true | none | Indicates a string containing the datetime value when an analysis was originally created in format yyyy-mm-ddThh:mm:ssZ. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
» links | [object] | true | none | Indicates an array containing zero or more link objects. See the API link relations table for a description of the API links. |
»» 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. |
jobCollection
{
"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": [
{
"description": "string",
"language": "ar",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "string",
"links": [
{
"method": "string",
"rel": "string",
"uri": "string",
"href": "string",
"title": "string",
"type": "string",
"itemType": "string",
"responseType": "string",
"responseItemType": "string"
}
]
}
]
}
Collection of Jobs
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Jobs | any | false | none | This is a collection of jobs. |
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 | [job] | true | none | Indicates an array containing sentiment analysis objects. |
analysis
{
"id": "string",
"sentiment": "positive",
"probability": 0,
"version": 0
}
Sentiment Analysis
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Indicates the identifier that links the input document to its analysis. If a table was supplied, this value corresponds to the documentIdVariable value. If documents were supplied directly to the service, this value corresponds to the order that the documents were supplied. The first document receives an 'id' value of 1, the second 2, and so on. |
sentiment | string | true | none | Indicates the sentiment value determined for this document. |
probability | number(double) | true | none | Indicates a confidence metric measuring the probability that the selected sentiment correctly matches the document. |
version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
Enumerated Values
Property | Value |
---|---|
sentiment | positive |
sentiment | negative |
sentiment | neutral |
jobResult
{
"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",
"sentiment": "positive",
"probability": 0,
"version": 0
}
]
}
Sentiment Analysis Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Sentiment Analysis Result | any | false | none | This is the sentiment analysis result. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobCollection | 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 | [analysis] | false | none | Indicates the collection of results where each entry corresponds to the result for one input document. Results are linked to input documents by the 'id' field. |
logLineCollection
{
"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": 1,
"type": "normal",
"line": "string"
}
]
}
Collection of Log Lines
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Log Lines | any | false | none | Indicates the collection of lines from the log file. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobCollection | 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 | [any] | true | none | none |
»» Log Line | object | false | none | A single line in a log. This is the application/vnd.sas.compute.log.line media type. |
»»» version | integer(int32) | true | none | The version number of the Log Line (logLine) representation. This is version 1. |
»»» type | string | true | none | The line entry classification. |
»»» line | string | true | none | The line of text without the type (classification) prefix marker. |
Enumerated Values
Property | Value |
---|---|
type | normal |
type | highlighted |
type | source |
type | title |
type | byline |
type | footnote |
type | error |
type | warning |
type | note |
type | message |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.text.sentiment.job.request+json
The vnd.sas.text.sentiment.job.request
media type represents a request to start a sentiment analysis job that processes a table
as input.
This is described by jobRequest.
{
"description": "My table request",
"language": "en",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
application/vnd.sas.text.sentiment.job.request.documents+json
The vnd.sas.text.sentiment.job.request.documents
media type represents a request to start a sentiment analysis job that
processes the documents provided in the request payload.
This is described by jobRequestFromDocuments.
{
"description": "My inline document request",
"language": "en",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas/caslibs/lib",
"documents": ["This text to analyze.", "This additional document to analyze"]
}
application/vnd.sas.text.sentiment.job+json
The vnd.sas.text.sentiment.job
media type represents a job created to perform sentiment analysis. That job could have been
started to process a table using the application/vnd.sas.text.sentiment.job.request
media type, or it could be processing
documents that were uploaded directly using the application/vnd.sas.text.sentiment.job.request.documents
media type.
This is described by job.
{
"version": 1,
"id": "37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7",
"state": "completed",
"language": "en",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "reviewbody",
"creationTimeStamp": "2017-09-08T20:15:13.273Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7",
"uri": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7",
"type": "application/vnd.sas.text.sentiment.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7",
"uri": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7"
},
{
"method": "GET",
"rel": "state",
"href": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/state",
"uri": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/log",
"uri": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/results",
"uri": "/sentiment/jobs/37b0db7b-c02e-4fb6-9e7c-c1261f97fdf7/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
application/vnd.sas.text.sentiment.concept.result+json
The vnd.sas.text.sentiment.job.result
media type represents the sentiment score for a document regardless of whether the
document came from a table or was uploaded directly into the job.
This is described by analysis.
{
"version": 1,
"id": "r1",
"sentiment": "positive",
"probability": 0.692307710647583
}
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.error
A detailed description of an error. See application/vnd.sas.error
.
application/vnd.sas.compute.log.line
A single line from a log file. For this service, the log is from the execution of a job. See application/vnd.sas.compute.log.line
.
Resource Relationships
This diagram shows the relationships between the resources in this API.
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
The GET /
response includes the following links.
Relation | Method | Description |
---|---|---|
jobs | GET | Returns the first page of the collection of jobs. URI: /jobs Response type: application/vnd.sas.collection Response item type: application/vnd.sas.text.sentiment.job |
startAnalysis | POST | Submits a new analysis job for execution. URI: /jobs Request type: application/vnd.sas.text.sentiment.job.request or application/vnd.sas.text.sentiment.job.request.documents . Response type: application/vnd.sas.text.sentiment.job |
Jobs
Path: /jobs
This API provides collections of jobs.
Members of the /jobs
collection are job resources, /job/{jobId}
. (See below.)
Links
The GET
operation on this path returns a application/vnd.sas.collection
.
Collection 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. 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. |
up | GET | Returns the parent resource. |
Sorting and Filtering
This collection can be sorted and filtered using the ?sortBy=
and ?filter=
query parameters.
Filtering and sorting use the following members of the Job resource:
id
state
creationTimeStamp
Job
Path: /jobs/{jobId}
A specific job resource.
A job resource has the following link relations in the appication/vnd.sas.text.sentiment.job
representation.
Link Relations
Relation | Method | Description |
---|---|---|
self | GET | Returns the job itself. URI: /jobs/{jobId} Response type: application/vnd.sas.text.sentiment.job |
delete | DELETE | Deletes the job. URI: /jobs/{jobId} |
state | GET | Returns the job state. URI: /jobs/{jobId}/state Response type: text/plain |
cancel | PUT | Cancels the job.1 URI: /jobs/{jobId}/state?value=canceled |
results | GET | Returns the job results.2 URI: /jobs/{jobId}/results Response type: application/vnd.sas.text.sentiment.job.results |
errors | GET | Returns any errors associated with the job.3 URI: /jobs/{jobId}/errors Response type: application/vnd.sas.error |
log | GET | Returns the log associated with the job. URI: /jobs/{jobId}/log Response type: text/plain or application/json |
caslib | GET | Returns the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
1 - Only available when the state of this job is 'pending' or 'running'.
2 - Only available when the state of this job is 'completed'.
3 - Only available when the state of this job is 'failed' or 'canceled'.
Job Results
Path: /jobs/{jobId}/results
The results from a specific sentiment analysis job. This path returns links to the resources that are available as results from this job.
Links
The GET
operation on this path returns a application/vnd.sas.api
representation.
Responses include the following links.
Relation | Method | Description |
---|---|---|
self | GET | Returns links to the current results. |
up | GET | Returns the parent resource. |
caslib | GET | Returns the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
documentSentimentTable | GET | Returns the backing table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
Categorization
Base URLs:
- https://example.com/categorization
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.
Categorizes natural language text documents according to a prebuilt or user-defined model. This API is deprecated and will be removed in a future release.
Usage Notes
Overview
The Categorization API allows a categorization model to be applied to a collection of documents. The categorization model defines the categories, the taxonomic structure in which the categories reside (think of organizing things in folder), and the rules defining how a document is considered a member of a category. A category is a label applied to a document.
This API provides two different interactions for category scoring: scoring CAS tables containing documents and scoring
documents that are uploaded directly into the API. In both cases, the API uses an asynchronous execution model. The client
creates a categorization job that runs in the background after the Create operation returns. The API provides resource endpoints for checking the
state of the job. Then, when complete, the results are retrieved using either the /results
endpoint on the job, or by
interacting with the result table directly by using another SAS API such as the Row Sets API.
When scoring a table as input, the API views each row in the input table as a document. Thus, the API requires
two input parameters: documentIdVariable
and textVariable
. The documentIdVariable
is a unique identifier for the document
and the textVariable
is the actual document text. For example, consider a table containing tweets from @SASSoftware:
ID | Date Created | Message |
---|---|---|
850007368138018817 | Thu Apr 06 15:28:43 +0000 2017 | Real-time and #AI are changing marketing: join 9/13 #SASWebinar with special guest from @Forrester |
787452347508998458 | Thu Apr 06 12:54:02 +0000 2017 | US has over 4 million miles of roads that could have 10 million fully or semi autonomous cars by 2020 #IoT |
774598598680208850 | Thu Apr 06 12:28:22 +0000 2017 | Need help with your fight against #fraud? |
In this example, the documentIdVariable
is ID and the textVariable
is Message.
The API supports the use of all models provided by SAS as well as user-created models. The modelUri
input parameter takes a
URI to a CAS table containing one or more category models.
Note that all table URI parameters should use the following form of values: "/casManagement/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}". Refer to examples with multiple URI parameters.
Terminology
category
a label that is assigned to a document. Multiple categories can be assigned to a single document. A categorization model typically contains multiple categories and the rules for matching those categories.
job
a container for an asynchronous operation. A job supports a number of different operations such as checking state, canceling an operation, fetching results, and so on. All categorization jobs are performed asynchronously.
model
a parameter that is used to determine what categories are assigned to a document. A model is represented in binary format in a CAS table. One CAS table can contain multiple models.
library
a container for inputs and outputs when you use CAS. Services such as Categorization use a library to locate input data and store output tables that they create.
table
the input for and the output from categorization. An input table must have both an ID column
(documentIdVariable
) and a column that contains the text data (textVariable
). Additional columns can be included
in an input table. Output tables are generated by the service.
Error Codes
HTTP Status Code | Error Code | Description |
---|---|---|
400 | 71205 | The request was invalid. The specified state value is not a valid state. |
400 | 71206 | The request was invalid. The specified state value is not a valid state. Only the state 'canceled' is permitted. |
400 | 71212 | The specified paging parameters (start or limit) are invalid. |
404 | 71200 | The specified job ID was not found. |
404 | 71202 | Results are not available yet because the job has not finished execution. |
404 | 71203 | Results are not available because the job was canceled. |
404 | 71204 | Results are not available because the job failed. More information might be available from the /errors endpoint. |
404 | 71210 | No CAS library exists at the requested path. The specified CAS library is invalid. |
404 | 71211 | The specified URI does not exist as the requested path. |
409 | 71201 | The job must be canceled before it can be deleted. |
409 | 71207 | The request could not be completed due to a conflict with the current state of the job. The job cannot be canceled because it has already completed. |
500 | 71208 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was fetching results. |
500 | 71209 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was storing the specified data. |
Operations
Root
Contains the operations for the Root resource.
Get a list of top-level resource links
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/ \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/categorization/',
{
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/categorization/', 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/categorization/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level resources in this API.
Example responses
The request succeeded. A collection of link objects is available.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "POST",
"rel": "startCategorization",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.text.categorization.job.request",
"responseType": "application/vnd.sas.text.categorization.job"
}
]
}
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "POST",
"rel": "startCategorization",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.text.categorization.job.request",
"responseType": "application/vnd.sas.text.categorization.job"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. A collection of link objects is available. | 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 | [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 API availability
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Retrieves header information for the API resource. You can also use the request to check whether the service is available.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. API resource links are available. | None |
Jobs
Contains the operations for the Jobs resource, which is used to create and manage jobs.
Get a collection of jobs
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/categorization/jobs',
{
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/categorization/jobs', 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/categorization/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs
Returns a collection of jobs that the server has processed or is currently processing for the current user. If no such jobs exist, an empty collection is returned.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting the collection. See Sorting in REST APIs. |
Example responses
The request succeeded. The request returns all of the current jobs for the given user.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs?start=0&limit=10",
"uri": "/categorization/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/",
"uri": "/categorization/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.categorization.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs?start=0&limit=10",
"uri": "/categorization/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/",
"uri": "/categorization/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.categorization.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The request returns all of the current jobs for the given user. | categorizationJobs |
Check whether a collection of jobs exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs
Retrieves header information for the collection of jobs. Can also be used to check whether the collection exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting the collection. See Sorting in REST APIs. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The collection is available. | None |
Create job to categorize table of documents
Code samples
# You can also use wget
curl -X POST https://example.com/categorization/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.categorization.job.request+json' \
-H 'Accept: application/vnd.sas.text.categorization.job+json'
const inputBody = '{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.categorization.job.request+json',
'Accept':'application/vnd.sas.text.categorization.job+json'
};
fetch('https://example.com/categorization/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.text.categorization.job.request+json',
'Accept': 'application/vnd.sas.text.categorization.job+json'
}
r = requests.post('https://example.com/categorization/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.categorization.job.request+json"},
"Accept": []string{"application/vnd.sas.text.categorization.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/categorization/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Submits the data to be categorized using the specified model.
Body parameter
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | categorizationJobRequest | true | Indicates the data to perform categorization on. |
Example responses
The request has been accepted for categorization processing, but the processing has not been completed.
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-15T18:03:52.188Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/categorization/jobs/<jobId>/state?value=canceled",
"uri": "/categorization/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-15T18:03:52.188Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/categorization/jobs/<jobId>/state?value=canceled",
"uri": "/categorization/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: bd3eed4b2d69bbfb",
"path: /categorization/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"inputUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: bd3eed4b2d69bbfb",
"path: /categorization/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"inputUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for categorization processing, but the processing has not been completed. | categorizationJob |
400 | Bad Request | The request was invalid. The specified job request payload was not valid. The response contains details about why the payload is not valid. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Create a job to categorize documents
Code samples
# You can also use wget
curl -X POST https://example.com/categorization/jobs#data \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.categorization.job.request.documents+json' \
-H 'Accept: application/vnd.sas.text.categorization.job+json'
const inputBody = '{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"documents": [
"This text to categorize.",
"This additional document to categorize"
]
}';
const headers = {
'Content-Type':'application/vnd.sas.text.categorization.job.request.documents+json',
'Accept':'application/vnd.sas.text.categorization.job+json'
};
fetch('https://example.com/categorization/jobs#data',
{
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.text.categorization.job.request.documents+json',
'Accept': 'application/vnd.sas.text.categorization.job+json'
}
r = requests.post('https://example.com/categorization/jobs#data', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.categorization.job.request.documents+json"},
"Accept": []string{"application/vnd.sas.text.categorization.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/categorization/jobs#data", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs#data
Submits the inline data to be categorized using the specified model.
Body parameter
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"documents": [
"This text to categorize.",
"This additional document to categorize"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | categorizationJobRequestDocuments | true | Indicates the data to perform categorization on. |
Example responses
The request has been accepted for categorization processing, but the processing has not been completed.
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-15T18:24:38.868Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/categorization/jobs/<jobId>/state?value=canceled",
"uri": "/categorization/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/Public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-15T18:24:38.868Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/categorization/jobs/<jobId>/state?value=canceled",
"uri": "/categorization/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/Public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The supplied job request payload was not valid. The response contains details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: 54a11413728f310c",
"path: /categorization/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"modelUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: 54a11413728f310c",
"path: /categorization/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"modelUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for categorization processing, but the processing has not been completed. | categorizationJob |
400 | Bad Request | The request was invalid. The supplied job request payload was not valid. The response contains details about why the payload is not valid. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get job information for a specific job
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.text.categorization.job+json'
const headers = {
'Accept':'application/vnd.sas.text.categorization.job+json'
};
fetch('https://example.com/categorization/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.text.categorization.job+json'
}
r = requests.get('https://example.com/categorization/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.text.categorization.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/categorization/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Returns the current information about a job that was submitted to the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Example responses
The request succeeded. Information about the job is returned.
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "failed",
"creationTimeStamp": "2022-03-15T18:24:38.868Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/categorization/jobs/<jobId>/errors",
"uri": "/categorization/jobs/<jobId>/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/Public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/Public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "failed",
"creationTimeStamp": "2022-03-15T18:24:38.868Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/<jobId>",
"uri": "/categorization/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/<jobId>/state",
"uri": "/categorization/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/<jobId>/log",
"uri": "/categorization/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/categorization/jobs/<jobId>/errors",
"uri": "/categorization/jobs/<jobId>/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/Public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/Public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"d5eabfad-bd63-489d-81a9-89c94be10ffg\" could not be found.",
"details": [
"traceId: 970709df0908a365",
"path: /categorization/jobs/d5eabfad-bd63-489d-81a9-89c94be10ffg"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"d5eabfad-bd63-489d-81a9-89c94be10ffg\" could not be found.",
"details": [
"traceId: 970709df0908a365",
"path: /categorization/jobs/d5eabfad-bd63-489d-81a9-89c94be10ffg"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Information about the job is returned. | categorizationJob |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs/{jobId}
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs/{jobId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}
Retrieves header information for a specific job. You can also use this request to check whether the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Information about the job header is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Delete the specified job from the server
Code samples
# You can also use wget
curl -X DELETE https://example.com/categorization/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/categorization/jobs/{jobId}',
{
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/categorization/jobs/{jobId}', 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/categorization/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Deletes the job specified by jobId. If the job has not yet completed, the operation is canceled. The job data is then cleared from the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Example responses
The specified job ID was not found.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The job data was deleted. | None |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the state of a job
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId}/state \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/categorization/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/categorization/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/categorization/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Gets the state of an existing job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Example responses
The request succeeded. The current job state is available.
"completed"
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"116a5829-ab5d-4a07-807e-ac4e04cc5d5c\" could not be found.","details":["traceId: 190726bedac415cb","path: /categorization/jobs/116a5829-ab5d-4a07-807e-ac4e04cc5d5c/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | taskState |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the state of a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs/{jobId}/state
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs/{jobId}/state',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs/{jobId}/state')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/state
Retrieves header information for the state of an existing job. You can also use this request to check whether the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Modify the state of an existing job
Code samples
# You can also use wget
curl -X PUT https://example.com/categorization/jobs/{jobId}/state?value=canceled \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/categorization/jobs/{jobId}/state?value=canceled',
{
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/categorization/jobs/{jobId}/state', params={
'value': 'canceled'
}, 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/categorization/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /jobs/{jobId}/state
Updates the state of an existing job to a specific value. Currently this endpoint can be used only to cancel a running job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
value | query | string | true | Indicates the value to change the state of this job to. |
Enumerated Values
Parameter | Value |
---|---|
value | canceled |
Example responses
The request succeeded. The state was successfully updated. The response contains the updated state.
"canceled"
The request was invalid. The specified state value is not a valid state.
{"errorCode":71205,"message":"Invalid state value \"cancele\" specified.","details":["traceId: a8b1587b98486fcf","path: /categorization/jobs/39e07dbf-7df5-4b5e-9617-7dcf03e4a376/state"],"links":[],"version":2,"httpStatusCode":400}
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"39e07dbf-7df5-4b5e-9617-7dcf03e4a376\" could not be found.","details":["traceId: 6132281d1c633573","path: /categorization/jobs/39e07dbf-7df5-4b5e-9617-7dcf03e4a376/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The state was successfully updated. The response contains the updated state. | taskState |
400 | Bad Request | The request was invalid. The specified state value is not a valid state. | Inline |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the results of a job
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId}/results \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/categorization/jobs/{jobId}/results',
{
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/categorization/jobs/{jobId}/results', 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/categorization/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results
Retrieves the results of a job. Note that this endpoint is available only when the categorization job's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the categorization job for which a request is fetching results. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
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",
"categories": [
{
"name": "string",
"relevancy": 0,
"terms": [
{
"value": "string",
"startOffset": 0,
"endOffset": 0
}
]
}
],
"version": 0
}
]
}
No results were found for the specified job ID. For more information, see the /jobs/{jobId} endpoint.
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: 0b655c298ec5b8b1",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: 0b655c298ec5b8b1",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The result of the job is available. | categorizationJobResults |
404 | Not Found | No results were found for the specified job ID. For more information, see the /jobs/{jobId} endpoint. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the results of a job exist
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs/{jobId}/results
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs/{jobId}/results',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs/{jobId}/results')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results
Retrieves header information for the result of a specific job. You can also use this request to check whether the results exist. Note that this endpoint is available only when the categorization's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the categorization request for which a request is fetching results. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The result of the job is available. | None |
404 | Not Found | The result is not available. If available, find more information through the /jobs/{jobId} endpoint. | None |
Get job errors
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId}/errors \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.error+json'
const headers = {
'Accept':'application/vnd.sas.error+json'
};
fetch('https://example.com/categorization/jobs/{jobId}/errors',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.error+json'
}
r = requests.get('https://example.com/categorization/jobs/{jobId}/errors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.error+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/categorization/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/errors
Returns any errors that were generated as a result of a job. Note that the response might contain multiple errors via the nested errors
array member. This endpoint is available only when the job state is failed
. It is best accessed through the errors
link from the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Example responses
The request succeeded. The errors for the job are available.
{
"errorCode": 2720333,
"message": "com.sas.cas.CASException: The action was not successful. (severity=2 reason=6 statusCode=2720333)\n5 ERROR: The caslib 'lib' does not exist.\n5 ERROR: Table 'example' could not be loaded.\n5 ERROR: Failure opening table 'example'\n5 ERROR: The action stopped due to errors.\ndebug=0x88bfc14d:TKCASA_PRM_BAD_CASLIB",
"details": [
"ERROR: The caslib 'lib' does not exist.",
"ERROR: Table 'example' could not be loaded.",
"ERROR: Failure opening table 'example'",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867",
"type": "application/vnd.sas.text.categorization.job"
}
],
"version": 2,
"httpStatusCode": 0
}
{
"errorCode": 2720333,
"message": "com.sas.cas.CASException: The action was not successful. (severity=2 reason=6 statusCode=2720333)\n5 ERROR: The caslib 'lib' does not exist.\n5 ERROR: Table 'example' could not be loaded.\n5 ERROR: Failure opening table 'example'\n5 ERROR: The action stopped due to errors.\ndebug=0x88bfc14d:TKCASA_PRM_BAD_CASLIB",
"details": [
"ERROR: The caslib 'lib' does not exist.",
"ERROR: Table 'example' could not be loaded.",
"ERROR: Failure opening table 'example'",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867",
"type": "application/vnd.sas.text.categorization.job"
}
],
"version": 2,
"httpStatusCode": 0
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"06b10cfd-57e1-482f-b550-67309d4a4868\" could not be found.",
"details": [
"traceId: 8d9598b5f78d0af5",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4868/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"06b10cfd-57e1-482f-b550-67309d4a4868\" could not be found.",
"details": [
"traceId: 8d9598b5f78d0af5",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4868/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The errors for the job are available. | Inline |
204 | No Content | The ID was found and there are no errors for this job. | None |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 200
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether errors exist for a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs/{jobId}/errors
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs/{jobId}/errors',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs/{jobId}/errors')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/errors
Retrieves header information for the job's errors. This request can also be used to check whether errors exist.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Errors are available. | None |
404 | Not Found | The specified job ID was not found. | None |
Get the log for a job as plain text
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId}/log \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/categorization/jobs/{jobId}/log',
{
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/categorization/jobs/{jobId}/log', 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/categorization/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log
Gets the raw log for this job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Example responses
The request succeeded. The log for the job is available.
"\"2022-03-15T14:46:48.860 INFO t.CategorizationTask - [JOB_STARTING_EXECUTION] Starting job execution.\n2022-03-15T14:46:48.864 INFO t.CategorizationTask - [CAS_RUNNING_ON_SERVER] Running on CAS server <serverName>:5,570\n2022-03-15T14:46:48.865 INFO t.CategorizationTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-15T14:46:49.154 INFO t.CategorizationTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-15T14:46:49.154 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-15T14:46:49.157 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-15T14:46:49.157 INFO t.CategorizationTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-15T14:46:49.159 INFO t.CategorizationTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-15T14:46:49.159 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-15T14:46:49.162 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-15T14:46:49.162 INFO t.CategorizationTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-15T14:46:49.164 INFO t.CategorizationTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-15T14:46:49.164 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-15T14:46:49.166 INFO t.CategorizationTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-15T14:46:49.166 INFO t.CategorizationTask - [CAS_LOADING_ACTION_SET] Loading the \"textRuleScore\" action set.\n2022-03-15T14:46:49.172 INFO t.CategorizationTask - NOTE: Added action set \\'textRuleScore\\'.\n2022-03-15T14:46:49.173 INFO t.CategorizationTask - [CAS_ACTION_SET_LOADED] The \\\"textRuleScore\\\" action set was loaded.\n2022-03-15T14:46:49.173 INFO t.CategorizationTask - [CAS_CALLING_ACTION] Calling the \\\"applyCategory\\\" action.\n2022-03-15T14:46:49.173 INFO t.CategorizationTask - [CAS_LUA_STRING] LUA string: s:textRuleScore_applyCategory{casOut={caslib=\\\"Public\\\",name=\\\"<tableId>_CATEGORIZATION_CATEGORY_OUT_-TMP\\\",promote=true},docId=\\\"id\\\",matchOut={caslib=\\\"Public\\\",name=\\\"<tableId>_CATEGORIZATION_OFFSET_OUT_-TMP\\\",promote=true},model={caslib=\\\"lib\\\",name=\\\"example\\\"},modelOut={caslib=\\\"Public\\\",name=\\\"<tableId>_CATEGORIZATION_DOCUMENT_OUT_-TMP\\\",promote=true},table={caslib=\\\"Public\\\",name=\\\"<tableId>\\\"},text=\\\"text\\\"}\n2022-03-15T14:46:49.179 ERROR t.CategorizationTask - ERROR: The caslib \\'lib\\' does not exist.\n2022-03-15T14:46:49.179 ERROR t.CategorizationTask - ERROR: Table \\'example\\' could not be loaded.\n2022-03-15T14:46:49.179 ERROR t.CategorizationTask - ERROR: Failure opening table \\'example\\'\n2022-03-15T14:46:49.179 ERROR t.CategorizationTask - ERROR: The action stopped due to errors.\"\n"
The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"06b10cfd-57e1-482f-b550-67309d4a4868\" could not be found.","details":["traceId: 874fcf0318936b2b","path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4868/log"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log for the job is available. | string |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the log for a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/categorization/jobs/{jobId}/log
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/categorization/jobs/{jobId}/log',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/categorization/jobs/{jobId}/log')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/categorization/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/log
Retrieves header information for the log for this job. This request can also be used to check whether the log exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID for the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available. | None |
404 | Not Found | The specified job ID was not found. | None |
Get the log for a job as log lines
Code samples
# You can also use wget
curl -X GET https://example.com/categorization/jobs/{jobId}/log#collection \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/categorization/jobs/{jobId}/log#collection',
{
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/categorization/jobs/{jobId}/log#collection', 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/categorization/jobs/{jobId}/log#collection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log#collection
Returns the log from this job formatted as a collection of application/vnd.sas.compute.log.line
objects.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
Example responses
The request succeeded. The log is available for the job.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=0&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=10&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=20&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=20&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/",
"type": "application/vnd.sas.text.categorization.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 23,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.860 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.864 - [CAS_RUNNING_ON_SERVER] Running on CAS server <serverName>:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.865 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.154 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.154 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.157 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.157 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.159 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.159 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.162 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=0&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=10&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=20&limit=10",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/log?start=20&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/",
"uri": "/categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4867/",
"type": "application/vnd.sas.text.categorization.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 23,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.860 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.864 - [CAS_RUNNING_ON_SERVER] Running on CAS server <serverName>:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:48.865 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.154 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.154 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.157 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.157 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.159 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.159 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-15T14:46:49.162 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"06b10cfd-57e1-482f-b550-67309d4a4866\" could not be found.",
"details": [
"traceId: d472f38869cf4a03",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4866/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"06b10cfd-57e1-482f-b550-67309d4a4866\" could not be found.",
"details": [
"traceId: d472f38869cf4a03",
"path: /categorization/jobs/06b10cfd-57e1-482f-b550-67309d4a4866/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available for the job. | logLineCollection |
404 | Not Found | The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.categorization.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Schemas
taskState
"pending"
Job State
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job State | string | false | none | Indicates the state of the job. |
Enumerated Values
Property | Value |
---|---|
Job State | pending |
Job State | running |
Job State | completed |
Job State | canceled |
Job State | failed |
baseCategorizationJobRequest
{
"description": "string",
"modelUri": "string",
"outputTableNamePostfix": "string"
}
Common Job Request Properties
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | Indicates a brief description with details about a categorization job. |
modelUri | string | true | none | Indicates a URI to a CAS table that contains one or more category model binaries. |
outputTableNamePostfix | string | false | none | Indicates text to add to the end of the output table names. If left blank, the server generates text. |
categorizationJobRequest
{
"description": "string",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0
}
Job Request for a Table
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for a Table | any | false | none | Indicates a request to create a categorization job from a table. This is the application/vnd.sas.text.categorization.job.request media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseCategorizationJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» inputUri | string | true | none | Indicates the URI to the table that contains the documents to categorize. |
» documentIdVariable | string | true | none | Indicates the name of the variable in the table that contains the document ID. |
» textVariable | string | true | none | Indicates the name of the variable in the table that contains the document text. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
categorizationJobRequestDocuments
{
"description": "string",
"modelUri": "string",
"outputTableNamePostfix": "string",
"caslibUri": "string",
"documents": [
"string"
],
"version": 0
}
Job Request for Documents in the Request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for Documents in the Request | any | false | none | Indicates a request to create a categorization job from inline documents. This is the application/vnd.sas.text.categorization.job.request.documents media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseCategorizationJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» caslibUri | string | true | none | Indicates the URI to a caslib in which data is stored. |
» documents | [string] | true | none | Indicates the text documents to categorize. These documents are identified in the order in which they are specified to the API, starting from 1 and proceeding sequentially. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
categorizationJob
{
"description": "string",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
Categorization Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Categorization Job | any | false | none | Indicates a categorization job. This is the application/vnd.sas.text.categorization.job media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | categorizationJobRequest | false | none | Indicates a request to create a categorization job from a table. This is the application/vnd.sas.text.categorization.job.request media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id | string | true | none | Indicates the server-generated ID that uniquely defines a categorization. |
» state | taskState | true | none | Indicates the state of the job. |
» creationTimeStamp | string(date-time) | true | none | Indicates a string that contains the datetime value when a job was created in format yyyy-mm-ddThh:mm:ssZ. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
categorizationJobResults
{
"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",
"categories": [
{
"name": "string",
"relevancy": 0,
"terms": [
{
"value": "string",
"startOffset": 0,
"endOffset": 0
}
]
}
],
"version": 0
}
]
}
Collection of Categorization Job Results
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Categorization Job Results | any | false | none | Indicates the collection of categorization job results for the /results endpoint. |
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 | [object] | false | none | The links that apply to the collection. |
»» 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. |
» 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 | [categorizationJobResult] | true | none | Indicates the collection of results. Each entry corresponds to results for one input document. Results are linked to input documents by the ID field. |
categorizationJobResult
{
"id": "string",
"categories": [
{
"name": "string",
"relevancy": 0,
"terms": [
{
"value": "string",
"startOffset": 0,
"endOffset": 0
}
]
}
],
"version": 0
}
Categorization Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Indicates the document identifier that is associated with this result. |
categories | [category] | true | none | Indicates the categorizations that were identified for this document. |
version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
category
{
"name": "string",
"relevancy": 0,
"terms": [
{
"value": "string",
"startOffset": 0,
"endOffset": 0
}
]
}
Category
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Indicates the name of the category that was found for this document. |
relevancy | number(double) | true | none | Indicates a measurement of how relevant this category is to the original document. |
terms | [term] | true | none | Indicates a list of terms that were identified for this category. |
term
{
"value": "string",
"startOffset": 0,
"endOffset": 0
}
Term
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
value | string | true | none | Indicates the text content of this term. |
startOffset | integer(int32) | true | none | Indicates the index where the term begins relative to the original document. |
endOffset | integer(int32) | true | none | Indicates the index where the term ends relative to the original document. |
categorizationJobs
{
"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": [
{
"description": "string",
"modelUri": "string",
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Collection of Categorizations
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Categorizations | any | false | none | This is a collection of categorizations. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | categorizationJobResults | 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 | [categorizationJob] | false | none | Indicates an array containing categorizations. |
logLineCollection
{
"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": 1,
"type": "normal",
"line": "string"
}
]
}
A Collection of Log Lines
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
A Collection of Log Lines | any | false | none | Indicates a collection of lines from the log file. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | categorizationJobResults | 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 | [any] | true | none | none |
»» Log Line | object | false | none | A single line in a log. This is the application/vnd.sas.compute.log.line media type. |
»»» version | integer(int32) | true | none | The version number of the Log Line (logLine) representation. This is version 1. |
»»» type | string | true | none | The line entry classification. |
»»» line | string | true | none | The line of text without the type (classification) prefix marker. |
Enumerated Values
Property | Value |
---|---|
type | normal |
type | highlighted |
type | source |
type | title |
type | byline |
type | footnote |
type | error |
type | warning |
type | note |
type | message |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.text.categorization.job.request+json
The vnd.sas.text.categorization.job.request
media type represents a request to start a categorization job that processes a table
as input.
This is described by categorizationJobRequest.
{
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
application/vnd.sas.text.categorization.job.request.documents+json
The vnd.sas.text.categorization.job.request.documents
media type represents a request to start a categorization job that
processes the documents provided in the request payload.
This is described by categorizationJobRequestDocuments.
{
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas/caslibs/lib",
"documents": ["This text to categorize.", "This additional document to categorize"]
}
application/vnd.sas.text.categorization.job+json
The vnd.sas.text.categorization.job
media type represents a job created to perform categorization. That job could have been
started to process a CAS table using the application/vnd.sas.text.categorization.job.request
media type, or it could be
processing documents that were uploaded directly using the application/vnd.sas.text.categorization.job.request.documents
media
type.
This is described by categorizationJob.
{
"version": 1,
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/model",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/user-7387a394-7e08-48f7-bcff-db4051c077c3",
"documentIdVariable": "id",
"textVariable": "text",
"id": "873895dc-5ea3-4aac-a136-f582f9d35da3",
"state": "completed",
"creationTimeStamp": "2017-09-08T13:30:53.072Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"uri": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"type": "application/vnd.sas.text.categorization.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"uri": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3"
},
{
"method": "GET",
"rel": "state",
"href": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/state",
"uri": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/log",
"uri": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/results",
"uri": "/categorization/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
application/vnd.sas.text.categorization.job.result+json
The vnd.sas.text.categorization.job.result
media type represents the categorization of a specific document regardless of whether
the document came from an input table or was uploaded directly into the job.
This is described by categorizationJobResult.
{
"version": 1,
"id": "r1000",
"categories": [
{
"name": "Top/04000000 - Economy, Business and Finance",
"relevancy": 2,
"terms": [
{
"value": "xbox",
"startOffset": 9,
"endOffset": 12
},
{
"value": "xbox",
"startOffset": 248,
"endOffset": 251
}
]
},
{
"name": "Top/04000000 - Economy, Business and Finance/04003000 - Computing and Information Technology",
"relevancy": 2,
"terms": [
{
"value": "xbox",
"startOffset": 9,
"endOffset": 12
},
{
"value": "xbox",
"startOffset": 248,
"endOffset": 251
}
]
}
]
}
application/vnd.sas.text.categorization.category+json
The application/vnd.sas.text.categorization.category
media type represents a category for a matched document.
This is described by category.
{
"name": "Top/04000000 - Economy, Business and Finance/04003000 - Computing and Information Technology",
"relevancy": 2,
"terms": [
{
"value": "xbox",
"startOffset": 9,
"endOffset": 12
},
{
"value": "xbox",
"startOffset": 248,
"endOffset": 251
}
]
}
application/vnd.sas.text.categorization.term+json
The application/vnd.sas.text.categorization.term
media type represents a term that contributed to a category match. The
application/vnd.sas.text.categorization.category
media type contains a collection of these.
This is described by term.
{
"value": "xbox",
"startOffset": 9,
"endOffset": 12
}
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.error
A detailed description of an error. See application/vnd.sas.error
.
application/vnd.sas.compute.log.line
A single line from a log file. For this service, the log is created by the execution of a job. See application/vnd.sas.compute.log.line
.
Resource Relationships
This diagram shows the relationships between the resources in this API.
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
The GET /
response includes these links:
Relation | Method | Description |
---|---|---|
jobs | GET | Returns the first page of the collection of jobs. URI: /jobs Response type: application/vnd.sas.collection Response item type: application/vnd.sas.text.categorization.job |
startCategorization | POST | Submits a new categorization job for execution. URI: /jobs Request type: application/vnd.sas.text.categorization.job.request or application/vnd.sas.text.categorization.job.request.documents . Response type: application/vnd.sas.text.categorization.job |
Jobs
Path: /jobs
This API provides collections of jobs.
Members of the /jobs
collection are job resources, /job/{jobId}
. (See below.)
Links
The GET
operation on this path returns a application/vnd.sas.collection
.
This collection response includes these links:
Relation | Method | Description |
---|---|---|
self | GET | Returns the current page from the collection. |
collection | GET | Returns the first page of the collection, without the 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. |
up | GET | Returns the parent resource. |
Sorting and Filtering
This collection can be sorted and filtered using the ?sortBy=
and ?filter=
query parameters.
Filtering and sorting can use these members of the Job resource:
id
state
creationTimeStamp
Job
Path: /jobs/{jobId}
A specific job resource.
A job resource has the following link relations in the appication/vnd.sas.text.categorization.job
representation.
Link Relations
Relation | Method | Description |
---|---|---|
self | GET | Returns the job itself. URI: /jobs/{jobId} Response type: application/vnd.sas.text.categorization.job |
delete | DELETE | Deletes the job. URI: /jobs/{jobId} |
state | GET | Returns the job state. URI: /jobs/{jobId}/state Response type: text/plain |
cancel | PUT | Cancels the job.1 URI: /jobs/{jobId}/state?value=canceled |
results | GET | Returns the job results.2 URI: /jobs/{jobId}/results Response type: application/vnd.sas.text.categorization.job.results |
errors | GET | Returns any errors associated with the job.3 URI: /jobs/{jobId}/errors Response type: application/vnd.sas.error |
log | GET | Returns the log associated with the job. URI: /jobs/{jobId}/log Response type: text/plain or application/json |
caslib | GET | Returns the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
1 - Only available when the state of this job is 'pending' or 'running'.
2 - Only available when the state of this job is 'completed'.
3 - Only available when the state of this job is 'failed' or 'canceled'.
Job Results
Path: /jobs/{jobId}/results
The results from categorization for a specific job.
This path returns a collection of application.vnd.sas.categorization.job.result
objects.
Links
The GET
operation on this path returns a application/vnd.sas.collection
.
This collection response includes these links:
Relation | Method | Description |
---|---|---|
self | GET | Returns the current page from the collection. |
collection | GET | Returns the first page of the collection, without the 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. |
up | GET | Returns the parent resource. |
documentCategorizationTable | GET | Returns the backing table for category results. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
categorizationOffsetTable | GET | Returns the backing table for offset results. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
documentScoreTable | GET | Returns the backing table for document category results. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
caslib | GET | Returns the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
Concepts
Base URLs:
- https://example.com/concepts
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.
Assigns concepts to natural language text documents according to a prebuilt. This API is deprecated and will be removed in a future release. or user-defined model.
Usage Notes
Overview
The Concepts API allows a concept model to be applied to a collection of documents. The concept model defines the concepts, the taxonomic structure in which the concepts reside (think of organizing things in folders), and the rules that define how a region of text is assigned to a specific concept.
The Concepts API provides two different interactions for concepts:
- scoring CAS tables that contain documents
- scoring documents that are uploaded directly into the API.
In both cases, the Concepts API uses an asynchronous execution model.
The client creates a concepts job that runs in the background after the operation returns. The Concepts API provides resource endpoints for checking the state of the job. When the job is complete, the results are retrieved by using either the /results
endpoint on the job, or by
interacting with the result table directly by using another SAS API such as the Row Sets API.
One of the parameter values the Concepts API uses as input is a language
parameter. For English, the language
parameter must take the form of en
(ISO-639-1 short code
for English). The language
parameter is used to select the concept binary model that scores the documents if a custom binary is
not provided. The language binaries are considered to be domain-independent.
The Concepts API also takes an optional matchType
parameter as input. The match type indicates what matches to return.
Possible values for matchType
are all
, best
, and longest
. If the user chooses all
, all of the terms that match any of the Language Interpretation for Textual Information (LITI) concept definitions in the model are returned. With best
, only matches with the highest priority setting are returned.
The longest
match type returns the longest match for the concept definition. The Concept API returns all matches by default.
When scoring a table as input, the Concepts API views each row in the input table as a document. Therefore, the Concepts API requires two input parameters:
documentIdVariable
textVariable
The documentIdVariable
is a unique identifier for the document.
The textVariable
is the actual document text. For example, consider a table containing tweets from @SASSoftware:
ID | Date Created | Message |
---|---|---|
850007368138018817 | Thu Apr 06 15:28:43 +0000 2017 | Real-time and #AI are changing marketing: join 9/13 #SASWebinar with special guest from @Forrester |
787452347508998458 | Thu Apr 06 12:54:02 +0000 2017 | US has over 4 million miles of roads that could have 10 million fully or semi autonomous cars by 2020 #IoT |
774598598680208850 | Thu Apr 06 12:28:22 +0000 2017 | Need help with your fight against #fraud? |
In this example, the documentIdVariable
is ID and the textVariable
is Message.
The Concepts API supports the use of the default models that are associated with each language, as well as user-created models. The modelUri
input parameter contains a URI that links to a CAS table containing one or more concept models.
Note that all table URI parameters should use the following form of values: "/casManagement/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}". Refer to examples with multiple URI parameters.
Terminology
concept
a property, such as a book title, last name, city, gender, and so on. Concepts are created from one or more rules that are defined in language interpretation and text interpretation (LITI) syntax.
fact (predicate)
two or more pieces of related information, often contained within the same sentence. Facts are identified by using either the PREDICATE_RULE or SEQUENCE concept rule.
job
a container for an asynchronous operation. A job supports a number of different operations such as checking a state, canceling an operation, fetching results, and so on. All concept jobs are performed asynchronously.
language
a parameter that specifies which domain-independent concept model to use for processing input documents. This parameter is required when you process tables or uploaded documents. For English, the language parameter must take the form of "en" (see ISO-639-1 short codes).
library
a container for inputs and outputs when using CAS. Services, such as concepts, use a library to locate input data and to store output tables that the concepts create.
model
a parameter that is used to determine what concepts are assigned to a document. A model is represented in binary format in a CAS table. One CAS table can contain multiple models.
table
the input to and output from concept scoring. An input table for concept scoring must have both an ID column
(documentIdVariable
) and a column that contains text data (textVariable
). Additional columns can be included in an
input table. Output tables are generated by the service.
Error Codes
HTTP Status Code | Error Code | Description |
---|---|---|
400 | 71205 | The request was invalid. The specified state value is not a valid state. |
400 | 71206 | The request was invalid. The specified state value is not a valid state. 'Canceled' is the only state value permitted. |
400 | 71212 | The specified paging parameters (start or limit) are invalid. |
404 | 70700 | Fact results do not exist at the requested path. Fact results are not available, because they were not enabled for the given job. |
404 | 71200 | The specified job ID does not exist at the requested path. |
404 | 71202 | Results are not yet available because the job has not finished executing. |
404 | 71203 | Results are not available because the job was canceled. |
404 | 71204 | Results are not available because the job failed. If available, you can find more information from the /errors endpoint. |
404 | 71210 | The specified CAS library does not exist at the requested path. |
404 | 71211 | The specified URI does not exist at the requested path. |
409 | 71201 | The request could not be completed due to a conflict with the current state of the job. The job must be canceled before you can delete it. |
409 | 71207 | The request could not be completed due to a conflict with the current state of the job. The job cannot be canceled because it has already completed. |
500 | 71208 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was fetching results. |
500 | 71209 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was storing the specified data. |
Operations
Root
Contains the operations for the root resource.
Get a list of top-level resource links
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/ \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/concepts/',
{
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/concepts/', 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/concepts/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of top-level resource links in this API.
Example responses
The request succeeded.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs?start=0&limit=10",
"uri": "/categorization/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/",
"uri": "/categorization/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.categorization.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/categorization/jobs",
"uri": "/categorization/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "self",
"href": "/categorization/jobs?start=0&limit=10",
"uri": "/categorization/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.categorization.job"
},
{
"method": "GET",
"rel": "up",
"href": "/categorization/",
"uri": "/categorization/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.categorization.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
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 | [conceptResults] | true | none | The API's top-level links. |
»» Link | conceptResults | 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 the headers for an API resource
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Returns the header information for the API resource. You can also use the request to check whether or not the service is available.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
Jobs
Contains the operations for the Jobs resource, which is used to create and manage jobs.
Get job information
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/concepts/jobs',
{
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/concepts/jobs', 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/concepts/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs
Returns a collection of jobs that the server has processed or is currently processing for the current user. If no jobs exist, an empty collection is returned.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | The criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | The criteria for sorting the collection. See Sorting in REST APIs. |
Example responses
The request succeeded.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs",
"uri": "/concepts/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs?start=0&limit=10",
"uri": "/concepts/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/",
"uri": "/concepts/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs",
"uri": "/concepts/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs?start=0&limit=10",
"uri": "/concepts/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/",
"uri": "/concepts/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | conceptsJobs |
Get the headers for a job collection
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs
Returns the header information for the collection of jobs that the server has processed, or is currently processing for the current user. Can also be used to check whether the collection exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | The criteria for filtering a collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | The criteria for sorting the collection. See Sorting in REST APIs. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
Creates a job to conceptualize documents
Code samples
# You can also use wget
curl -X POST https://example.com/concepts/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.concepts.job.request+json' \
-H 'Accept: application/vnd.sas.text.concepts.job+json'
const inputBody = '{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.concepts.job.request+json',
'Accept':'application/vnd.sas.text.concepts.job+json'
};
fetch('https://example.com/concepts/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.text.concepts.job.request+json',
'Accept': 'application/vnd.sas.text.concepts.job+json'
}
r = requests.post('https://example.com/concepts/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.concepts.job.request+json"},
"Accept": []string{"application/vnd.sas.text.concepts.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/concepts/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Submits the data to be conceptualized using the specified model.
Body parameter
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | conceptsJobRequest | true | The data on which to perform concept scoring. |
Example responses
The request has been accepted for concept scoring, but the processing has not been completed.
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "a3580b35-158b-4ebb-bdea-163b80a5a312",
"state": "pending",
"creationTimeStamp": "2022-03-16T14:41:17.794Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/log",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state?value=canceled",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "a3580b35-158b-4ebb-bdea-163b80a5a312",
"state": "pending",
"creationTimeStamp": "2022-03-16T14:41:17.794Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/log",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state?value=canceled",
"uri": "/concepts/jobs/a3580b35-158b-4ebb-bdea-163b80a5a312/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The specified job request payload was not valid. The response contains more details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: 789ff76dad994b80",
"path: /concepts/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"inputUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request is not valid.",
"details": [
"traceId: 789ff76dad994b80",
"path: /concepts/jobs"
],
"remediation": "Correct the errors and retry the request.",
"errors": [
{
"errorCode": 1020,
"message": "\"null\" is not a valid value for the member \"inputUri\". Reason: must not be empty",
"links": [],
"version": 2,
"httpStatusCode": 400
}
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for concept scoring, but the processing has not been completed. | conceptsJob |
400 | Bad Request | The request was invalid. The specified job request payload was not valid. The response contains more details about why the payload is not valid. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Create job to conceptualize request documents
Code samples
# You can also use wget
curl -X POST https://example.com/concepts/jobs#data \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.concepts.job.request.documents+json' \
-H 'Accept: application/vnd.sas.text.concepts.job+json'
const inputBody = '{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to conceptualize.",
"This additional document to conceptualize"
]
}';
const headers = {
'Content-Type':'application/vnd.sas.text.concepts.job.request.documents+json',
'Accept':'application/vnd.sas.text.concepts.job+json'
};
fetch('https://example.com/concepts/jobs#data',
{
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.text.concepts.job.request.documents+json',
'Accept': 'application/vnd.sas.text.concepts.job+json'
}
r = requests.post('https://example.com/concepts/jobs#data', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.concepts.job.request.documents+json"},
"Accept": []string{"application/vnd.sas.text.concepts.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/concepts/jobs#data", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs#data
Submits the inline data to be conceptualized using the specified model.
Body parameter
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to conceptualize.",
"This additional document to conceptualize"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | conceptsJobRequestDocuments | true | The data on which to perform concept scoring. |
Example responses
The request has been accepted for concept scoring, but the processing has not been completed.
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-16T14:48:59.862Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/<jobId>/state",
"uri": "/concepts/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/<jobId>/log",
"uri": "/concepts/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/concepts/jobs/<jobId>/state?value=canceled",
"uri": "/concepts/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "<jobId>",
"state": "pending",
"creationTimeStamp": "2022-03-16T14:48:59.862Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/<jobId>/state",
"uri": "/concepts/jobs/<jobId>/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/<jobId>/log",
"uri": "/concepts/jobs/<jobId>/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/concepts/jobs/<jobId>/state?value=canceled",
"uri": "/concepts/jobs/<jobId>/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. The specified job request payload was not valid. The response contains more details about why the payload is not valid.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: eeb7c07c0eef6824",
"path: /concepts/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: eeb7c07c0eef6824",
"path: /concepts/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for concept scoring, but the processing has not been completed. | conceptsJob |
400 | Bad Request | The request was invalid. The specified job request payload was not valid. The response contains more details about why the payload is not valid. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the information about a specific job
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.text.concepts.job+json'
const headers = {
'Accept':'application/vnd.sas.text.concepts.job+json'
};
fetch('https://example.com/concepts/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.text.concepts.job+json'
}
r = requests.get('https://example.com/concepts/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.text.concepts.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/concepts/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Returns the current information about a job that was submitted to the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID to look up. |
Example responses
The request succeeded.
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "f817f725-469a-405e-9344-1ac525e1c70c",
"state": "failed",
"creationTimeStamp": "2022-03-16T14:54:16.191Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/state",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/log",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/errors",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>",
"documentIdVariable": "id",
"textVariable": "text",
"id": "f817f725-469a-405e-9344-1ac525e1c70c",
"state": "failed",
"creationTimeStamp": "2022-03-16T14:54:16.191Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/state",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/log",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/errors",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The specified ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"f817f725-469a-405e-9344-1ac525e1c70d\" could not be found.",
"details": [
"traceId: 81c2693dc96062f3",
"path: /concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70d"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"f817f725-469a-405e-9344-1ac525e1c70d\" could not be found.",
"details": [
"traceId: 81c2693dc96062f3",
"path: /concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70d"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | conceptsJob |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}
Retrieves the header information for a specific job. You can also use this request to check whether or not the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID to look up. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | The specified ID does not exist at the requested path. | None |
Deletes a concept job from the server
Code samples
# You can also use wget
curl -X DELETE https://example.com/concepts/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/concepts/jobs/{jobId}',
{
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/concepts/jobs/{jobId}', 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/concepts/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Deletes the job specified by the jobId. If the job has not yet completed, the operation is canceled. The job data is deleted from the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID to look up. |
Example responses
The specified ID does not exist at the requested path.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The job data was deleted. | None |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the state of a job
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/state \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/concepts/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/concepts/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/concepts/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Returns the state of an existing job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Example responses
The request succeeded.
"completed"
The specified ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: 3daa990fe0a62a81","path: /concepts/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | taskState |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get headers about the state of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/state
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/state',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/state')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/state
Returns the header information about the state of a job. You can also use this request to check whether or not the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | The specified ID does not exist at the requested path. | None |
Modify the state of a job
Code samples
# You can also use wget
curl -X PUT https://example.com/concepts/jobs/{jobId}/state?value=canceled \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/concepts/jobs/{jobId}/state?value=canceled',
{
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/concepts/jobs/{jobId}/state', params={
'value': 'canceled'
}, 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/concepts/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /jobs/{jobId}/state
Updates the state of an existing job to a specific value. Currently, this endpoint can be used only to cancel a running job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
value | query | string | true | The value that the state of this job should be changed to. |
Enumerated Values
Parameter | Value |
---|---|
value | canceled |
Example responses
The request succeeded. The state was successfully updated. The response contains the updated state.
"canceled"
The request was invalid. The specified state value is invalid.
{"errorCode":71205,"message":"Invalid state value \"cancel\" specified.","details":["traceId: ee2d66d81a4f7646","path: /concepts/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":400}
The specified ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: 27ce5fa21716c30f","path: /concepts/jobs/<jobId>/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The state was successfully updated. The response contains the updated state. | taskState |
400 | Bad Request | The request was invalid. The specified state value is invalid. | Inline |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get links to the job results
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/results \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/concepts/jobs/{jobId}/results',
{
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/concepts/jobs/{jobId}/results', 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/concepts/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results
Returns the links to the concept results of a job.
If facts were enabled for this job, a link to this job's fact results are included.
Note that this endpoint is available only when the concept job's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the concepts job for which a request is fetching results. |
Example responses
The request succeeded.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results",
"uri": "/concepts/jobs/<jobId>/results",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
},
{
"method": "GET",
"rel": "concepts",
"href": "/concepts/jobs/<jobId>/results/concepts",
"uri": "/concepts/jobs/<jobId>/results/concepts",
"type": "application/vnd.sas.collection",
"responseItemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "conceptsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "ruleMatchesTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_RULE_MATCHES_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_RULE_MATCHES_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "factsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "facts",
"href": "/concepts/jobs/<jobId>/results/facts",
"uri": "/concepts/jobs/<jobId>/results/facts",
"type": "application/vnd.sas.collection",
"responseItemType": "application/vnd.sas.text.concepts.fact.result"
}
]
}
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results",
"uri": "/concepts/jobs/<jobId>/results",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>",
"uri": "/concepts/jobs/<jobId>",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
},
{
"method": "GET",
"rel": "concepts",
"href": "/concepts/jobs/<jobId>/results/concepts",
"uri": "/concepts/jobs/<jobId>/results/concepts",
"type": "application/vnd.sas.collection",
"responseItemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "conceptsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "ruleMatchesTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_RULE_MATCHES_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_RULE_MATCHES_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "factsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "facts",
"href": "/concepts/jobs/<jobId>/results/facts",
"uri": "/concepts/jobs/<jobId>/results/facts",
"type": "application/vnd.sas.collection",
"responseItemType": "application/vnd.sas.text.concepts.fact.result"
}
]
}
The result is not available at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 938da1b1ca50696f",
"path: /concepts/jobs/<jobId>/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 938da1b1ca50696f",
"path: /concepts/jobs/<jobId>/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | Inline |
404 | Not Found | The result is not available at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | 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 | [conceptResults] | true | none | The API's top-level links. |
»» Link | conceptResults | 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. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for the results of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/results
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/results',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/results')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results
Returns the header information for the results of a job. You can also use this request to check whether or not the results exist. Note that this endpoint is available only when the concept job's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the concepts job for which a request is fetching results. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | No result exists at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | None |
Get the concept results of a job
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/results/concepts \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/concepts/jobs/{jobId}/results/concepts',
{
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/concepts/jobs/{jobId}/results/concepts', 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/concepts/jobs/{jobId}/results/concepts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results/concepts
Returns the concept results of a job. Note that this endpoint is available only when the concept job's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The concepts job ID for which a request is fetching results. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
Example responses
The request succeeded.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/results/concepts",
"uri": "/concepts/jobs/<jobId>/results/concepts",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results/concepts?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/results/concepts?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/results/",
"uri": "/concepts/jobs/<jobId>/results/",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "conceptsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.concept.result",
"start": 0,
"count": 1,
"items": [
{
"version": 1,
"id": "2",
"concepts": [
{
"name": "nlpNounGroup",
"term": "additional document",
"startOffset": 5,
"endOffset": 23
}
]
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/results/concepts",
"uri": "/concepts/jobs/<jobId>/results/concepts",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results/concepts?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/results/concepts?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/results/",
"uri": "/concepts/jobs/<jobId>/results/",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "conceptsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_CONCEPTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.concept.result",
"start": 0,
"count": 1,
"items": [
{
"version": 1,
"id": "2",
"concepts": [
{
"name": "nlpNounGroup",
"term": "additional document",
"startOffset": 5,
"endOffset": 23
}
]
}
],
"limit": 10,
"version": 2
}
No result exists at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 39cfbba40bf87c64",
"path: /concepts/jobs/<jobId>/results/concepts"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 39cfbba40bf87c64",
"path: /concepts/jobs/<jobId>/results/concepts"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | conceptResults |
404 | Not Found | No result exists at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for concept results of job
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/results/concepts
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/results/concepts',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/results/concepts')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/results/concepts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results/concepts
Returns the header information for the concept results of a job. You can also use this request to check whether or not the results exist. Note that this endpoint is available only when the concept job's state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the concepts job for which a request is fetching concept results. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | No concept results exist at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | None |
Get the fact results of a job
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/results/facts \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/concepts/jobs/{jobId}/results/facts',
{
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/concepts/jobs/{jobId}/results/facts', 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/concepts/jobs/{jobId}/results/facts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results/facts
Returns the fact results of a job. Note that this endpoint is available only when the concept job's state is completed
and when facts were enabled in the job request.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the concepts job for which a request is fetching fact results. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
Example responses
The request succeeded.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/results/facts",
"uri": "/concepts/jobs/<jobId>/results/facts",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results/facts?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/results/facts?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/results/",
"uri": "/concepts/jobs/<jobId>/results/",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "factsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.fact.result",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/results/facts",
"uri": "/concepts/jobs/<jobId>/results/facts",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/results/facts?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/results/facts?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.concepts.concept.result"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/results/",
"uri": "/concepts/jobs/<jobId>/results/",
"type": "application/vnd.sas.api"
},
{
"method": "GET",
"rel": "factsTable",
"href": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/<tableId>_FACTS_OUT_-TMP",
"type": "application/vnd.sas.cas.table"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
],
"name": "items",
"accept": "application/vnd.sas.text.concepts.fact.result",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
No fact results exist at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 07b6a43603b8a2c7",
"path: /concepts/jobs/<jobId>/results/facts"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 07b6a43603b8a2c7",
"path: /concepts/jobs/<jobId>/results/facts"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | factResults |
404 | Not Found | No fact results exist at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get headers for the fact results of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/results/facts
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/results/facts',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/results/facts')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/results/facts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results/facts
Returns the header information for the fact results of a job. You can also use this request to check whether or not the results exist. Note that this endpoint is available only when the concept job's
state is completed
and when facts are enabled in the job request.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the concepts job for which a request is fetching fact results. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | No fact results exist at the requested path. If available, more information can be found through the /jobs/{jobId} endpoint. | None |
Get job errors
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/errors \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.error+json'
const headers = {
'Accept':'application/vnd.sas.error+json'
};
fetch('https://example.com/concepts/jobs/{jobId}/errors',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.error+json'
}
r = requests.get('https://example.com/concepts/jobs/{jobId}/errors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.error+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/concepts/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/errors
Gets any errors that were generated as a result of a job. Note that the response might contain multiple errors via the nested errors
array member. This endpoint is available only when the job state is failed
. The endpoint is best accessed through the errors
link from the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Example responses
The request succeeded.
{
"errorCode": 2720333,
"message": "com.sas.cas.CASException: The action was not successful. (severity=2 reason=6 statusCode=2720333)\n5 ERROR: The caslib 'lib' does not exist.\n5 ERROR: Table 'example' could not be loaded.\n5 ERROR: Failure opening table 'example'\n5 ERROR: The action stopped due to errors.\ndebug=0x88bfc14d:TKCASA_PRM_BAD_CASLIB",
"details": [
"ERROR: The caslib 'lib' does not exist.",
"ERROR: Table 'example' could not be loaded.",
"ERROR: Failure opening table 'example'",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"type": "application/vnd.sas.text.concepts.job"
}
],
"version": 2,
"httpStatusCode": 0
}
{
"errorCode": 2720333,
"message": "com.sas.cas.CASException: The action was not successful. (severity=2 reason=6 statusCode=2720333)\n5 ERROR: The caslib 'lib' does not exist.\n5 ERROR: Table 'example' could not be loaded.\n5 ERROR: Failure opening table 'example'\n5 ERROR: The action stopped due to errors.\ndebug=0x88bfc14d:TKCASA_PRM_BAD_CASLIB",
"details": [
"ERROR: The caslib 'lib' does not exist.",
"ERROR: Table 'example' could not be loaded.",
"ERROR: Failure opening table 'example'",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"uri": "/concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70c",
"type": "application/vnd.sas.text.concepts.job"
}
],
"version": 2,
"httpStatusCode": 0
}
The specified ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"f817f725-469a-405e-9344-1ac525e1c70d\" could not be found.",
"details": [
"traceId: d60c356f952b1bfd",
"path: /concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70d/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"f817f725-469a-405e-9344-1ac525e1c70d\" could not be found.",
"details": [
"traceId: d60c356f952b1bfd",
"path: /concepts/jobs/f817f725-469a-405e-9344-1ac525e1c70d/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | Inline |
204 | No Content | The ID was found and there are no errors for this job. | None |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 200
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for job errors
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/errors
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/errors',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/errors')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/errors
Returns the header information for the job's errors. This request can also be used to check whether or not errors exist.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | The specified ID does not exist at the requested path. | None |
Get the log for a job as plain text
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/log \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/concepts/jobs/{jobId}/log',
{
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/concepts/jobs/{jobId}/log', 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/concepts/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log
Gets the raw log for this job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Example responses
The request succeeded.
"\"2022-03-16T10:52:08.292 INFO s.t.c.t.ConceptsTask - [JOB_STARTING_EXECUTION] Starting job execution.\n2022-03-16T10:52:08.296 INFO s.t.c.t.ConceptsTask - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570\n2022-03-16T10:52:08.297 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T10:52:08.568 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T10:52:08.568 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T10:52:08.572 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T10:52:08.572 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T10:52:08.575 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T10:52:08.575 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T10:52:08.577 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T10:52:08.577 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T10:52:08.581 INFO s.t.c.t.ConceptsTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T10:52:08.581 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T10:52:08.584 INFO s.t.c.t.ConceptsTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T10:52:08.584 INFO s.t.c.t.ConceptsTask - [CAS_LOADING_ACTION_SET] Loading the \"textRuleScore\" action set.\n2022-03-16T10:52:08.590 INFO s.t.c.t.ConceptsTask - NOTE: Added action set 'textRuleScore'.\n2022-03-16T10:52:08.590 INFO s.t.c.t.ConceptsTask - [CAS_ACTION_SET_LOADED] The \"textRuleScore\" action set was loaded.\n2022-03-16T10:52:08.591 INFO s.t.c.t.ConceptsTask - [CAS_CALLING_ACTION] Calling the \"applyConcept\" action.\n2022-03-16T10:52:08.591 INFO s.t.c.t.ConceptsTask - [CAS_LUA_STRING] LUA string: s:textRuleScore_applyConcept{casOut={caslib=\"public\",name=\"<tableId>_CONCEPTS_OUT_-TMP\",promote=true},docId=\"id\",factOut={caslib=\"public\",name=\"<tableId>_FACTS_OUT_-TMP\",promote=true},language=\"english\",matchType=\"ALL\",ruleMatchOut={caslib=\"public\",name=\"<tableId>_RULE_MATCHES_OUT_-TMP\",promote=true},table={caslib=\"public\",name=\"<tableId>\"},text=\"text\"}\n2022-03-16T10:52:13.679 INFO s.t.c.t.ConceptsTask - [CAS_ACTION_COMPLETE] The \"applyConcept\" action is complete.\n2022-03-16T10:52:13.680 INFO s.t.c.t.ConceptsTask - [JOB_COMPLETED] Job completed. (00:00:05)\"\n"
The specified ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"<jobId>\" could not be found.","details":["traceId: c44b284e084ab4b3","path: /concepts/jobs/<jobId>/log"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | string |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Return the headers for a job log
Code samples
# You can also use wget
curl -X HEAD https://example.com/concepts/jobs/{jobId}/log
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/concepts/jobs/{jobId}/log',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/concepts/jobs/{jobId}/log')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/concepts/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/log
Returns the headers for the job log. This request can also be used to check whether or not the log exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | None |
404 | Not Found | The specified ID does not exist at the requested path. | None |
Get a job log as a collection of log lines
Code samples
# You can also use wget
curl -X GET https://example.com/concepts/jobs/{jobId}/log#collection \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/concepts/jobs/{jobId}/log#collection',
{
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/concepts/jobs/{jobId}/log#collection', 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/concepts/jobs/{jobId}/log#collection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log#collection
Returns the log from this job formatted as a collection of application/vnd.sas.compute.log.line
objects.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The job ID. |
start | query | integer(int64) | false | The start index for pagination. |
limit | query | integer(int32) | false | The limit parameter for pagination. |
Example responses
The request succeeded.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/log",
"uri": "/concepts/jobs/<jobId>/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/log?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/concepts/jobs/<jobId>/log?start=10&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/concepts/jobs/<jobId>/log?start=20&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=20&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/",
"uri": "/concepts/jobs/<jobId>/",
"type": "application/vnd.sas.text.concepts.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 21,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.292 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.296 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.297 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.568 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.568 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.572 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.572 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.575 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.575 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.577 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/concepts/jobs/<jobId>/log",
"uri": "/concepts/jobs/<jobId>/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/<jobId>/log?start=0&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/concepts/jobs/<jobId>/log?start=10&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/concepts/jobs/<jobId>/log?start=20&limit=10",
"uri": "/concepts/jobs/<jobId>/log?start=20&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/concepts/jobs/<jobId>/",
"uri": "/concepts/jobs/<jobId>/",
"type": "application/vnd.sas.text.concepts.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 21,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.292 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.296 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.297 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.568 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.568 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.572 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.572 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.575 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.575 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T10:52:08.577 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
The specified ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 5299e2ab5534cda7",
"path: /concepts/jobs/<jobId>/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"<jobId>\" could not be found.",
"details": [
"traceId: 5299e2ab5534cda7",
"path: /concepts/jobs/<jobId>/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. | logLineCollection |
404 | Not Found | The specified ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.concepts.job%2Bjson/schema | false | none | The representation of an error. |
» links | [conceptResults] | false | none | The links that apply to the error. |
»» Link | conceptResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Schemas
taskState
"pending"
Job State
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job State | string | false | none | The state of the task. |
Enumerated Values
Property | Value |
---|---|
Job State | pending |
Job State | running |
Job State | completed |
Job State | canceled |
Job State | failed |
language
"ar"
Language
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Language | string | false | none | The two letter ISO 639-1 value for selecting a language. |
Enumerated Values
Property | Value |
---|---|
Language | ar |
Language | cs |
Language | da |
Language | de |
Language | el |
Language | en |
Language | es |
Language | fa |
Language | fi |
Language | fr |
Language | he |
Language | hi |
Language | hr |
Language | hu |
Language | id |
Language | it |
Language | ja |
Language | kk |
Language | ko |
Language | nl |
Language | no |
Language | pl |
Language | pt |
Language | ro |
Language | ru |
Language | sk |
Language | sl |
Language | sv |
Language | th |
Language | tl |
Language | tr |
Language | vi |
Language | zh |
matchType
"all"
Match Type
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Match Type | string | false | none | The match type value. |
Enumerated Values
Property | Value |
---|---|
Match Type | all |
Match Type | longest |
Match Type | best |
baseConceptsJobRequest
{
"description": "string",
"modelUri": "string",
"language": "ar",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "string"
}
Common Job Request Properties
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | Provides a brief description that gives details about this concept job request. |
modelUri | string | false | none | The URI to a CAS table that contains one or more concept model binaries. If left blank, the default model for the specified language is used. |
language | language | true | none | The two letter ISO 639-1 value for selecting a language. |
matchType | matchType | false | none | The match type value. |
enableFacts | boolean | false | none | Contains a Boolean value that indicates whether to enable facts in the results. By default, facts are disabled. |
outputTableNamePostfix | string | false | none | Text to add to the end of the output table names. If left blank, the server generates the text. |
conceptsJobRequest
{
"description": "string",
"modelUri": "string",
"language": "ar",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0
}
Job Request for a Table
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for a Table | any | false | none | A request that creates a concepts job from a table. This is the application/vnd.sas.text.concepts.job.request media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseConceptsJobRequest | false | none | The common properties that can be specified for any job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» inputUri | string | true | none | The URI to the table that contains the documents to conceptualize. |
» documentIdVariable | string | true | none | The name of the variable in the table that contains the ID. |
» textVariable | string | true | none | The name of the variable in the table that contains the document text. |
» version | integer(int32) | true | none | This media type's schema version number. This representation is version 1. |
conceptsJobRequestDocuments
{
"description": "string",
"modelUri": "string",
"language": "ar",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "string",
"caslibUri": "string",
"documents": [
"string"
],
"version": 0
}
Job Request for Documents in the Request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for Documents in the Request | any | false | none | A request that creates a concepts job from inline documents. This is the application/vnd.sas.text.concepts.job.request.documents media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseConceptsJobRequest | false | none | The common properties that can be specified for any job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» caslibUri | string | true | none | The URI that points to a caslib in which the data is stored. |
» documents | [string] | true | none | The text documents to conceptualize. These documents are identified in the order in which they are specified to the service, starting from 1. |
» version | integer(int32) | true | none | This media type's schema version number. This is version 1. |
conceptsJob
{
"description": "string",
"modelUri": "string",
"language": "ar",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
Concepts Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Concepts Job | any | false | none | A concepts job. This is the application/vnd.sas.text.concepts.job media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | conceptsJobRequest | false | none | A request that creates a concepts job from a table. This is the application/vnd.sas.text.concepts.job.request media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id | string | true | none | The server-generated ID that uniquely specifies the concept job. |
» state | taskState | true | none | The state of the task. |
» creationTimeStamp | string(date-time) | true | none | A string that contains the datetime value when a job was originally created. The datetime value is in the format yyyy-mm-ddThh:mm:ssZ. |
» version | integer(int32) | true | none | This media type's schema version number. This is version 1. |
conceptResults
{
"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",
"concepts": [
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0
}
],
"version": 0
}
]
}
Collection of Concept Results from a Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Concept Results from a Job | any | false | none | The collection of concept results from a job for the /results/concepts endpoint. |
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 | [object] | false | none | The links that apply to the collection. |
»» 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. |
» 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 | [conceptResult] | true | none | The collection of concept results. Each entry corresponds to the result for one input document. Results are linked to the input documents by the 'id' field. |
conceptResult
{
"id": "string",
"concepts": [
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0
}
],
"version": 0
}
Concept Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | The document identifier that is associated with this result. |
concepts | [concept] | true | none | [A single concept. This is the application/vnd.sas.text.concepts.concept media type.] |
version | integer(int32) | true | none | This media type's schema version number. This is version 1. |
concept
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0
}
Concept
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | The name of the concept that was matched. |
term | string | true | none | The term that matched the concept. |
startOffset | integer(int32) | true | none | The start offset of the match. |
endOffset | integer(int32) | true | none | The end offset of the match. |
conceptsJobs
{
"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": [
{
"description": "string",
"modelUri": "string",
"language": "ar",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Collection of Concept Jobs
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Concept Jobs | any | false | none | This is a collection of concept jobs |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | conceptResults | 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 | [conceptsJob] | false | none | An array that contains concepts jobs. |
factResults
{
"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",
"facts": [
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0,
"arguments": [
{
"name": "string",
"matchedText": "string"
}
]
}
],
"version": 0
}
]
}
Collection of Concept Job Fact Results
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Concept Job Fact Results | any | false | none | The collection of fact results for the /results/facts endpoint. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | conceptResults | 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 | [factResult] | true | none | The collection of fact results where each entry corresponds to the result for one input document. Results are linked to the input documents by the 'id' field. |
factResult
{
"id": "string",
"facts": [
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0,
"arguments": [
{
"name": "string",
"matchedText": "string"
}
]
}
],
"version": 0
}
Fact Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | The document identifier that is associated with the result. |
facts | [fact] | true | none | [A single fact. This is the application/vnd.sas.text.concepts.fact media type.] |
version | integer(int32) | true | none | This media type's schema version number. This is version 1. |
fact
{
"name": "string",
"term": "string",
"startOffset": 0,
"endOffset": 0,
"arguments": [
{
"name": "string",
"matchedText": "string"
}
]
}
Fact
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Fact | any | false | none | A single fact. This is the application/vnd.sas.text.concepts.fact media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | concept | false | none | A single concept. This is the application/vnd.sas.text.concepts.concept media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» arguments | [argument] | true | none | [A single fact argument. This is the application/vnd.sas.text.concepts.fact.argument media type.] |
argument
{
"name": "string",
"matchedText": "string"
}
Argument
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | The name of the argument. |
matchedText | string | true | none | The text to which the argument is matched. |
logLineCollection
{
"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": 1,
"type": "normal",
"line": "string"
}
]
}
A Collection of Log Lines
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
A Collection of Log Lines | any | false | none | The collection of lines from the log file. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | conceptResults | 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 | [any] | true | none | none |
»» Log Line | object | false | none | A single line in a log. This is the application/vnd.sas.compute.log.line media type. |
»»» version | integer(int32) | true | none | The version number of the Log Line (logLine) representation. This is version 1. |
»»» type | string | true | none | The line entry classification. |
»»» line | string | true | none | The line of text without the type (classification) prefix marker. |
Enumerated Values
Property | Value |
---|---|
type | normal |
type | highlighted |
type | source |
type | title |
type | byline |
type | footnote |
type | error |
type | warning |
type | note |
type | message |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.text.concepts.job.request+json
The vnd.sas.text.concepts.job.request
media type represents a request to start a concepts job that processes a table
as input.
This is described by conceptsJobRequest.
{
"description": "My table request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
application/vnd.sas.text.concepts.job.request.documents+json
The vnd.sas.text.concepts.job.request.documents
media type represents a request to start a concepts job that
processes the documents that are provided in the request payload.
This is described by conceptsJobRequestDocuments.
{
"description": "My inline document request",
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/example",
"language": "en",
"matchType": "all",
"enableFacts": true,
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas/caslibs/lib",
"documents": ["This text to conceptualize.", "This additional document to conceptualize"]
}
application/vnd.sas.text.concepts.job+json
The vnd.sas.text.concepts.job
media type represents a job that conceptualizes data. That job might be
processing a CAS table by using the application/vnd.sas.text.concepts.job.request
media type, or it might be
processing documents that were uploaded directly by using the application/vnd.sas.text.concepts.job.request.documents
media
type.
This is described by conceptsJob.
{
"version": 1,
"modelUri": "/casManagement/servers/cas/caslibs/lib/tables/model",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/user-7387a394-7e08-48f7-bcff-db4051c077c3",
"documentIdVariable": "id",
"textVariable": "text",
"id": "873895dc-5ea3-4aac-a136-f582f9d35da3",
"state": "completed",
"creationTimeStamp": "2017-09-08T13:30:53.072Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"uri": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"type": "application/vnd.sas.text.concepts.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3",
"uri": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3"
},
{
"method": "GET",
"rel": "state",
"href": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/state",
"uri": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/log",
"uri": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/results",
"uri": "/concepts/jobs/873895dc-5ea3-4aac-a136-f582f9d35da3/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
application/vnd.sas.text.concepts.concept.result+json
The vnd.sas.text.concepts.concept.result
media type represents the concepts of a specific document regardless of whether
the document came from an input table or was uploaded directly into the job.
This is described by conceptResult.
{
"version": 1,
"id": "1",
"concepts": [
{
"name": "nlpNounGroup",
"term": "sweltering summer",
"startOffset": 77,
"endOffset": 93
},
{
"name": "nlpNounGroup",
"term": "invigorating autumn",
"startOffset": 164,
"endOffset": 182
},
{
"name": "nlpNounGroup",
"term": "rude awakening",
"startOffset": 357,
"endOffset": 370
},
{
"name": "nlpPlace",
"term": "America",
"startOffset": 466,
"endOffset": 472
},
{
"name": "nlpNounGroup",
"term": "citizenship rights",
"startOffset": 505,
"endOffset": 522
},
{
"name": "nlpNounGroup",
"term": "bright day",
"startOffset": 613,
"endOffset": 622
}
]
}
application/vnd.sas.text.concepts.concept+json
The application/vnd.sas.text.concepts.concept
media type represents a concept for a matched document. The
vnd.sas.text.concepts.concept.result
media type contains a collection of these.
This is described by concept.
{
"name": "nlpNounGroup",
"term": "sweltering summer",
"startOffset": 77,
"endOffset": 93
}
application/vnd.sas.text.concepts.fact.result
The vnd.sas.text.concepts.fact.result
media type represents the facts of a specific document, regardless of whether
the document came from an input table or was uploaded directly into the job.
This is described by factResult.
{
"version": 1,
"id": "05.txt",
"facts": [
{
"name": "VERBS",
"term": "is",
"startOffset": 515,
"endOffset": 516,
"arguments": [
{
"name": "verb",
"matchedText": "is"
}
]
}
]
}
application/vnd.sas.text.concepts.fact
The application/vnd.sas.text.concepts.fact
media type represents a fact for a matched document. The
vnd.sas.text.concepts.fact.result
media type contains a collection of these.
This is described by fact.
{
"name": "VERBS",
"term": "is",
"startOffset": 515,
"endOffset": 516,
"arguments": [
{
"name": "verb",
"matchedText": "is"
}
]
}
application/vnd.sas.text.concepts.fact.argument
The application/vnd.sas.text.concepts.fact.argument
media type represents an argument for a fact. The
vnd.sas.text.concepts.fact
media type contains a collection of these.
This is described by argument.
{
"name": "verb",
"matchedText": "is"
}
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.error
A detailed description of an error. See application/vnd.sas.error
.
application/vnd.sas.compute.log.line
A single line from a log file. For this service, the log is created by the execution of a job. See application/vnd.sas.compute.log.line
.
Resource Relationships
The diagram below shows the relationships between the resources in this API.
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
The GET /
response includes these links.
Relation | Method | Description |
---|---|---|
jobs | GET | Returns the first page of the collection of jobs. |
URI: /jobs |
||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.text.concepts.job |
||
startConcepts | POST | Submits a new concepts job for execution. |
URI: /jobs |
||
Request type: application/vnd.sas.text.concepts.job.request or application/vnd.sas.text.concepts.job.request.documents . |
||
Response type: application/vnd.sas.text.concepts.job |
Jobs
Path: /jobs
This API provides collections of jobs.
Members of the /jobs
collection are job resources and /job/{jobId}
. (See below.)
Links
The GET
operation on this path returns a application/vnd.sas.collection
.
This collection response includes the links in this table.
Relation | Method | Description |
---|---|---|
self | GET | Returns the current page from the collection. |
collection | GET | Returns the first page of the collection, without the 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. | ||
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. | ||
up | GET | Returns the parent resource. |
Sorting and Filtering
This collection can be sorted and filtered using the ?sortBy=
and ?filter=
query parameters.
Filtering and sorting can use the following memebers of the Job resource:
id
state
creationTimeStamp
Job
Path: /jobs/{jobId}
A specific job resource.
Links
A job resource has the link relations that are described in this table in the application/vnd.sas.text.concepts.job
representation.
Relation | Method | Description |
---|---|---|
self | GET | Returns the job. |
URI: /jobs/{jobId} |
||
Response type: application/vnd.sas.text.concepts.job |
||
delete | DELETE | Deletes the job. |
URI: /jobs/{jobId} |
||
state | GET | Returns the job state. |
URI: /jobs/{jobId}/state |
||
Response type: text/plain |
||
cancel | PUT | Cancels the job.1 |
URI: /jobs/{jobId}/state?value=canceled |
||
results | GET | Returns the job results.2 |
URI: /jobs/{jobId}/results |
||
Response type: application/vnd.sas.text.concepts.job.results |
||
errors | GET | Returns any errors that are associated with the job.3 |
URI: /jobs/{jobId}/errors |
||
Response type: application/vnd.sas.error |
||
log | GET | Gets the log that is associated with the job. |
URI: /jobs/{jobId}/log |
||
Response type: text/plain or application/json |
||
caslib | GET | Returns the library for the results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib} |
||
Response type: application/vnd.sas.cas.caslib |
1 Only available when the job's state is 'pending' or 'running'.
2 Only available when the job's state is 'completed'.
3 Only available when the job's state is 'failed' or 'canceled'.
Job Results
Path: /jobs/{jobId}/results
The results from a specific concepts job. This path returns links to the resources that are available as results from this job.
Links
The GET
operation on this path returns a application/vnd.sas.api
representation including
the links that are described in this table.
Relation | Method | Description |
---|---|---|
self | GET | Returns the current result links. |
up | GET | Returns the parent resource. |
caslib | GET | Returns the library for the results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib} |
||
Response type: application/vnd.sas.cas.caslib |
||
concepts | GET | Returns the job concept results. |
URI: /jobs/{jobId}/results/concepts |
||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.text.concepts.concept.result |
||
conceptsTable | GET | Returns the backing table for the concept results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} |
||
Response type: application/vnd.sas.cas.table |
||
facts | GET | Returns the job fact results, if enabled. |
URI: /jobs/{jobId}/results/facts |
||
Response type: application/vnd.sas.collection |
||
Response item type: application/vnd.sas.text.concepts.fact.result |
||
factsTable | GET | Returns the backing table for the individual facts. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} |
||
Response type: application/vnd.sas.cas.table |
||
ruleMatchesTable | GET | Returns the backing table for rule matches. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} |
||
Response type: application/vnd.sas.cas.table |
Concept Job Results
Path: /jobs/{jobId}/results/concepts
This path provides collections of concepts.
Links
The GET
operation returns a application/vnd.sas.collection
collection.
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 the 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. | ||
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. | ||
up | GET | Returns the parent resource. |
caslib | GET | Returns the library for the results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib} |
||
Response type: application/vnd.sas.cas.caslib |
||
conceptsTable | GET | Gets the backing table for the concept results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} |
||
Response type: application/vnd.sas.cas.table |
Job Fact Results
Path: /jobs/{jobId}/results/facts
This path provides collections of facts.
Links
The GET
operation returns a application/vnd.sas.collection
collection.
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 the 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. | ||
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. | ||
up | GET | Returns the parent resource. |
caslib | GET | Gets the library for the results. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib} |
||
Response type: application/vnd.sas.cas.caslib |
||
factsTable | GET | Gets the backing table for the individual facts. |
URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} |
||
Response type: application/vnd.sas.cas.table |
Text Parsing
Base URLs:
- https://example.com/parsing
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 Text Parsing API parses natural language text documents. This API is deprecated and will be removed in a future release.
Usage Notes
Overview
Parsing is a key operation in understanding your data. Parsing a document involves the following analyses:
- Identifying terms used in the document
- Recognizing parts of speech for each term
- Identifying which terms are entities (person, country, and so on)
- Resolving synonyms, misspellings, and so on
The output tables that are generated during parsing can also be used in downstream analyses such as topic generation.
This service provides two different interactions for parsing: parsing documents in CAS tables and parsing documents that are
uploaded directly into the API. In both cases, the service uses an asynchronous execution model. The client creates an analysis
job that runs in the background after the Create operation returns. The API provides resource endpoints for checking the state of the job. Then, when
it is complete, you retrieve the results by using either the /results
endpoint on the job or by interacting with the result table
directly. To interact with the results table directly you use another API, such as the Row Sets API.
When parsing documents in a table, the service views each row in the input table as a document. Thus, the API
requires two input parameters: documentIdVariable
and textVariable
. The documentIdVariable
is a unique identifier for the
document and the textVariable
is the actual document text. For example, consider a table containing tweets from @SASSoftware:
ID | Date Created | Message |
---|---|---|
850007368138018817 | Thu Apr 06 15:28:43 +0000 2017 | Real-time and #AI are changing marketing: join 9/13 #SASWebinar with special guest from @Forrester |
787452347508998458 | Thu Apr 06 12:54:02 +0000 2017 | US has over 4 million miles of roads that could have 10 million fully or semi autonomous cars by 2020 #IoT |
774598598680208850 | Thu Apr 06 12:28:22 +0000 2017 | Need help with your fight against #fraud? |
In this example, the documentIdVariable
would be ID and the textVariable
would be Message.
One of the values the API takes as input is a language
parameter. For English, the language
parameter must take the form of en
(ISO-639-1 short codes for English). The language
parameter is used to
select the linguistic binaries that are used to parse documents.
The API also takes optional startListUri
, stopListUri
, and synonymListUri
input table URIs. If neither a startListUri
nor stopListUri
is provided and the specified language has an associated default stop list, then this stop list is used. Only
one of these two tables can be provided for a single job.
See Start List, Stop List, and Synonym List for more information.
Note that all table URI parameters should use the following form of values: "/casManagement/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}". Refer to an example with multiple URI parameters.
Terminology
binary
a rule that identifies a language-specific construct, such as a part of speech or an entity. The binaries for a language comprise the model that determines which types of terms a document contains.
job
a container for an asynchronous operation. A job supports a number of different operations such as checking a state, canceling an operation, fetching results, and so on. All jobs are performed asynchronously.
language
a parameter that specifies which domain-independent model to use for processing input documents. This parameter is required when you process tables or uploaded documents. For English, the language parameter must take the form of "en" (see ISO-639-1 short codes).
library
a container for inputs and outputs when you use CAS. Services, such as parsing, use a library to locate input data and to store output tables that they create.
LITI binary model
a compiled binary model for extracting concepts or facts from a document. The language interpretation and text interpretation (LITI) binary model is built using a tool such as SAS Enterprise Content Categorization (ECC), SAS Contextual Analysis (SCA), or SAS Visual Text Analytics (VTA). LITI is the programming language that is used to define concepts and fact rules. LITI binary models are stored in *.li files.
parse
an operation that is performed on a document or a collection of documents, such as in a table. A parse operation identifies terms, entities, and parts of speech. Other operations, such as resolving synonyms, misspellings, and so on, can also be performed by a parse operation.
a table of terms to keep in the output. Any terms that are not included in the start list are
dropped. A start list must contain a term
column and can contain an optional role
column.
You cannot use a start list in conjunction with a stop list.
a table of terms to drop from the output. A stop list must contain a term
column and can
contain an optional role
column. You cannot use a stop list in conjunction with a start list.
a table that is used to map child terms to parent terms. A synonym list must contain two columns,
term
and parent
. A synonym list can contain the optional columns term_role
and parent_role
.
override list
a table that can be used to force terms to be kept or dropped regardless of other processing.
table
the input to and output from a parsing job. The input table must have both an ID column (documentIdVariable
) and
a column that contains text data (textVariable
). A table can contain other columns as well. Output tables are generated by a
parsing job.
term
a specific word or phrase in a document. A term typically has an associated role
that identifies the
function of the term. A term's role
might be to function as a part
of speech or to function as an entity, such as person. A term also contains offset information
(startOffset
and endOffset
) that identifies the location of the term within a document.
Error Codes
HTTP Status Code | Error Code | Description |
---|---|---|
400 | 70800 | The request was invalid. Both a start list and a stop list were specified. You cannot use both simultaneously. |
400 | 71205 | The request was invalid. The specified state value is not a valid state. |
400 | 71206 | The request was invalid. The specified state value is not a valid state. Only the state ‘canceled’ is permitted. |
400 | 71212 | The specified paging parameters (start or limit) are invalid. |
404 | 70801 | The specified start list or stop list does not exist at the requested path. |
404 | 71200 | The specified job ID does not exist at the requested path. |
404 | 71202 | Results are not available yet because the job has not finished execution. |
404 | 71203 | Results are not available because the job was canceled. |
404 | 71204 | Results are not available because the job failed. If available, you can find more information from the /errors endpoint. |
404 | 71210 | No CAS library exists at the requested path. The specified CAS library is invalid. |
404 | 71211 | The specified URI does not exist at the requested path. |
409 | 71201 | The request could not be completed due to a conflict with the current state of the job. The job must be canceled before you can delete it. |
409 | 71207 | The request could not be completed due to a conflict with the current state of the job. The job cannot be canceled because it has already completed. |
500 | 71208 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was fetching results. |
500 | 71209 | The request could not be fulfilled because of an unexpected server error. An error occurred while the request was storing the specified data. |
Operations
Root
Contains the operations for the Root resource.
Get a list of top-level resource links
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/ \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/parsing/',
{
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/parsing/', 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/parsing/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of top-level resource links in this API.
Example responses
The request succeeded. The request returned a collection of link objects.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "POST",
"rel": "startParsing",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.text.parsing.job.request",
"responseType": "application/vnd.sas.text.parsing.job"
}
]
}
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "POST",
"rel": "startParsing",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.text.parsing.job.request",
"responseType": "application/vnd.sas.text.parsing.job"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The request returned a collection of link objects. | 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 | [parsingJobResults] | true | none | The API's top-level links. |
»» Link | parsingJobResults | 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 API availability
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Retrieves header information for the API resource. You can also use the request to check whether the service is available.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. API resource links are available. | None |
Jobs
Contains the operations for the Jobs resource, which is used to create and manage jobs.
Get a collection of jobs
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/parsing/jobs',
{
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/parsing/jobs', 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/parsing/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs
Returns a collection of jobs that the server has processed or is currently processing for the current user. If no such jobs exist, an empty collection is returned.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting the collection. See Sorting in REST APIs. |
Example responses
The request succeeded. The request returns all of the current jobs for a given user.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs?start=0&limit=10",
"uri": "/parsing/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "GET",
"rel": "up",
"href": "/parsing/",
"uri": "/parsing/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.parsing.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/parsing/jobs",
"uri": "/parsing/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs?start=0&limit=10",
"uri": "/parsing/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job"
},
{
"method": "GET",
"rel": "up",
"href": "/parsing/",
"uri": "/parsing/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.parsing.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The request returns all of the current jobs for a given user. | parsingJobs |
Check whether a collection of jobs exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs
Retrieves header information for a collection of jobs. You can also use this request to check whether a collection exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | Indicates the criteria for filtering a collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
sortBy | query | string(sort-criteria) | false | Indicates the criteria for sorting a collection. See Sorting in REST APIs. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The collection is available. | None |
Create a job that parses table of documents
Code samples
# You can also use wget
curl -X POST https://example.com/parsing/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.parsing.job.request+json' \
-H 'Accept: application/vnd.sas.text.parsing.job+json'
const inputBody = '{
"version": 1,
"description": "My table request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.parsing.job.request+json',
'Accept':'application/vnd.sas.text.parsing.job+json'
};
fetch('https://example.com/parsing/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.text.parsing.job.request+json',
'Accept': 'application/vnd.sas.text.parsing.job+json'
}
r = requests.post('https://example.com/parsing/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.parsing.job.request+json"},
"Accept": []string{"application/vnd.sas.text.parsing.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/parsing/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Performs natural language parsing on the input data.
Body parameter
{
"version": 1,
"description": "My table request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | parsingJobRequest | true | Indicates the text to parse. |
Example responses
Indicates that the job was accepted for processing, but the processing has not been completed.
{
"version": 2,
"description": "My table request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"state": "pending",
"creationTimeStamp": "2022-03-16T17:04:00.022Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/log",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state?value=canceled",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/lib",
"uri": "/casManagement/servers/cas-shared-default/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 2,
"description": "My table request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"id": "138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"state": "pending",
"creationTimeStamp": "2022-03-16T17:04:00.022Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/log",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state?value=canceled",
"uri": "/parsing/jobs/138d0d18-fc4d-4bef-bdc8-12d7de5b157d/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/lib",
"uri": "/casManagement/servers/cas-shared-default/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. Both a start list and a stop list were specified. You cannot use both simultaneously.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: b2a160423e7a6a29",
"path: /parsing/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: b2a160423e7a6a29",
"path: /parsing/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Indicates that the job was accepted for processing, but the processing has not been completed. | parsingJob |
400 | Bad Request | The request was invalid. Both a start list and a stop list were specified. You cannot use both simultaneously. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Create a job to parse documents
Code samples
# You can also use wget
curl -X POST https://example.com/parsing/jobs#data \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.parsing.job.request.documents+json' \
-H 'Accept: application/vnd.sas.text.parsing.job+json'
const inputBody = '{
"version": 1,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to parse.",
"This additional document to parse."
],
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.parsing.job.request.documents+json',
'Accept':'application/vnd.sas.text.parsing.job+json'
};
fetch('https://example.com/parsing/jobs#data',
{
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.text.parsing.job.request.documents+json',
'Accept': 'application/vnd.sas.text.parsing.job+json'
}
r = requests.post('https://example.com/parsing/jobs#data', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.parsing.job.request.documents+json"},
"Accept": []string{"application/vnd.sas.text.parsing.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/parsing/jobs#data", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs#data
Performs natural language parsing on the input data.
Body parameter
{
"version": 1,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas-shared-default/caslibs/public",
"documents": [
"This text to parse.",
"This additional document to parse."
],
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | parsingJobRequestDocuments | true | Indicates the documents to parse. |
Example responses
The request has been accepted for processing, but the processing has not been completed.
{
"version": 2,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/jehawr-afff84e1-0cc9-4ad9-a013-75495fe6689a",
"documentIdVariable": "id",
"textVariable": "text",
"id": "645f4e38-4c2c-43e4-992c-080170cc1317",
"state": "pending",
"creationTimeStamp": "2022-03-16T17:12:30.055Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/log",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state?value=canceled",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 2,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/jehawr-afff84e1-0cc9-4ad9-a013-75495fe6689a",
"documentIdVariable": "id",
"textVariable": "text",
"id": "645f4e38-4c2c-43e4-992c-080170cc1317",
"state": "pending",
"creationTimeStamp": "2022-03-16T17:12:30.055Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/log",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state?value=canceled",
"uri": "/parsing/jobs/645f4e38-4c2c-43e4-992c-080170cc1317/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was invalid. Both a start list and a stop list were specified. You cannot use both simultaneously.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: 4755d8f587f3be9e",
"path: /parsing/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: 4755d8f587f3be9e",
"path: /parsing/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | The request has been accepted for processing, but the processing has not been completed. | parsingJob |
400 | Bad Request | The request was invalid. Both a start list and a stop list were specified. You cannot use both simultaneously. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get job information for a specific job
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.text.parsing.job+json'
const headers = {
'Accept':'application/vnd.sas.text.parsing.job+json'
};
fetch('https://example.com/parsing/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.text.parsing.job+json'
}
r = requests.get('https://example.com/parsing/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.text.parsing.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/parsing/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Returns the current information for a job that was submitted to the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Example responses
The request succeeded. The information about the job is available.
{
"version": 2,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/jehawr-e331b825-fddc-4903-8297-c87b606241dd",
"documentIdVariable": "id",
"textVariable": "text",
"id": "350141cb-e1d5-45ac-9bee-f1c666151a5d",
"state": "failed",
"creationTimeStamp": "2022-03-16T17:16:41.724Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/state",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/log",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/errors",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 2,
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"minimumDocumentCount": 10,
"outputTableNamePostfix": "-TMP",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/overrideList",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/public/tables/jehawr-e331b825-fddc-4903-8297-c87b606241dd",
"documentIdVariable": "id",
"textVariable": "text",
"id": "350141cb-e1d5-45ac-9bee-f1c666151a5d",
"state": "failed",
"creationTimeStamp": "2022-03-16T17:16:41.724Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/state",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/log",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/errors",
"uri": "/parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5d/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas-shared-default/caslibs/public",
"uri": "/casManagement/servers/cas-shared-default/caslibs/public",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The specified job ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"350141cb-e1d5-45ac-9bee-f1c666151a5e\" could not be found.",
"details": [
"traceId: b1fc45233b9bb122",
"path: /parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5e"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"350141cb-e1d5-45ac-9bee-f1c666151a5e\" could not be found.",
"details": [
"traceId: b1fc45233b9bb122",
"path: /parsing/jobs/350141cb-e1d5-45ac-9bee-f1c666151a5e"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The information about the job is available. | parsingJob |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs/{jobId}
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs/{jobId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}
Retrieves header information for the job. You can also use this request to check whether the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The specified ID exists. | None |
404 | Not Found | The specified job ID does not exist at the requested path. | None |
Delete the specified job from the server
Code samples
# You can also use wget
curl -X DELETE https://example.com/parsing/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/parsing/jobs/{jobId}',
{
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/parsing/jobs/{jobId}', 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/parsing/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Deletes the job that is identified by its job ID. If the job has not yet completed, the operation is canceled. The parse data and any output is then cleared from the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job to look up. |
Example responses
The specified job ID does not exist at the requested path.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The job was deleted. | None |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the state of a job
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId}/state \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/parsing/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/parsing/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/parsing/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Gets the state of an existing job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Example responses
The request succeeded. The current job state is available.
"completed"
"failed"
The specified job ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"5435b4bb-5b55-4cb7-8a00-48c056bf4373\" could not be found.","details":["traceId: 5ac63443196acf57","path: /parsing/jobs/5435b4bb-5b55-4cb7-8a00-48c056bf4373"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | taskState |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the state of a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs/{jobId}/state
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs/{jobId}/state',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs/{jobId}/state')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/state
Retrieves header information for the state of a job. You can also use this request to check whether the state exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The specified ID was found. | None |
404 | Not Found | The specified job ID does not exist at the requested path. | None |
Modify the state of an existing job
Code samples
# You can also use wget
curl -X PUT https://example.com/parsing/jobs/{jobId}/state?value=canceled \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/parsing/jobs/{jobId}/state?value=canceled',
{
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/parsing/jobs/{jobId}/state', params={
'value': 'canceled'
}, 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/parsing/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /jobs/{jobId}/state
Modifies the state of an existing job. Currently, use this request only to cancel the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
value | query | string | true | Indicates the value to change the state to for a job. |
Enumerated Values
Parameter | Value |
---|---|
value | canceled |
Example responses
The request succeeded. The state was successfully updated. The response contains the updated state.
"canceled"
The request was invalid. The specified state value is not a valid state.
{"errorCode":71205,"message":"Invalid state value \"cancele\" specified.","details":["traceId: 711532f314810685","path: /parsing/jobs/5435b4bb-5b55-4cb7-8a00-48c056bf4374/state"],"links":[],"version":2,"httpStatusCode":400}
The specified job ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"5435b4bb-5b55-4cb7-8a00-48c056bf4373\" could not be found.","details":["traceId: 8b6c85b3eb55f51b","path: /parsing/jobs/5435b4bb-5b55-4cb7-8a00-48c056bf4373/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The state was successfully updated. The response contains the updated state. | taskState |
400 | Bad Request | The request was invalid. The specified state value is not a valid state. | Inline |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the results of a job
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId}/results \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/parsing/jobs/{jobId}/results',
{
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/parsing/jobs/{jobId}/results', 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/parsing/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results
Retrieves the results of a job. This endpoint is available only when the state of the job is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job from which you want results. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
includeDroppedTerms | query | boolean | false | Indicates a Boolean that specifies whether to include dropped terms in the results. The default value is false. |
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",
"terms": [
{
"value": "string",
"role": "string",
"startOffset": 0,
"endOffset": 0,
"kept": true
}
],
"version": 0
}
]
}
No result exists at the requested path. If available, you can find more information through the /jobs/{jobId} endpoint.
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: 719ad258b48141dd",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: 719ad258b48141dd",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job result is available. | parsingJobResults |
404 | Not Found | No result exists at the requested path. If available, you can find more information through the /jobs/{jobId} endpoint. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the results of a job exist
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs/{jobId}/results
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs/{jobId}/results',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs/{jobId}/results')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results
Retrieves header information for the results of a job. You can also use this request to check whether the results exist. This endpoint is available only when the state of the job is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job from which you want results. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
includeDroppedTerms | query | boolean | false | Indicates a Boolean that specifies whether to include dropped terms in the results. The default value is false. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The result is available. | None |
404 | Not Found | No result exists at the requested path. If available, you can find more information through the /jobs/{jobId} endpoint. | None |
Get job errors
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId}/errors \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.error+json'
const headers = {
'Accept':'application/vnd.sas.error+json'
};
fetch('https://example.com/parsing/jobs/{jobId}/errors',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.error+json'
}
r = requests.get('https://example.com/parsing/jobs/{jobId}/errors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.error+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/parsing/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/errors
Gets any errors that were generated as a result of a job. The response might contain multiple errors via the nested errors
array member. This endpoint is available only when the job state is failed
. The best access point is the errors
link from the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Example responses
The request succeeded. All of the job errors are available.
{
"errorCode": 1630035,
"message": "com.sas.cas.CASException: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete. (severity=2 reason=6 statusCode=1630035 TEXT_MINE_NO_DATA)\n5 ERROR: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete.\n5 ERROR: The action stopped due to errors.\ndebug=0x853fd823:CASTMN_SVD_TOOFEW",
"details": [
"ERROR: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete.",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797",
"type": "application/vnd.sas.text.parsing.job"
}
],
"version": 2,
"httpStatusCode": 0
}
{
"errorCode": 1630035,
"message": "com.sas.cas.CASException: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete. (severity=2 reason=6 statusCode=1630035 TEXT_MINE_NO_DATA)\n5 ERROR: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete.\n5 ERROR: The action stopped due to errors.\ndebug=0x853fd823:CASTMN_SVD_TOOFEW",
"details": [
"ERROR: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete.",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797",
"type": "application/vnd.sas.text.parsing.job"
}
],
"version": 2,
"httpStatusCode": 0
}
The specified job ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"b4899860-9a6f-459b-a061-8238ea36d796\" could not be found.",
"details": [
"traceId: 86a915cf532123fe",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d796/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"b4899860-9a6f-459b-a061-8238ea36d796\" could not be found.",
"details": [
"traceId: 86a915cf532123fe",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d796/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. All of the job errors are available. | Inline |
204 | No Content | There is no content for this job. The job ID was found, and there are no errors. | None |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 200
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether errors exist for a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs/{jobId}/errors
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs/{jobId}/errors',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs/{jobId}/errors')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/errors
Retrieves header information for job errors. You can also use this request to check whether job errors exist.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Errors are available. | None |
404 | Not Found | No errors exist at the requested path. | None |
Get the log for a job as plain text
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId}/log \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/parsing/jobs/{jobId}/log',
{
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/parsing/jobs/{jobId}/log', 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/parsing/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log
Gets the plain text log from a job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Example responses
The request succeeded. The log is available.
"\"2022-03-16T13:33:01.868 INFO c.s.t.p.t.ParseTask - [JOB_STARTING_EXECUTION] Starting job execution.\n2022-03-16T13:33:01.874 INFO c.s.t.p.t.ParseTask - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570\n2022-03-16T13:33:01.875 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.137 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.137 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.141 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.141 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.144 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.144 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.147 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.147 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.152 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.152 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.157 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.157 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.160 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.160 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.163 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.163 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.166 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.166 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.168 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.168 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.\n2022-03-16T13:33:02.172 INFO c.s.t.p.t.ParseTask - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.\n2022-03-16T13:33:02.172 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.\n2022-03-16T13:33:02.176 INFO c.s.t.p.t.ParseTask - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.\n2022-03-16T13:33:02.186 INFO c.s.t.p.t.ParseTask - [STOP_LIST_ALREADY_LOADED] The \"EN_STOPLIST\" stop list has already been loaded.\n2022-03-16T13:33:02.186 INFO c.s.t.p.t.ParseTask - [CAS_LOADING_ACTION_SET] Loading the \"textParse\" action set.\n2022-03-16T13:33:02.193 INFO c.s.t.p.t.ParseTask - NOTE: Added action set 'textParse'.\n2022-03-16T13:33:02.194 INFO c.s.t.p.t.ParseTask - [CAS_ACTION_SET_LOADED] The \"textParse\" action set was loaded.\n2022-03-16T13:33:02.194 INFO c.s.t.p.t.ParseTask - [CAS_CALLING_ACTION] Calling the \"tpParse\" action.\n2022-03-16T13:33:02.196 INFO c.s.t.p.t.ParseTask - [CAS_LUA_STRING] LUA string: s:textParse_tpParse{docId=\"id\",entities=\"NONE\",language=\"ENGLISH\",nounGroups=true,offset={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_POSITION_OUT_-TMP\",promote=true},outComplexTag=true,parseConfig={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_CONFIGURATION_OUT_-TMP\",promote=true},table={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35\"},text=\"text\"}\n2022-03-16T13:33:03.387 INFO c.s.t.p.t.ParseTask - [CAS_ACTION_COMPLETE] The \"tpParse\" action is complete.\n2022-03-16T13:33:03.394 INFO c.s.t.p.t.ParseTask - [CAS_CALLING_ACTION] Calling the \"tpAccumulate\" action.\n2022-03-16T13:33:03.395 INFO c.s.t.p.t.ParseTask - [CAS_LUA_STRING] LUA string: s:textParse_tpAccumulate{child={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_CHILD_OUT_-TMP\",promote=true},complexTag=true,includeEmptyDocument=true,language=\"ENGLISH\",offset={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_POSITION_OUT_-TMP\"},parent={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_PARENT_OUT_-TMP\",promote=true},reduce=10,showDroppedTerms=true,stopList={caslib=\"ReferenceData\",name=\"EN_STOPLIST\"},terms={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_TERMS_OUT_-TMP\",promote=true}}\n2022-03-16T13:33:03.503 INFO c.s.t.p.t.ParseTask - [CAS_ACTION_COMPLETE] The \"tpAccumulate\" action is complete.\n2022-03-16T13:33:03.504 INFO c.s.t.p.t.ParseTask - [CAS_LOADING_ACTION_SET] Loading the \"textMining\" action set.\n2022-03-16T13:33:03.508 INFO c.s.t.p.t.ParseTask - NOTE: Added action set 'textMining'.\n2022-03-16T13:33:03.510 INFO c.s.t.p.t.ParseTask - [CAS_ACTION_SET_LOADED] The \"textMining\" action set was loaded.\n2022-03-16T13:33:03.510 INFO c.s.t.p.t.ParseTask - [CAS_CALLING_ACTION] Calling the \"tmSvd\" action.\n2022-03-16T13:33:03.511 INFO c.s.t.p.t.ParseTask - [CAS_LUA_STRING] LUA string: s:textMining_tmSvd{docId=\"_document_\",maxK=1,parent={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_PARENT_OUT_-TMP\"},terms={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_TERMS_OUT_-TMP\"},u={caslib=\"public\",name=\"jehawr-409b8da8-0710-4e71-9f6d-e1d2fac58f35_PARSING_SVD_OUT_-TMP\",promote=true}}\n2022-03-16T13:33:03.530 ERROR c.s.t.p.t.ParseTask - ERROR: Not enough data to analyze. The SVD and topic computations require at least 2 nonempty documents and 2 retained terms to complete.\n2022-03-16T13:33:03.534 ERROR c.s.t.p.t.ParseTask - ERROR: The action stopped due to errors.\"\n"
The specified job ID does not exist at the requested path.
{"errorCode":71200,"message":"The job with id \"b4899860-9a6f-459b-a061-8238ea36d796\" could not be found.","details":["traceId: e445cb75bd4e4a13","path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d796/log"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available. | string |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Check whether the log for a job exists
Code samples
# You can also use wget
curl -X HEAD https://example.com/parsing/jobs/{jobId}/log
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/parsing/jobs/{jobId}/log',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/parsing/jobs/{jobId}/log')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/parsing/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/log
Retrieves header information for the job log. You can also use this request to check whether the job log exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available. | None |
404 | Not Found | No log exists at the requested path. | None |
Get the log for a job as log lines
Code samples
# You can also use wget
curl -X GET https://example.com/parsing/jobs/{jobId}/log#collection \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/parsing/jobs/{jobId}/log#collection',
{
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/parsing/jobs/{jobId}/log#collection', 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/parsing/jobs/{jobId}/log#collection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log#collection
Gets the log from a job formatted as a collection of application/vnd.sas.compute.log.line
objects.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Indicates the ID of the job. |
start | query | integer(int64) | false | Indicates the start index for pagination. |
limit | query | integer(int32) | false | Indicates the limit parameter for pagination. |
Example responses
The request succeeded. The log is available.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=0&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=10&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=40&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=40&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/",
"type": "application/vnd.sas.text.parsing.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 43,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.868 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.874 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.875 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.137 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.137 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.141 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.141 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.144 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.144 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.147 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=0&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "next",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=10&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=10&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "last",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=40&limit=10",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/log?start=40&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/",
"uri": "/parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d797/",
"type": "application/vnd.sas.text.parsing.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 43,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.868 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.874 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:01.875 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.137 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.137 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.141 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.141 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.144 - [CAS_SESSION_TABLE_DOES_NOT_EXIST] Session table does not exist.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.144 - [CAS_GLOBAL_TABLE_CHECK] Checking for the existence of a global table.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T13:33:02.147 - [CAS_GLOBAL_TABLE_DOES_NOT_EXIST] Global table does not exist.",
"type": "note"
}
],
"limit": 10,
"version": 2
}
The specified job ID does not exist at the requested path.
{
"errorCode": 71200,
"message": "The job with id \"b4899860-9a6f-459b-a061-8238ea36d798\" could not be found.",
"details": [
"traceId: 7168e71a48da1636",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d798/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"b4899860-9a6f-459b-a061-8238ea36d798\" could not be found.",
"details": [
"traceId: 7168e71a48da1636",
"path: /parsing/jobs/b4899860-9a6f-459b-a061-8238ea36d798/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The log is available. | logLineCollection |
404 | Not Found | The specified job ID does not exist at the requested path. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.parsing.job%2Bjson/schema | false | none | The representation of an error. |
» links | [parsingJobResults] | false | none | The links that apply to the error. |
»» Link | parsingJobResults | 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Schemas
taskState
"pending"
Job State
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job State | string | false | none | Indicates the state of the job. |
Enumerated Values
Property | Value |
---|---|
Job State | pending |
Job State | running |
Job State | completed |
Job State | canceled |
Job State | failed |
language
"ar"
Language
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Language | string | false | none | Indicates the two letter ISO 639-1 value for a language. |
Enumerated Values
Property | Value |
---|---|
Language | ar |
Language | cs |
Language | da |
Language | de |
Language | el |
Language | en |
Language | es |
Language | fa |
Language | fi |
Language | fr |
Language | he |
Language | hi |
Language | hr |
Language | hu |
Language | id |
Language | it |
Language | ja |
Language | kk |
Language | ko |
Language | nl |
Language | no |
Language | pl |
Language | pt |
Language | ro |
Language | ru |
Language | sk |
Language | sl |
Language | sv |
Language | th |
Language | tl |
Language | tr |
Language | vi |
Language | zh |
baseParsingJobRequest
{
"description": "string",
"language": "ar",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListUri": "string",
"stopListUri": "string",
"synonymListUri": "string",
"minimumDocumentCount": 0,
"conceptModelUri": "string",
"outputTableNamePostfix": "string",
"enableSpellChecking": false,
"overrideListUri": "string"
}
Common Job Request Properties
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | Indicates a brief description with details about a job. |
language | language | true | none | Indicates the two letter ISO 639-1 value for a language. |
includeStandardEntities | boolean | false | none | Indicates a flag that specifies whether to include standard entities in the result. |
includeNounGroups | boolean | false | none | Indicates a flag that specifies whether to include noun groups in the result. |
startListUri | string | false | none | Indicates the URI to a table that contains terms to keep. Do not use a start list and a stop list simultaneously. |
stopListUri | string | false | none | Indicates the URI to a table that contains terms to drop. Do not use a stop list and a start list simultaneously. |
synonymListUri | string | false | none | Indicates the URI to a table that contains synonyms. |
minimumDocumentCount | integer(int32) | false | none | Indicates the minimum number of documents that a term must appear in to be kept. The default value is 10. |
conceptModelUri | string | false | none | Indicates the URI to a table that contains the concept LITI binaries to apply during parsing. |
outputTableNamePostfix | string | false | none | Indicates text to add to the end of the output table names. If left blank, the server generates text. |
enableSpellChecking | boolean | false | none | A flag indicating whether or not spell checking should be performed while parsing. |
overrideListUri | string | false | none | The URI to a table that contains overrides for keep and drop terms. |
parsingJobRequest
{
"description": "string",
"language": "ar",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListUri": "string",
"stopListUri": "string",
"synonymListUri": "string",
"minimumDocumentCount": 0,
"conceptModelUri": "string",
"outputTableNamePostfix": "string",
"enableSpellChecking": false,
"overrideListUri": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0
}
Job Request for a Table
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for a Table | any | false | none | Indicates a request to create a text parsing job from a table. This is the application/vnd.sas.text.parsing.job.request media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseParsingJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» inputUri | string | true | none | Indicates the URI to the table that contains the documents to parse. |
» documentIdVariable | string | true | none | Indicates the name of the variable in the table that contains the document ID. |
» textVariable | string | true | none | Indicates the name of the variable in the table that contains the document text. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
parsingJobRequestDocuments
{
"description": "string",
"language": "ar",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListUri": "string",
"stopListUri": "string",
"synonymListUri": "string",
"minimumDocumentCount": 0,
"conceptModelUri": "string",
"outputTableNamePostfix": "string",
"enableSpellChecking": false,
"overrideListUri": "string",
"caslibUri": "string",
"documents": [
"string"
],
"version": 0
}
Job Request for Documents in the Request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Request for Documents in the Request | any | false | none | Indicates a request to create a parsing job from inline documents. This is the application/vnd.sas.text.parsing.job.request.documents media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | baseParsingJobRequest | false | none | Indicates the common properties that can be specified for a job request. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» caslibUri | string | true | none | Indicates the URI to a caslib in which data is stored. |
» documents | [string] | true | none | Indicates the text documents to parse. These documents are identified in the order in which they are specified to the API, starting from 1 and proceeding sequentially. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
parsingJob
{
"description": "string",
"language": "ar",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListUri": "string",
"stopListUri": "string",
"synonymListUri": "string",
"minimumDocumentCount": 0,
"conceptModelUri": "string",
"outputTableNamePostfix": "string",
"enableSpellChecking": false,
"overrideListUri": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
Parsing Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Parsing Job | any | false | none | Indicates a parsing job. This is the application/vnd.sas.text.parsing.job media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | parsingJobRequest | false | none | Indicates a request to create a text parsing job from a table. This is the application/vnd.sas.text.parsing.job.request media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id | string | true | none | Indicates the server-generated ID that uniquely defines a parse. |
» state | taskState | true | none | Indicates the state of the job. |
» creationTimeStamp | string(date-time) | true | none | Indicates a string that contains the datetime value when a job was created in format yyyy-mm-ddThh:mm:ssZ. |
» version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
parsingJobResults
{
"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",
"terms": [
{
"value": "string",
"role": "string",
"startOffset": 0,
"endOffset": 0,
"kept": true
}
],
"version": 0
}
]
}
Collection of Parsed Documents
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Parsed Documents | any | false | none | Indicates the output payload that represents the results of parsing. |
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 | [object] | false | none | The links that apply to the collection. |
»» 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. |
» 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 | [parsingJobResult] | true | none | Indicates the collection of results. Each entry corresponds to results for one input document. Results are linked to input documents by the id field. |
parsingJobResult
{
"id": "string",
"terms": [
{
"value": "string",
"role": "string",
"startOffset": 0,
"endOffset": 0,
"kept": true
}
],
"version": 0
}
Parsing Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Indicates the document identifier. This field links the input document to its result. If a table is specified, then this value corresponds to the documentIdVariable value. If documents are specified directly to the API, then this value corresponds to the order in which the documents were specified. The first document receives an ID value of 1, the second 2, and so on. |
terms | [term] | true | none | Indicates the text terms that were parsed from the input document. |
version | integer(int32) | true | none | Indicates the schema version number of a media type. This instance is version 1. |
term
{
"value": "string",
"role": "string",
"startOffset": 0,
"endOffset": 0,
"kept": true
}
Term
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
value | string | true | none | Indicates the text content of this term. |
role | string | true | none | Indicates the role (part of speech) for a term that was identified in the original document. |
startOffset | integer(int32) | true | none | Indicates the index where a term begins relative to the original document. |
endOffset | integer(int32) | true | none | Indicates the index where a term ends relative to the original document. |
kept | boolean | true | none | Indicates a flag that specifies whether a term was kept. |
parsingJobs
{
"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": [
{
"description": "string",
"language": "ar",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListUri": "string",
"stopListUri": "string",
"synonymListUri": "string",
"minimumDocumentCount": 0,
"conceptModelUri": "string",
"outputTableNamePostfix": "string",
"enableSpellChecking": false,
"overrideListUri": "string",
"inputUri": "string",
"documentIdVariable": "string",
"textVariable": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Collection of Parses
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Parses | any | false | none | This is a collection of parses. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | parsingJobResults | 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 | [parsingJob] | false | none | Array containing parses. |
logLineCollection
{
"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": 1,
"type": "normal",
"line": "string"
}
]
}
Collection of Log Lines
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Collection of Log Lines | any | false | none | Indicates a collection of lines from the log file. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | parsingJobResults | 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 | [any] | true | none | none |
»» Log Line | object | false | none | A single line in a log. This is the application/vnd.sas.compute.log.line media type. |
»»» version | integer(int32) | true | none | The version number of the Log Line (logLine) representation. This is version 1. |
»»» type | string | true | none | The line entry classification. |
»»» line | string | true | none | The line of text without the type (classification) prefix marker. |
Enumerated Values
Property | Value |
---|---|
type | normal |
type | highlighted |
type | source |
type | title |
type | byline |
type | footnote |
type | error |
type | warning |
type | note |
type | message |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.text.parsing.job.request+json
The application/vnd.sas.text.parsing.job.request
media type represents a request to start a text parsing job that processes a table
as input.
This is described by parsingJobRequest.
{
"description": "My table request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text",
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList"
}
application/vnd.sas.text.parsing.job.request.documents+json
The application/vnd.sas.text.parsing.job.request.documents
media type represents a request to start a text parsing job that processes
the documents that are provided in the request payload.
This is described by parsingJobRequestDocuments.
{
"description": "My inline document request",
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"startListlUri": "/casManagement/servers/cas/caslibs/lib/tables/startList",
"stopListlUri": "/casManagement/servers/cas/caslibs/lib/tables/stopList",
"synonymListlUri": "/casManagement/servers/cas/caslibs/lib/tables/synonymList",
"minimumDocumentCount": 10,
"conceptModellUri": "/casManagement/servers/cas/caslibs/lib/tables/conceptModel",
"outputTableNamePostfix": "-TMP",
"caslibUri": "/casManagement/servers/cas/caslibs/lib",
"documents": ["This text to parse.", "This additional document to parse."],
"enableSpellChecking": false,
"overrideListUri": "/casManagement/servers/cas/caslibs/lib/tables/overrideList"
}
application/vnd.sas.text.parsing.job+json
The application/vnd.sas.text.parsing.job
media type represents a job that is created to parse natural language text. Make the job
process a CAS table by using the application/vnd.sas.text.parsing.job.request
media type, or make the job
process documents that are loaded directly to the service by using the application/vnd.sas.text.parsing.job.request.documents
media type.
This is described by parsingJob.
{
"version": 2,
"language": "en",
"includeStandardEntities": false,
"includeNounGroups": true,
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "reviewbody",
"enableSpellChecking": false,
"id": "f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"state": "completed",
"creationTimeStamp": "2017-09-08T19:26:42.472Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"uri": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"type": "application/vnd.sas.text.parsing.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"uri": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9"
},
{
"method": "GET",
"rel": "state",
"href": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/state",
"uri": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/log",
"uri": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/results",
"uri": "/parsing/jobs/f0250e89-5475-4de5-bddf-1f78b3a3a4f9/results",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.parsing.job.result"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
application/vnd.sas.text.parsing.job.result+json
The application/vnd.sas.text.parsing.job.result
media type represents a parsed document. The document might have come
from a table, or the document might have been uploaded directly into the service, depending on how you generated the results. The only property of interest in the result is the terms
collection, which is a collection of application/vnd.sas.text.parsing.term
objects.
This is described by parsingJobResult.
{
"version": 1,
"id": "r1",
"terms": [
{
"value": "very",
"role": "ADV",
"startOffset": 92,
"endOffset": 95,
"kept": true
},
{
"value": "refurbished",
"role": "V",
"startOffset": 12,
"endOffset": 22,
"kept": true
},
{
"value": "input",
"role": "PN",
"startOffset": 29,
"endOffset": 34,
"kept": true
},
{
"value": "price",
"role": "N",
"startOffset": 117,
"endOffset": 121,
"kept": true
},
{
"value": "price",
"role": "N",
"startOffset": 117,
"endOffset": 121,
"kept": true
},
{
"value": "works",
"role": "V",
"startOffset": 75,
"endOffset": 79,
"kept": true
},
{
"value": "perfectly",
"role": "ADV",
"startOffset": 81,
"endOffset": 89,
"kept": true
},
{
"value": "good",
"role": "A",
"startOffset": 97,
"endOffset": 100,
"kept": true
},
{
"value": "good",
"role": "A",
"startOffset": 97,
"endOffset": 100,
"kept": true
},
{
"value": "brand new",
"role": "A",
"startOffset": 61,
"endOffset": 69,
"kept": true
},
{
"value": "bought",
"role": "V",
"startOffset": 2,
"endOffset": 7,
"kept": true
},
{
"value": "system",
"role": "N",
"startOffset": 51,
"endOffset": 56,
"kept": true
},
{
"value": "system",
"role": "N",
"startOffset": 102,
"endOffset": 107,
"kept": true
},
{
"value": "system",
"role": "N",
"startOffset": 51,
"endOffset": 56,
"kept": true
},
{
"value": "system",
"role": "N",
"startOffset": 102,
"endOffset": 107,
"kept": true
}
]
}
application/vnd.sas.text.parsing.term+json
The application/vnd.sas.text.parsing.term
media type represents a term that is found in a document. A term typically contains role
information and the starting and ending offsets that are used to locate the term within the document text.
This is described by term.
{
"value": "system",
"role": "N",
"startOffset": 102,
"endOffset": 107,
"kept": true
}
application/vnd.sas.api
Contains top-level links for an API. See application/vnd.sas.api
.
application/vnd.sas.collection
Contains a paginated, filterable, sortable collection of resource representations.
See application/vnd.sas.collection
.
application/vnd.sas.error
Contains a detailed description of an error. See application/vnd.sas.error
.
application/vnd.sas.compute.log.line
Contains a single line from a log file. For this service, the log is generated from the execution of a job. See application/vnd.sas.compute.log.line
.
Resource Relationships
The diagram below shows the relationships between the resources in this API.
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
The GET /
response includes these links.
Relation | Method | Description |
---|---|---|
jobs | GET | Returns the first page of the collection of jobs. URI: /jobs Response type: application/vnd.sas.collection Response item type: application/vnd.sas.text.parsing.job |
startParsing | POST | Submits a new parsing job for execution. URI: /jobs Request type: application/vnd.sas.text.parsing.job.request or application/vnd.sas.text.parsing.job.request.documents . Response type: application/vnd.sas.text.parsing.job |
Jobs
Path: /jobs
This API provides collections of jobs.
Members of the /jobs
collection are job resources, /job/{jobId}
. (See below.)
Links
The GET
operation on this path returns a application/vnd.sas.collection
.
This collection response includes these links.
Relation | Method | Description |
---|---|---|
self | GET | Returns the current page from the collection. |
collection | GET | Returns the first page of the collection without the 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. |
up | GET | Returns the parent resource. |
Sorting and Filtering
This collection can be sorted and filtered by using the ?sortBy=
and ?filter=
query parameters.
Filtering and sorting uses these members of the Job resource:
id
state
creationTimeStamp
Job
Path: /jobs/{jobId}
A specific job resource.
A job resource has these link relations in the appication/vnd.sas.text.parsing.job
representation:
Link Relations
Relation | Method | Description |
---|---|---|
self | GET | Gets the job itself. URI: /jobs/{jobId} Response type: application/vnd.sas.text.parsing.job |
delete | DELETE | Deletes the job. URI: /jobs/{jobId} |
state | GET | Gets the job state. URI: /jobs/{jobId}/state Response type: text/plain |
cancel | PUT | Cancels the job.1 URI: /jobs/{jobId}/state?value=canceled |
results | GET | Gets the job results.2 URI: /jobs/{jobId}/results Response type: application/vnd.sas.text.parsing.job.results |
errors | GET | Gets any errors associated with the job.3 URI: /jobs/{jobId}/errors Response type: application/vnd.sas.error |
log | GET | Gets the log associated with the job. URI: /jobs/{jobId}/log Response type: text/plain or application/json |
caslib | GET | Gets the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
1 - Only available when this job's state is 'pending' or 'running'.
2 - Only available when this job's state is 'completed'.
3 - Only available when this job's state is 'failed' or 'canceled'.
Job Results
Path: /jobs/{jobId}/results
The result from parsing for a specific job. This path returns a collection of
application.vnd.sas.parsing.job.result
objects.
Links
The GET
operation on this path returns an application/vnd.sas.collection
.
This collection response includes these links.
Relation | Method | Description |
---|---|---|
self | GET | Returns the current page from the collection. |
collection | GET | Returns the first page of the collection without the 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. |
up | GET | Returns the parent resource. |
caslib | GET | Gets the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
positionTable | GET | Gets the backing position table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
parentTable | GET | Gets the backing parent table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
childrenTable | GET | Gets the backing children table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
termsTable | GET | Gets the backing terms table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
configurationTable | GET | Gets the backing configuration table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
svdTable | GET | Gets the backing SVD table for the results URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
Topics
Base URLs:
- https://example.com/topics
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 Topics API creates topics (statistically generated categories) from text documents using the output of the Text Parsing API. This API is deprecated and will be removed in a future release.
Usage Notes
Overview
Topics are statistically generated categories. You create the name of a topic using the top-level terms in the topic such as "wii, nintendo, mario, gamecube, zelda."
The Topics API takes two tables as inputs: - a parent table that provides a term or document matrix - a term table
Note that all table URI parameters should use the following form of values: "/casManagement/servers/{serverName}/caslibs/{caslibName}/tables/{tableName}". Refer to examples with multiple URI parameters.
Typically, you produce these tables using the Text Parsing API. The names of two tables that contain the topics and the topic terms are the output for the API.
This API uses an asynchronous execution model. The client creates a topics job that runs in the background after the CREATE operation returns. The API provides resource endpoints for checking the state of the request. After this completes, results are retrieved using either the /results
endpoint on the job or by interacting with the result table directly using another SAS service such as the CAS Management service.
Terminology
job
a container for an asynchronous operation. A job supports a number of different operations such as checking a state or canceling an operation. All topics operations are performed asynchronously.
library
a container for inputs and outputs when you use CAS. The Topics API and other APIs such as the Categorization API use a library to locate input data and store output tables that they create.
table
an input to and output from topics that you generate.
topic
a set of terms, each of which has an associated weight. The top-level terms provide the topic label.
Error Codes
HTTP Status Code | Error Code | Description |
---|---|---|
400 | 71100 | You can specify either topicCount or maximumTopicCount, not both. |
400 | 71101 | The parent, terms, and configuration tables must reside in the same library if you specify them. |
400 | 71205 | The specified state value is not a valid state. |
400 | 71206 | The specified state value is not valid. Only the 'canceled' state is permitted. |
400 | 71212 | The specified paging parameters (start or limit) are not valid. |
404 | 71200 | The specified job ID could not be found. |
404 | 71202 | Results are not yet available because the job is still running. |
404 | 71203 | Results are not available because the job was canceled. |
404 | 71204 | Results are not available because the job failed. More information might be available from the /errors endpoint. |
404 | 71210 | The specified CAS library is not valid. No CAS library exists at the requested path. |
404 | 71211 | The specified URI is not valid. It does not exist at the requested path. |
409 | 71201 | You must cancel the job before you can delete it. |
409 | 71207 | You cannot cancel the job because it has already completed. |
500 | 71208 | The results could not be retrieved. |
500 | 71209 | The specified data could not be saved. |
Operations
Root
Contains the operations for the root resource of this API.
Get API resource links
Code samples
# You can also use wget
curl -X GET https://example.com/topics/ \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.api+json'
const headers = {
'Accept':'application/vnd.sas.api+json'
};
fetch('https://example.com/topics/',
{
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/topics/', 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/topics/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Returns a list of links to the top-level resources in this API.
Example responses
The request succeeded. The collection of link objects is available.
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "POST",
"rel": "startTopics",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.text.topics.job.request",
"responseType": "application/vnd.sas.text.topics.job"
}
]
}
{
"version": 1,
"links": [
{
"method": "GET",
"rel": "jobs",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "POST",
"rel": "startTopics",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.text.topics.job.request",
"responseType": "application/vnd.sas.text.topics.job"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The collection of link objects is available. | 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 | [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. |
Get headers for the API
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /
Retrieves headers for the API. It can also be used to check whether the service that the API provides is available.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The API links are available. | None |
Jobs
Operations that are related to jobs.
Get a list of jobs
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/topics/jobs',
{
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/topics/jobs', 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/topics/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs
Returns a collection of jobs that the server has processed or is currently processing for the current user. If no such jobs exist, it returns an empty collection.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | The criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | The index of the first page to return. |
limit | query | integer(int32) | false | The maximum number of pages to return. |
sortBy | query | string(sort-criteria) | false | The criteria for sorting the collection. See Sorting in REST APIs. |
Example responses
The request succeeded. All current jobs are shown.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs?start=0&limit=10",
"uri": "/topics/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "GET",
"rel": "up",
"href": "/topics/",
"uri": "/topics/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.topics.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/topics/jobs",
"uri": "/topics/jobs",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs?start=0&limit=10",
"uri": "/topics/jobs?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.text.topics.job"
},
{
"method": "GET",
"rel": "up",
"href": "/topics/",
"uri": "/topics/",
"type": "application/vnd.sas.api"
}
],
"name": "items",
"accept": "application/vnd.sas.text.topics.job",
"start": 0,
"count": 0,
"items": [],
"limit": 10,
"version": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. All current jobs are shown. | jobCollection |
Get the headers for the collection of jobs
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs
Retrieves the headers for the collection of jobs. It can also be used to check whether the collection exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
filter | query | string(string) | false | The criteria for filtering the collection. See Filtering in REST APIs. |
start | query | integer(int64) | false | The index of the first page to return. |
limit | query | integer(int32) | false | The maximum number of pages to return. |
sortBy | query | string(sort-criteria) | false | The criteria for sorting the collection. See Sorting in REST APIs. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The collection is available. | None |
Create job to extract topics
Code samples
# You can also use wget
curl -X POST https://example.com/topics/jobs \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Content-Type: application/vnd.sas.text.topics.job.request+json' \
-H 'Accept: application/vnd.sas.text.topics.job+json'
const inputBody = '{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}';
const headers = {
'Content-Type':'application/vnd.sas.text.topics.job.request+json',
'Accept':'application/vnd.sas.text.topics.job+json'
};
fetch('https://example.com/topics/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.text.topics.job.request+json',
'Accept': 'application/vnd.sas.text.topics.job+json'
}
r = requests.post('https://example.com/topics/jobs', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/vnd.sas.text.topics.job.request+json"},
"Accept": []string{"application/vnd.sas.text.topics.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://example.com/topics/jobs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /jobs
Extracts topics from the submitted data.
Body parameter
{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas-shared-default/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | jobRequest | true | The text to analyze. |
Example responses
Accepted for processing.
{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"id": "20294d2f-0199-4455-9e6f-1f00785085fe",
"state": "pending",
"creationTimeStamp": "2022-03-16T18:04:37.504Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"type": "application/vnd.sas.text.topics.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe"
},
{
"method": "GET",
"rel": "state",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/log",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state?value=canceled",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"id": "20294d2f-0199-4455-9e6f-1f00785085fe",
"state": "pending",
"creationTimeStamp": "2022-03-16T18:04:37.504Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"type": "application/vnd.sas.text.topics.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe"
},
{
"method": "GET",
"rel": "state",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/log",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/log",
"type": "text/plain"
},
{
"method": "PUT",
"rel": "cancel",
"href": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state?value=canceled",
"uri": "/topics/jobs/20294d2f-0199-4455-9e6f-1f00785085fe/state?value=canceled",
"responseType": "text/plain"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
The request was not valid because the specified request payload was not valid. See the response for details.
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: ac392cd15d8b50a2",
"path: /topics/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
{
"errorCode": 0,
"message": "The request body was missing or invalid.",
"details": [
"traceId: ac392cd15d8b50a2",
"path: /topics/jobs"
],
"links": [],
"version": 2,
"httpStatusCode": 400
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Accepted for processing. | job |
400 | Bad Request | The request was not valid because the specified request payload was not valid. See the response for details. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get a specific job
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.text.topics.job+json'
const headers = {
'Accept':'application/vnd.sas.text.topics.job+json'
};
fetch('https://example.com/topics/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.text.topics.job+json'
}
r = requests.get('https://example.com/topics/jobs/{jobId}', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.text.topics.job+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/topics/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}
Returns current information about a job that was submitted to the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job to look up. |
Example responses
The request succeeded. Information about the job is available.
{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"id": "2e7a7e30-35b8-46ce-bd31-69d2da894231",
"state": "failed",
"creationTimeStamp": "2022-03-16T18:08:58.322Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"type": "application/vnd.sas.text.topics.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231"
},
{
"method": "GET",
"rel": "state",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/state",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/log",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/errors",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
{
"version": 1,
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"id": "2e7a7e30-35b8-46ce-bd31-69d2da894231",
"state": "failed",
"creationTimeStamp": "2022-03-16T18:08:58.322Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"type": "application/vnd.sas.text.topics.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231"
},
{
"method": "GET",
"rel": "state",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/state",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/log",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "errors",
"href": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/errors",
"uri": "/topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894231/errors",
"type": "application/vnd.sas.error"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
No results exist. The specified ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"2e7a7e30-35b8-46ce-bd31-69d2da894232\" could not be found.",
"details": [
"traceId: 07f521720d063d97",
"path: /topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894232"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"2e7a7e30-35b8-46ce-bd31-69d2da894232\" could not be found.",
"details": [
"traceId: 07f521720d063d97",
"path: /topics/jobs/2e7a7e30-35b8-46ce-bd31-69d2da894232"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Information about the job is available. | job |
404 | Not Found | No results exist. The specified ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for a specific job
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs/{jobId}
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs/{jobId}',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs/{jobId}')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}
Retrieves the headers for a specific job. It can also be used to check whether the job exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job to look up. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Information about the job is available. | None |
404 | Not Found | No results exist. The specified job ID was not found. | None |
Delete the specified job from the server
Code samples
# You can also use wget
curl -X DELETE https://example.com/topics/jobs/{jobId} \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: */*'
const headers = {
'Accept':'*/*'
};
fetch('https://example.com/topics/jobs/{jobId}',
{
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/topics/jobs/{jobId}', 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/topics/jobs/{jobId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /jobs/{jobId}
Deletes the specified request by "id". If the job has not yet completed, the operation is canceled, and the job data and any output is cleared from the server.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job to look up. |
Example responses
No results exist. The specified job ID was not found.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The job was successfully deleted. | None |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the job state
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId}/state \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/topics/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/topics/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/topics/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/state
Retrieves the state of an existing job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Example responses
The request succeeded. The current job state is available.
"completed"
"failed"
No results exist. The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.","details":["traceId: b68254d245d05a27","path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | taskState |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for the state of a job
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs/{jobId}/state
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs/{jobId}/state',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs/{jobId}/state')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/state
Retrieves the headers for the state of an existing job. It can also be used to check whether the state exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The current job state is available. | None |
404 | Not Found | No results exist. The specified job ID was not found. | None |
Modify the state of an existing job
Code samples
# You can also use wget
curl -X PUT https://example.com/topics/jobs/{jobId}/state?value=canceled \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/topics/jobs/{jobId}/state?value=canceled',
{
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/topics/jobs/{jobId}/state', params={
'value': 'canceled'
}, 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/topics/jobs/{jobId}/state", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /jobs/{jobId}/state
Modifies the state of an existing job. This endpoint is used to cancel a running job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
value | query | string | true | The value to which the state of this topic was changed. |
Enumerated Values
Parameter | Value |
---|---|
value | canceled |
Example responses
The request succeeded. The state was successfully updated. See the response for the updated state.
"canceled"
The specified state value was not valid.
{"errorCode":71205,"message":"Invalid state value \"cancele\" specified.","details":["traceId: 40654b06ab1b4eac","path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/state"],"links":[],"version":2,"httpStatusCode":400}
No results exist. The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.","details":["traceId: cf86c51113eb0315","path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/state"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The state was successfully updated. See the response for the updated state. | taskState |
400 | Bad Request | The specified state value was not valid. | Inline |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 400
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the results of a job
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId}/results \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/topics/jobs/{jobId}/results',
{
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/topics/jobs/{jobId}/results', 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/topics/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/results
Retrieves the results of a job. This endpoint is available only when the job state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job for which results are retrieved. |
start | query | integer(int64) | false | The index of the first page to return. |
limit | query | integer(int32) | false | The maximum number of pages to return. |
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",
"termCutOff": 0,
"termCount": 0,
"documentCutOff": 0,
"documentCount": 0,
"version": 0
}
]
}
No results exist. More information might be available through the /jobs/{jobId} endpoint.'
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: cdecd8ae2fa17159",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71204,
"message": "The job failed. Results are not available.",
"details": [
"traceId: cdecd8ae2fa17159",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/results"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job results are available. | jobResult |
404 | Not Found | No results exist. More information might be available through the /jobs/{jobId} endpoint.' | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for the job results
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs/{jobId}/results
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs/{jobId}/results',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs/{jobId}/results')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs/{jobId}/results", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/results
Retrieves the headers for the job results. It can also be used to check whether results exist. This endpoint is available only when the job state is completed
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job for which results are retrieved. |
start | query | integer(int64) | false | The index of the first page to return. |
limit | query | integer(int32) | false | The maximum number of pages to return. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job results are available. | None |
404 | Not Found | No results exist. More information might be available through the /jobs/{jobId} endpoint. | None |
Get topics errors
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId}/errors \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.error+json'
const headers = {
'Accept':'application/vnd.sas.error+json'
};
fetch('https://example.com/topics/jobs/{jobId}/errors',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/vnd.sas.error+json'
}
r = requests.get('https://example.com/topics/jobs/{jobId}/errors', headers = headers)
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/vnd.sas.error+json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://example.com/topics/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/errors
Retrieves any errors that resulted from a job. The response might contain multiple errors through the nested errors
array member. This endpoint is available only when the job state is failed
. It is best accessed through the errors
link from the job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Example responses
The request succeeded. Job errors exist.
{
"errorCode": 2710120,
"message": "com.sas.cas.CASException: The caslib 'lib' does not exist in this session. (severity=2 reason=0 statusCode=2710120 CASLIB_NOT_FOUND)\n5 ERROR: The caslib 'lib' does not exist in this session.\n5 ERROR: The action stopped due to errors.\ndebug=0x887ff878:TKCASTAB_CASLIB_NOTFOUND",
"details": [
"ERROR: The caslib 'lib' does not exist in this session.",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560",
"type": "application/vnd.sas.text.topics.job"
}
],
"version": 2,
"httpStatusCode": 0
}
{
"errorCode": 2710120,
"message": "com.sas.cas.CASException: The caslib 'lib' does not exist in this session. (severity=2 reason=0 statusCode=2710120 CASLIB_NOT_FOUND)\n5 ERROR: The caslib 'lib' does not exist in this session.\n5 ERROR: The action stopped due to errors.\ndebug=0x887ff878:TKCASTAB_CASLIB_NOTFOUND",
"details": [
"ERROR: The caslib 'lib' does not exist in this session.",
"ERROR: The action stopped due to errors."
],
"links": [
{
"method": "GET",
"rel": "up",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560",
"type": "application/vnd.sas.text.topics.job"
}
],
"version": 2,
"httpStatusCode": 0
}
No results exist. The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.",
"details": [
"traceId: 2b68e6ab1fb5deb4",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.",
"details": [
"traceId: 2b68e6ab1fb5deb4",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/errors"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Job errors exist. | Inline |
204 | No Content | The job ID was found, but there are no errors for this job. | None |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 200
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for the job errors
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs/{jobId}/errors
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs/{jobId}/errors',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs/{jobId}/errors')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs/{jobId}/errors", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/errors
Retrieves the headers for the job errors. It can also be used to check whether errors exist.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. Job errors exist. | None |
404 | Not Found | No results exist. The specified job ID was not found. | None |
Get the log for a job as plain text
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId}/log \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: text/plain'
const headers = {
'Accept':'text/plain'
};
fetch('https://example.com/topics/jobs/{jobId}/log',
{
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/topics/jobs/{jobId}/log', 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/topics/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log
Retrieves the raw log from this job.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Example responses
The request succeeded. The job log is available.
"2022-03-16T14:13:42.810 INFO c.s.t.t.t.TopicsTask - [JOB_STARTING_EXECUTION] Starting job execution. 2022-03-16T14:13:42.839 INFO c.s.t.t.t.TopicsTask - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570 2022-03-16T14:13:42.878 INFO c.s.t.t.t.TopicsTask - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table. 2022-03-16T14:13:43.440 ERROR c.s.t.t.t.TopicsTask - ERROR: The caslib 'lib' does not exist in this session. 2022-03-16T14:13:43.441 ERROR c.s.t.t.t.TopicsTask - ERROR: The action stopped due to errors."
No results exist. The specified job ID was not found.
{"errorCode":71200,"message":"The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.","details":["traceId: 65a6c40cda1249f3","path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/log"],"links":[],"version":2,"httpStatusCode":404}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job log is available. | string |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Get the headers for the job log
Code samples
# You can also use wget
curl -X HEAD https://example.com/topics/jobs/{jobId}/log
-H 'Authorization: Bearer <access-token-goes-here>' \
fetch('https://example.com/topics/jobs/{jobId}/log',
{
method: 'HEAD'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.head('https://example.com/topics/jobs/{jobId}/log')
print(r.json())
package main
import (
"bytes"
"net/http"
)
func main() {
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("HEAD", "https://example.com/topics/jobs/{jobId}/log", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
HEAD /jobs/{jobId}/log
Retrieves the headers for the log from this job. It can also be used to check whether the log exists.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job log is available. | None |
404 | Not Found | No results exist. The specified ID was not found. | None |
Get log for a job as log lines
Code samples
# You can also use wget
curl -X GET https://example.com/topics/jobs/{jobId}/log#collection \
-H 'Authorization: Bearer <access-token-goes-here>' \
-H 'Accept: application/vnd.sas.collection+json'
const headers = {
'Accept':'application/vnd.sas.collection+json'
};
fetch('https://example.com/topics/jobs/{jobId}/log#collection',
{
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/topics/jobs/{jobId}/log#collection', 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/topics/jobs/{jobId}/log#collection", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /jobs/{jobId}/log#collection
Retrieves the log from this job, formatted as a collection of application/vnd.sas.compute.log.line
objects.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | The ID of the job. |
start | query | integer(int64) | false | The index of the first page to return. |
limit | query | integer(int32) | false | The maximum number of pages to return. |
Example responses
The request succeeded. The job log is available.
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log?start=0&limit=10",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/",
"type": "application/vnd.sas.text.topics.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 5,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.810 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.839 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.878 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "ERROR: 2022-03-16T14:13:43.440 - ERROR: The caslib 'lib' does not exist in this session.",
"type": "error"
},
{
"version": 1,
"line": "ERROR: 2022-03-16T14:13:43.441 - ERROR: The action stopped due to errors.",
"type": "error"
}
],
"limit": 10,
"version": 2
}
{
"links": [
{
"method": "GET",
"rel": "collection",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log?start=0&limit=10",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/log?start=0&limit=10",
"type": "application/vnd.sas.collection",
"itemType": "application/vnd.sas.compute.log.line"
},
{
"method": "GET",
"rel": "up",
"href": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/",
"uri": "/topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318560/",
"type": "application/vnd.sas.text.topics.job"
}
],
"name": "items",
"accept": "application/vnd.sas.compute.log.line",
"start": 0,
"count": 5,
"items": [
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.810 - [JOB_STARTING_EXECUTION] Starting job execution.",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.839 - [CAS_RUNNING_ON_SERVER] Running on CAS server jkh-testingtx.fbi.sashq-r.openstack.sas.com:5,570",
"type": "note"
},
{
"version": 1,
"line": "NOTE: 2022-03-16T14:13:42.878 - [CAS_SESSION_TABLE_CHECK] Checking for the existence of a session table.",
"type": "note"
},
{
"version": 1,
"line": "ERROR: 2022-03-16T14:13:43.440 - ERROR: The caslib 'lib' does not exist in this session.",
"type": "error"
},
{
"version": 1,
"line": "ERROR: 2022-03-16T14:13:43.441 - ERROR: The action stopped due to errors.",
"type": "error"
}
],
"limit": 10,
"version": 2
}
No results exist. The specified job ID was not found.
{
"errorCode": 71200,
"message": "The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.",
"details": [
"traceId: ef77a8ab7dc3aaa8",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
{
"errorCode": 71200,
"message": "The job with id \"5c1c6e9c-9a41-4c72-b98f-45eaaa318561\" could not be found.",
"details": [
"traceId: ef77a8ab7dc3aaa8",
"path: /topics/jobs/5c1c6e9c-9a41-4c72-b98f-45eaaa318561/log"
],
"links": [],
"version": 2,
"httpStatusCode": 404
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The request succeeded. The job log is available. | logLineCollection |
404 | Not Found | No results exist. The specified job ID was not found. | Inline |
Response Schema
Status Code 404
Error
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 | [#/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema] | false | none | Any additional errors that occurred. |
»» Error | #/paths/~1jobs/post/responses/400/content/application~1vnd.sas.text.topics.job%2Bjson/schema | false | none | The representation of an error. |
» links | [link] | false | none | The links that apply to the error. |
»» 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. |
» version | integer | true | none | The version number of the error representation. This representation is version 2. |
Schemas
taskState
"pending"
Job State
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job State | string | false | none | The state of the job. |
Enumerated Values
Property | Value |
---|---|
Job State | pending |
Job State | running |
Job State | completed |
Job State | canceled |
Job State | failed |
jobRequest
{
"description": "string",
"parentUri": "string",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "string",
"topicCount": 1,
"maximumTopicCount": 2,
"termDensityMultiple": 0,
"documentDensityMultiple": 0,
"outputTableNamePostfix": "string",
"configurationUri": "string",
"version": 0
}
Job Request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | false | none | A brief description that tells more about this job. |
parentUri | string | true | none | The URI of the input table that contains the input matrix. |
parentTermIdVariable | string | true | none | The name of the column in the parent table that contains the term ID. This defaults to the term ID column name (TERMNUM) on the parent table that the Text Parsing API generates. |
parentDocumentIdVariable | string | true | none | The name of the column in the parent table that contains the document ID. This defaults to the document ID column name (DOCUMENT) on the parent table that the Text Parsing API generates. |
termsUri | string | true | none | The URI of the input table that contains the terms. |
topicCount | integer(int32) | false | none | The number of topics that the API should generate. If this is not specified, a default value of 10 is used. |
maximumTopicCount | integer(int32) | false | none | The maximum number of topics that the API should generate. It could generate less. You cannot specify this parameter if you specify the topicCount parameter. |
termDensityMultiple | integer(int32) | false | none | Determines how many standard deviations above the mean to set the cutoff for topic terms. |
documentDensityMultiple | integer(int32) | false | none | Determines how many standard deviations above the mean to set the cutoff for topic documents. |
outputTableNamePostfix | string | false | none | The text to add at the end of the output table names. If this is left blank, the server generates it. |
configurationUri | string | false | none | The URI of the (optional) text parsing configuration table. If it is present, the job modifies the contents of the configuration table. |
version | integer(int32) | true | none | The schema version number of this media type. This representation is version 1. |
job
{
"description": "string",
"parentUri": "string",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "string",
"topicCount": 1,
"maximumTopicCount": 2,
"termDensityMultiple": 0,
"documentDensityMultiple": 0,
"outputTableNamePostfix": "string",
"configurationUri": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
Job
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job | any | false | none | A topics job. This is the application/vnd.sas.text.topics.job media type. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobRequest | false | none | A request to create a topics job. This is the application/vnd.sas.text.topics.job.request media type. |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» id | string | true | none | The ID that uniquely defines this topic. |
» state | taskState | true | none | The state of the job. |
» creationTimeStamp | string(date-time) | true | none | A string that contains the date and time value that the job originally created in the yyyy-mm-ddThh:mm:ssZ format. |
» version | integer(int32) | true | none | The schema version number of this media type. This representation is version 1. |
jobResult
{
"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",
"termCutOff": 0,
"termCount": 0,
"documentCutOff": 0,
"documentCount": 0,
"version": 0
}
]
}
Job Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Result | any | false | none | The output payload that represents the analysis results. |
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 | [object] | false | none | The links that apply to the collection. |
»» 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. |
» 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 | [topicsJobResult] | true | none | The collection of results, where each entry corresponds to the result for one input document. The 'id' field links the results to input documents. |
topicsJobResult
{
"id": "string",
"name": "string",
"termCutOff": 0,
"termCount": 0,
"documentCutOff": 0,
"documentCount": 0,
"version": 0
}
Topics Job Result
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | The document identifier to which this result belongs. |
name | string | true | none | The topic label, which typically includes the top five terms. |
termCutOff | number(double) | true | none | The cutoff value that is used to determine whether a term is included in the topic. |
termCount | integer(int32) | false | none | The number of terms in the topic. |
documentCutOff | number(double) | false | none | The cutoff value that is used to determine whether a document is included in the topic. |
documentCount | integer(int32) | false | none | The number of documents in the topic. |
version | integer(int32) | true | none | The schema version number of this media type. This representation is version 1. |
jobCollection
{
"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": [
{
"description": "string",
"parentUri": "string",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "string",
"topicCount": 1,
"maximumTopicCount": 2,
"termDensityMultiple": 0,
"documentDensityMultiple": 0,
"outputTableNamePostfix": "string",
"configurationUri": "string",
"version": 0,
"id": "string",
"state": "pending",
"creationTimeStamp": "2019-08-24T14:15:22Z"
}
]
}
Job Collection
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Job Collection | any | false | none | This is a collection of jobs. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobResult | 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 | [job] | false | none | The array that contains jobs. |
logLineCollection
{
"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": 1,
"type": "normal",
"line": "string"
}
]
}
Log Line Collection
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Log Line Collection | any | false | none | The collection of lines in the log file. |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | jobResult | 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 | [any] | true | none | none |
»» Log Line | object | false | none | A single line in a log. This is the application/vnd.sas.compute.log.line media type. |
»»» version | integer(int32) | true | none | The version number of the Log Line (logLine) representation. This is version 1. |
»»» type | string | true | none | The line entry classification. |
»»» line | string | true | none | The line of text without the type (classification) prefix marker. |
Enumerated Values
Property | Value |
---|---|
type | normal |
type | highlighted |
type | source |
type | title |
type | byline |
type | footnote |
type | error |
type | warning |
type | note |
type | message |
Examples
Github Examples
Detailed examples on how to use this API can be found on Github.
Media Type Samples
application/vnd.sas.text.topics.job.request+json
The vnd.sas.text.topics.job.request
media type represents a request to start a topics job that processes a table as input.
This is described by jobRequest.
{
"description": "My table request",
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/parent",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/terms",
"topicCount": 10,
"maximumTopicCount": 50,
"termDensityMultiple": 2,
"documentDensityMultiple": 1,
"outputTableNamePostfix": "-TMP",
"inputUri": "/casManagement/servers/cas/caslibs/lib/tables/input",
"documentIdVariable": "id",
"textVariable": "text"
}
application/vnd.sas.text.topics.job+json
The vnd.sas.text.topics.job
media type represents a job that was created to derive topics from text data. That job must have been started to process a CAS table using the application/vnd.sas.text.topics.job.request
media type.
This is described by job.
{
"version": 1,
"parentUri": "/casManagement/servers/cas/caslibs/lib/tables/input_PARSING_PARENT_OUT_f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"parentTermIdVariable": "_TERMNUM_",
"parentDocumentIdVariable": "_DOCUMENT_",
"termsUri": "/casManagement/servers/cas/caslibs/lib/tables/input_PARSING_TERMS_OUT_f0250e89-5475-4de5-bddf-1f78b3a3a4f9",
"id": "35794141-01a1-45e7-b760-24bef36d127a",
"state": "completed",
"creationTimeStamp": "2017-09-08T20:48:01.053Z",
"links": [
{
"method": "GET",
"rel": "self",
"href": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a",
"uri": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a",
"type": "application/vnd.sas.text.topics.job"
},
{
"method": "DELETE",
"rel": "delete",
"href": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a",
"uri": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a"
},
{
"method": "GET",
"rel": "state",
"href": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/state",
"uri": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/state",
"type": "text/plain"
},
{
"method": "GET",
"rel": "log",
"href": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/log",
"uri": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/log",
"type": "text/plain"
},
{
"method": "GET",
"rel": "results",
"href": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/results",
"uri": "/topics/jobs/35794141-01a1-45e7-b760-24bef36d127a/results",
"type": "application/vnd.sas.collection"
},
{
"method": "GET",
"rel": "caslib",
"href": "/casManagement/servers/cas/caslibs/lib",
"uri": "/casManagement/servers/cas/caslibs/lib",
"type": "application/vnd.sas.cas.caslib"
}
]
}
application/vnd.sas.text.topics.job.result+json
The vnd.sas.text.topics.job.result
media type represents the topics that are derived for a specific document.
This is described by topicsJobResult.
{
"version": 1,
"id": "2",
"name": "hdd, psp, slim, capable, +accessory",
"termCutOff": 0.031,
"numberOfTerms": 275,
"documentCutOff": 0.333,
"numberOfDocuments": 285
}
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.error
A detailed description of an error. See application/vnd.sas.error
.
application/vnd.sas.compute.log.line
A single line from a log file. For this API, executing a job creates the log. See application/vnd.sas.compute.log.line
.
Resource Relationships
This diagram shows the relationships among the resources in this API.
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
The GET /
response includes these links.
Relation | Method | Description |
---|---|---|
jobs | GET | Returns the first page of the collection of jobs. URI: /jobs Response type: application/vnd.sas.collection Response item type: application/vnd.sas.text.topics.job |
startTopics | POST | Submits a new topics job for execution. URI: /jobs Request type: application/vnd.sas.text.topics.job.request . Response type: application/vnd.sas.text.topics.job |
Jobs
Path: /jobs
This API provides collections of jobs.
Members of the /jobs
collection are job resources, /job/{jobId}
. (See below.)
Links
The GET
operation on this path returns a application/vnd.sas.collection
collection. This collection response includes the links in this table.
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. 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. |
up | GET | Returns the parent resource. |
Sorting and Filtering
You can sort and filter this collection using the ?sortBy=
and ?filter=
query parameters.
Sorting and filtering can use these members of the Job resource:
id
state
creationTimeStamp
Job
Path: /jobs/{jobId}
A specific job resource.
A job resource has the link relations that are described in this table in the appication/vnd.sas.text.topics.job
representation.
Link Relations
Relation | Method | Description |
---|---|---|
self | GET | Retrieves the job itself. URI: /jobs/{jobId} Response type: application/vnd.sas.text.topics.job |
delete | DELETE | Deletes the job. URI: /jobs/{jobId} |
state | GET | Retrieves the job state. URI: /jobs/{jobId}/state Response type: text/plain |
cancel | PUT | Cancels the job.1 URI: /jobs/{jobId}/state?value=canceled |
results | GET | Retrieves the job results.2 URI: /jobs/{jobId}/results Response type: application/vnd.sas.text.topics.job.results |
errors | GET | Retrieves any errors that are associated with the job.3 URI: /jobs/{jobId}/errors Response type: application/vnd.sas.error |
log | GET | Retrieves the log that is associated with the job. URI: /jobs/{jobId}/log Response type: text/plain or application/json |
caslib | GET | Retrieves the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
1 Available only when the job state is 'pending' or 'running'.
2 Available only when the job state is 'completed'.
3 Available only when the job state is 'failed' or 'canceled'.
Job Results
Path: /jobs/{jobId}/results
The results from a specific topics job. This path returns a collection of application.vnd.sas.topics.job.result
objects.
Links
The GET
operation on this path returns a application/vnd.sas.collection
collection. This collection response includes the links that are described in this table.
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. 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. |
up | GET | Returns the parent resource. |
caslib | GET | Retrieves the library for the results. URI: /casManagement/servers/{serverName}/caslibs/{caslib} Response type: application/vnd.sas.cas.caslib |
topicsTable | GET | Retrieves the backing table for topics results. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
termTopicsTable | GET | Retrieves the backing table that contains the terms for each topics result. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
documentProjectionsTable | GET | Retrieves the backing table for document projections. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |
wordProjectionsTable | GET | Retrieves the backing table for word projections. URI: /casManagement/servers/{serverName}/caslibs/{caslib}/tables/{tableName} Response type: application/vnd.sas.cas.table |