Create a new Text Analytics data source
Use this request to create a new data source. In this release, you can only create new data sources of the type TextAnalytics.
To create data sources of the type TextAnalytics, you must have these two licenses activated:
-
Text Analytics (monthly text interactions) -93-530-7063
-
Organization Scoped Data sources
This POST request creates a new data source:
POST /wfo/api/em/recorder/v2/datasources
This request requires the Configure Data Sources user security privilege. This privilege is not tenant safe and cannot be used when using the "User Token" for authentication in a Multi-Tenant SaaS environment. Instead, use an "API Tenant Token" in a Multi-Tenant SaaS environment.
Request parameters
|
Type |
Name |
Description |
Schema |
Required |
|---|---|---|---|---|
|
Body |
data source |
The data source the user wants to create. In this release, you can only create a data source of the type "Text Analytics." |
True |
Request structure
|
Path |
Type |
Description |
Required |
|---|---|---|---|
|
data [] .type |
String |
Always has the value "DataSource" |
True |
|
data[] .attributes.name |
String |
The name of the data source. The maximum character length allowed for the name is 50 alphanumeric characters. The characters []<>"&!? are not allowed. |
True |
|
data[] .attributes.description |
String |
The description of the data source. The maximum character length allowed for the description is 200 alphanumeric characters. |
False |
|
data[] .attributes.type |
String |
The type of the data source. In this version of the API, TextAnalytics is the only supported type. |
True |
|
data[] .attributes.subType |
String |
The subtype of the data source. Supported values are TextStore and TextProject. |
True |
|
data[] .attributes.parentid |
Number |
The numeric ID of the parent data source. |
True for data source of subtype TextStore |
|
data[] .attributes.organizationId |
Number |
The numeric ID of the organization that owns this data source. |
True for data source of subtype TextStore |
|
data[] .attributes.associatedRoles |
Number |
The numeric ID of server roles associated to the data source. |
True |
Request example
POST http://10.100.200.90/wfo/api/em/recorder/v2/datasources
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
{
"data": [
{
"type": "DataSource",
"attributes": {
"name": "Text Store 1",
"description": "My first text store",
"type": "TextAnalytics",
"subType": "TextStore",
"parentId": "21",
"organizationId": -3001,
"associatedRoles": [ 678001, 678002 ]
}
]
}
}
Responses
This request can return these responses.
|
HTTP Status Code |
Detail |
Schema |
|---|---|---|
|
201 |
Returns the created data source in an array. |
|
|
400 |
DataSource is missing required information. |
|
|
409 |
Conflict Error. This response is returned when the data source cannot be created due to a conflict (for example, another data source exists with the same name). |
|
|
500 |
Internal Server Error |
Response structure
|
Path |
Type |
Description |
|---|---|---|
|
data [] .id |
Number |
The unique numeric ID of the data source. |
|
data [] .type |
String |
Always has the value "DataSource." |
|
data [] .attributes.name |
String |
The name of the data source. |
|
data [] .attributes.description |
String |
The description of the data source. |
|
data [] .attributes.type |
String |
The type of the data source. In this version of the API, TextAnalytics is the only supported value. |
|
data [] .attributes.subType |
String |
The subtype of the data source. Supported values are TextStore and TextProject. |
|
data [] .attributes.parentid |
Number |
The numeric Id of the parent data source. |
|
data [] .attributes.organizationId |
Number |
The numeric ID of the organization that owns this data source. |
|
data [] .attributes.externalId |
Number |
This attribute is not used in this release. |
|
data [] .attributes.associatedRoles |
Number |
The numeric ID of server roles that are associated to the data source. |
201 Response Example
Here is an example of a successful 201 response to this request.
{
"data": [
{
"id": "1002",
"type": "DataSource",
"attributes": {
"name": "Text Store 1",
"description": "My first text store",
"type": "TextAnalytics",
"subType": "TextStore",
"parentId": "21",
"organizationId": -3001,
"externalId": 5000550,
"associatedRoles": [ 678001, 678002 ]
}
]
}
}
Error responses
This request can return these error responses.
Examples of the error responses are shown below. The error responses include the following attributes:
-
status - The HTTP status code applicable to a problem, expressed as a string.
-
title - The Enterprise Manager error code title.
-
detail - A short description of the error.
Error response 400
{
"errors": [ {
"status" : "400",
"title" : "Missing Required Information",
"detail" : "Data Source name is missing"
}, {
"status" : "400",
"title" : "Missing Required Information",
"detail" : "Data Source type / subType is missing"
} ]
}
Error response 409
{
"errors": [ {
"status" : "409",
"title" : "Conflict Error",
"detail" : "Data Source name already exists"
} ]
}
Error response 500
{
"errors": [ {
"status" : "500",
"title" : "Internal Error",
"detail" : "Data Source operation failed due to internal error"
} ]
}