Importing unlabeled data

Request#

Endpoint#

PartValue
URLhttps://api.humanfirst.ai/v1alpha1/files/<NAMESPACE>/<CONVERSATION_SOURCE_ID>
MethodPOST
BodyMulti-part form data

Note: To find your namespace, see this. To find you conversation source ID, see this.

Request body#

The body is in multi-part form data with the following fields:

FieldTypeDescription
formatstringThe format of the exported data. See Data format
filebytesThe data to import.
Data format#
Numeric formatString formatDescription
1IMPORT_FORMAT_SIMPLE_CSVSimple CSV format
2IMPORT_FORMAT_UTTERANCES_TXTText file with one utterance per line
4IMPORT_FORMAT_HUMANFIRST_JSONHumanFirst JSON format

cURL example#

note

In the following example, the hf command line tool is used to fetch a valid access token. See how to install and configure it here.

To import unlabeled data into a data set using our JSON format, use the following cURL command:

curl -s -X POST \
-H 'Authorization: Bearer '(zia auth print-access-token) \
-F 'data=@/path/to/file.txt' \
-F 'format=IMPORT_FORMAT_UTTERANCES_TXT' \
'https://api.humanfirst.ai/v1alpha1/files/humanfirst/convsrc-E322D5YJVFE4PO4RVHMJJWUA'