Apply RESTful API functionality to your content

The Restful API Caller component allows you to integrate AutoClassifier with any RESTful APIs (LLMs, AI Cloud Services, etc.) by enabling flexible endpoint configurations, request customizations, and API response management to facilitate efficient data transformation and metadata generation.

By integrating your own AI with AutoClassifier, you agree to the Upland AI Disclaimer. This disclaimer appears on all components with AI functionality in the administration portal.

Prerequisites

You must complete the following prerequisites before setting up the Restful API Caller component:

  • You must use a valid RESTful API and refer to the applicable documentation for usage instructions.

Limitations

Note the following limitations:

  • Only complete URLs are supported. For example, https://api.openai.com/v1/embeddings.

Configure the component

To configure your component, do the following:

  1. In the AutoClassifier administration portal, Add a new component to a new or existing pipeline.

  2. When adding your component, select Restful API Caller from the New Component list and provide a Name for your component.

  3. In the Endpoint URL field, enter the endpoint URL for your RESTful API.

  4. In the Request Headers field, enter the Key and Value for your RESTful API. You can click Add Header or Add Secure Header to add additional key-value pair request headers.

  5. In the Request Body field, enter the body for your desired request to your API. For example, the following prompt would translate the query from German to English:

    {
        "model": "gpt-4o-mini",
        "messages": [{"role": "user","content": "Translate the following German text into English. Provide only the translated word: Gesundheit"}],
        "temperature": 0.7    
    }
  6. When you are replacing the placeholder in the request body, the property must be a string type.
  7. In the Response Key Path field, you can specify the key path that you want to receive from the API response. For example, using the sample above, entering choices[0].message.content will return only the translation of the word "Gesundheit".

  8. In the Response Datatype field, select the data type that you expect to receive from the response from the drop-down menu.

  9. In the Output Type field, you can select either Single Valued or Multiple Valued.

  10. In the Output Metadata Name field, enter the property name to assign to the metadata that is generated by the component.

  11. Enable the Send Raw data as Metdata to return your API response as a property from the component.

  12. To verify if your API endpoint is valid, you can click Test Request. If valid, you will receive an "Api Endpoint hit succeeded" message and the response to your configured prompt will display in the Response field.

  13. Click Save.

Output details

The Restful API Caller returns the following metadata properties and values:

Property Description
Api_Response This property displays the full response that you received based on your Request Body specification.
<Output metadata name> This property displays the metadata that was generated by the Restful API Caller component. This name of this property is dependent on the Output Metadata Name that you specified in step 9.