Training
/dataitem/create
POST
https://ai.api.answerly.io/dataitem/create
Creates a data item (Also known as "data set") from your AI Training collections.
Request Body
APIKey
string
Required
Your API key. You can read more about how to get an API Key by clicking here.
dataItem.trainingId
string
Required
The ID of your training collection.
dataItem.type
string
Required
The type of the data item.
The following types are available:
The following types are available:
Website
GoogleSheet
GoogleDoc
Summary
YoutubeVideo
DOC
CSV
PDF
Webpage
Link
Picture
Video
QA
FacePop
Calendar
IFrame
dataItem.source
string
Required
The value you assign to this key should be based on the data item type.
Below is an explanation of what value to fill in for this key, corresponding to the type of data you are using.
Use an empty string as a value if you use a data item other than the ones from the list above.
Below is an explanation of what value to fill in for this key, corresponding to the type of data you are using.
Website
- The sitemap URL. GoogleSheet
- The URL of your Google Sheet. GoogleDoc
- The URL of your Google Doc. YoutubeVideo
- The URL to your youtube video. DOC
- The URL to your DOC file. CSV
- The URL to your CSV file. PDF
- The URL to your PDF file. Webpage
- The URL of your webpage. Link
- The URL of your link. Picture
- The URL of your picture. Video
- The URL to your video. QA
- List of questions, separated by new lines FacePop
- Your FacePop ID Calendar
- Your Calendar URL IFrame
- Your IFrame URL Use an empty string as a value if you use a data item other than the ones from the list above.
dataItem.content
string
Required
The value you assign to this key should be based on the data item type.
Below is an explanation of what value to fill in for this key, corresponding to the type of data you are using.
Use an empty string as a value if you use a data item other than the ones from the list above.
Below is an explanation of what value to fill in for this key, corresponding to the type of data you are using.
Summary
- The contents of your summary. Picture
- The description of the picture. Video
- The description of your video. QA
- The answer to your questions. Use an empty string as a value if you use a data item other than the ones from the list above.
dataItem.properties
object
Required
The value of this key should be an empty object unless you use the
QA
data type.
dataItem.properties.match
string
Required
ℹ️ Use this property only if you are creating a
QA
dataset.
broad
- Broad match. We use natural language processing to analyze the query and match against your question. exact
- Exact match. Your question will only match if the query is exactly as the question. curl --request POST \
--url https://ai.api.answerly.io/dataitem/create \
--header 'Content-Type: application/json' \
--data '{
"APIKey": "YOUR_API_KEY",
"dataItem": {
"trainingId": "YOUR_TRAINING_ID",
"type": "Website",
"source": "https://answerly.io/sitemap.xml",
"content": "",
"properties": {}
}
}'
Return (success)
status
boolean
A boolean indicating the success or failure of the request.
data
dataItem
A data item object.
{
"status": true,
"data": {
"id": "YOU_DATAITEM_ID",
"companyId": "YOUR_COMPANY_ID",
"trainingId": "YOUR_TRAINING_ID",
"type": "Website",
"source": "https://answerly.io/sitemap.xml",
"content": "",
"properties": {},
"embedData": {
"status": "embedding",
"comment": ""
},
"enabled": true,
"interactive": false,
"sync": {
"sync": false,
"lastSync": ""
},
"createdAt": "2023-11-08T13:34:42.083Z",
"updatedAt": "2023-11-08T13:34:42.083Z"
}
}
Return (failure)
status
boolean
A boolean indicating the success or failure of the request.
data
string
An error message returned by the server.
{
"status": false,
"data": "A training collection with that ID was not found"
}