Using cURL to Test Your Send Requests

The command-line tool cURL (https://curl.se) uses a URL format to transfer data. Use cURL to test the format that you use for your REST API requests. It is available in most environments. Refer to third-party cURL documentation for details on the command line tool and library. Additionally, refer to Establishing a Connection for steps to retrieve required authentication resources to provide as header values.

cURL Examples

The following examples use cURL.

AI Summarization Example

The sample cURL command below demonstrates how to use the Call Summarization API to generate an AI-powered summary of a customer service conversation. It sends a POST request to the summarization endpoint, includes the required authentication headers, and provides a transcript of the customer interaction along with formatting instructions.

At a high level, the example request:
  • Calls the summarization endpoint by sending a POST request to /api/v1/aia/sg/call-summary/summaries, which is the API used to create new call summaries.
  • Authenticates the request, including both the bearer token and the auth-token header so the service can verify access. Be aware the headers include placeholder values that can be replaced with values applicable to your host and authentication resources.
  • Submits the conversation transcript. The JSON body includes a conversation ID, config ID, and the transcript text along with a timestamp. This is the content the AI processes for summarization.
  • Provides summarization instructions. The request specifies how the summary should be formatted, for example, short, paragraph style, and number of tags. Once submitted, the service processes the transcript, applies the configuration, and returns a generated summary along with topic tags.
curl --location "https://<gateway-host>/api/v1/aia/sg/call-summary/summaries" ^ 
 --header "Accept: application/json" ^ 
 --header "auth-token: <client-identifier>" ^ 
 --header "Content-Type: application/json" ^ 
 --header "Authorization: Bearer <your-auth-token>" ^ 
 --data "{ 
 "conversationId": "test-conv", 
 "configId": "c18bf8e5a4dca28cc5d02ae11acb9d2579a245ea889b4d52e6ce410c4c4d987d", 
 "conversations": [ 
 { 
 "tag": "conversation-tag-1", 
 "conversation": "Good morning! Thank you for calling UtilityCo...", 
 "metadata": { 
 "timestamp": 1738277827.401493 
 } 
 } 
 ], 
 "formatInstructions": { 
 "length": "short", 
 "format": "paragraph", 
 "section": "no_section", 
 "minTags": 1, 
 "maxTags": 3 
 } 
 }"