API

Nádia Dias Updated by Nádia Dias

API

As a platform that allows easy use of NLP in applications, the process of integrating Weni with external services is very simple!

In this article, you will learn how to integrate with the prediction API to access your intelligence through other systems via HTTP requests.

HTTP Request

Access your intelligence and go to the API tab.

To make an HTTP request to the prediction API, you will need the following information:

  • Protocol: The API uses the HTTP protocol.
  • URL: The base URL is the root URL of the API, meaning it is the initial address to access the available functionalities and resources. It's like the starting point to explore and interact with the API. https://nlp.bothub.it/v2/parse/
  • Header: This is the authorization token used to integrate with the intelligence. Every intelligence has a unique token, which must be provided in the request header.
  • POST Body: The POST Body is a part of the API request that contains the data sent to perform a specific task, such as user message information. It must be correctly formatted in .JSON so that the API can process the information properly. The Body should also contain the language and the text that the intelligence should predict.
  • Response: The response from an API is the reply that the API sends back to the client that made a request. It is like a message that the API sends back to the user, containing the requested information or indicating an error that occurred during request processing.

Code Generator

The code generator is a very useful tool that allows the user to simulate a request in the syntax of technologies like cURL, Python, and JavaScript. Select the language and the prediction text/message, and it will generate the request code in the chosen programming language.

After that, copy the generated example and start using your intelligence through the API!

How did we do?

Settings

Integrating Intelligence into a Project on the Weni Platform

Contact