# How to use our API
# Architectural Overview
Integrate content automation into your system:
- upload your data or/and download your text through our REST API
- the AX NLG Cloud generates a text from data and your pre-configured instructions: every data object will be converted to one text
- you can retrieve the generated text from the API or define a webhook to which we can send your text when it is ready.
You authenticate with the API (documented in the API Reference (opens new window)).
id_token once and use it in all your processes until it almost expires. Then generate a new one. By generating a new
id_token the old one automatically expires.
# Uploading documents
Upload your documents to the appropriate collection. The upload process is briefly described in the Basic Chapter of the API Reference (opens new window) and documented in detail in the Description of documents in the API Reference (opens new window).
# Generating texts
To generate text you need to select one of three possible options:
- you press the Generate button on the website
- you activate automatic generation for the new data in your Collection
- you use the API to start a generation for a specific document or Collection. This is useful, for example, to refresh your text(s) using the same data or to update them with modified data. This is documented in the API Reference (opens new window)
# Receiving the generated texts
The generated text goes back to you. This can be done in three ways:
- setting up a webhook (opens new window)
- using the Direct API (opens new window)
- checking the API response until the text is generated and then retrieve it (API Reference for text delivery (opens new window))
We strongly recommend using a webhook unless you need real-time text production. In that case you should use our Direct API.
# Using Webhooks for receiving content
You set up a webhook and store it in the collection's settings, so that finished texts are sent there. You find the documentation about this in the API Reference (opens new window)
What you need
- your side of the data integration to get data in
- a working ruleset
- a collection in the cockpit
Setting up the Webhooks on the AX platform
- Go to Data Sources and into the corresponding collection
- Click on edit
- Enter your URL in the Webhook field and save your changes.
Now you will receive any updated content on this URL. Manually generate a text to verify your setup. Then set the checkbox "Autogenerate new documents" in the collection's settings to enable automatic generation and save the changes.
Setup the Webhook on your end
Only SSL Webhook targets are allowed. The request is cryptographically signed with a shared key, we recommend evaluating that signature. More information about the setup can be found in the chapter Webhook for receiving text of the API Reference (opens new window).
For a more in-depth introduction of the questions around API and the NLG Platform see the Webinar: "API for data and texts" (opens new window)