Exporting intents

note

This section is about programmatically exporting intent data from custom applications. If you are looking to automate your workflows, our command line tool allow importing and exporting intents in various formats and can be easily added to custom scripts and continuous integration pipelines.

Request#

Endpoint#

PartValue
URLhttps://api.humanfirst.ai/v1alpha1/workspaces/<NAMESPACE>/<WORKSPACE_ID>/intents/export_http
MethodPOST
BodyJSON object
ResponseBytes of the selected format

Note: To find your namespace and the workspace id, see this.

Request body#

The complete specifications of the intent export request can be found in the API Reference section.

The request body is a JSON object with the following fields:

FieldTypeDescription
formatnumericThe format of the exported data. See Data format
format_optionsFormatOptionsOptions for the selected format.
Data format#

Specifies the format in which the intent data is going to be converted before exporting.

Numeric formatString formatDescription
1INTENTS_FORMAT_CSV_SIMPLE_INTENTSTwo-column csv formatted as text,intent_name - fields delimited by ""
2INTENTS_FORMAT_RASA_MARKDOWNRasa 1.0 NLU format
3INTENTS_FORMAT_RASA_YAMLRasa 2.0 NLU format
5INTENTS_FORMAT_DIALOGFLOW_ES_AGENTDialogflow agent export format
7INTENTS_FORMAT_HF_JSONHumanFirst JSON format
8INTENTS_FORMAT_COGNIGY_JSONCognigy intents JSON format
Format options#
FieldTypeDescription
hierarchicalIntentNameDisabledboolDisables intents hierarchy encoding in the intents name
hierarchicalDelimiterstringSpecifies the delimiter to use when encoding the hierarchy inside intent names
hierarchicalFollowupbool(Dialogflow only) Use intent hierarchy when encoding follow up intents

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 return export a workspace and its intents in our JSON format, use the following curl command:

curl -s -X POST \
-H 'Authorization: Bearer '(hf auth print-access-token) \
-d '{ "format": 7 }' \
https://api.humanfirst.ai/v1alpha1/workspaces/humanfirst/playbook-GTK76SAJL5B3XFLRMIA33I2E/intents/export_http