HTTP Calls / API Calls
Overview
HttpCalls enable EDDI agents to integrate with external REST APIs, making EDDI a powerful orchestration layer that can combine conversational AI with traditional backend services. This is how agents can fetch real-time data, authenticate users, store information in external systems, or trigger business workflows.
Role in the Lifecycle
HttpCalls are lifecycle tasks that execute during the agent's processing pipeline:
User Input → Parser → Behavior Rules → HttpCalls → Output GenerationTypically, Behavior Rules decide when to make an API call by triggering an action like httpcall(weather-api), and the HttpCalls extension defines how to make that call.
Common Use Cases
Fetching external data: Weather, stock prices, product information, etc.
Authentication: OAuth flows, token validation, user verification
CRM Integration: Creating tickets, updating customer records, searching databases
Business workflows: Processing payments, sending notifications, triggering events
Multi-step APIs: First call gets auth token, second call uses it to access protected resources
Analytics: Sending conversation data to external analytics platforms
Self-modification: The "Agent Father" agent uses HttpCalls to create other agents via EDDI's own API
Key Features
Template-based: Use conversation memory in URLs, headers, and body (e.g.,
${context.userName})Response handling: Save JSON responses to memory for use in outputs or subsequent calls
Chaining: One HttpCall's response can be used in another HttpCall
Quick reply generation: Automatically create quick reply buttons from API response arrays
Property extraction: Extract specific values from responses and save them to conversation memory
Batch requests: Make multiple API calls by iterating over an array
Fire and forget: Optional asynchronous calls that don't wait for a response
HttpCalls Configuration
In this article we will talk about EDDI's httpCalls feature (calling other JSON APIs).
The httpCalls feature allows a Agent to consume 3rd party APIs and use the JSON response in another httpCall (for authentication or requesting a token for instance) or directly print the results in Agent's Output, this means, for example, you can call a weather API and use the JSON response in your Agent's output if the user asks about today's weather or the week's forecast!
We will emphasize the httpCall model and go through an example step by step, you can also download the example in Postman collection format and run the steps.
Model and API endpoint
Description
An httpCall is mainly composed from the targetServer array of httpCalls, the latter will have request where you put all details about your actual http request (method,path,headers, etc..) and postResponse where you can define what happens after the httpCall has been executed and a response has been received; such as quick replies by using qrBuildInstruction.
You can use ${memory.current.httpCalls.<responseObjectName>} to access your JSON object, so you can use it in output templating or in another httpCall, for example an httpCall will get the oAuth token and another httpCall will use in the http headers to authenticate to an API.
Description of the model
targetServerUrl
(String) root/context path of the httpCall (e.g http://example.com/api)
httpCall.saveResponse
(Boolean) whether to save the JSON response into ${memory.current.httpCalls}
httpCall.fireAndForget
(Boolean) whether to execute the request without waiting for a response to be returned, (useful for POST)
httpCall.responseObjectName
(String) name of the JSON object so it can be accessed from other httpCalls or outputsets.
httpCall.actions
(String) name of the output/behavior set mapped to this http call.
httpCall.preRequest.batchRequests.pathToTargetArray
(String) JSON path to the target array to be used as body of requests e.g: "memory.current.output"
httpCall.preRequest.batchRequests.iterationObjectName
(String) name of the variable to be used for each element of array found in pathToTargetArray
httpCall.request.path
(String) path in the targetServer of the httpCall (e.g /books)
httpCall.request.headers
(Array:<key, value> ) for each httpCall HTTP header
httpCall.request.queryParams
(Array: <key, value>) for each httpCall query parameter
httpCall.request.method
(String) HTTP Method of the httpCall (e.g GET,POST,etc...)
httpCall.request.contentType
(String) value of the contentType HTTP header of the httpCall
httpCall.request.body
(String) an escaped JSON object that goes in the HTTP Request body if needed.
httpCall.postResponse.qrBuildInstructions[].pathToTargetArray
(String) path to the array in your JSON response data.
httpCall.postResponse.qrBuildInstructions[].iterationObjectName
(String) a variable name that will point to the TargetArray.
httpCall.postResponse.qrBuildInstructions[].quickReplyValue
(String) Qute expression to use as a quickReply value.
httpCall.postResponse.qrBuildInstructions[].quickReplyExpressions
(String) expression to retrieve a property from iterationObjectName.
httpCall.postResponse.propertyInstructions.name
(String) name of property to be used in templating
httpCall.postResponse.propertyInstructions.value
(String) a static value can be set here if fromObjectPath is not defined.
httpCall.postResponse.propertyInstructions.scope
(String) Can be either :
step used for only for one user interaction
conversation for entire conversation and
longTerm for between conversations
httpCall.postResponse.propertyInstructions.fromObjectPath
(String) JSON path to the saved object e.g savedObjName.something.something
httpCall.postResponse.propertyInstructions.override
(Boolean) flag for override
httpCall.postResponse.propertyInstructions.httpCodeValidator.runOnHttpCode
(Array: <Integer> ) a list of http code that enables this property instruction e.g [200]
httpCall.postResponse.propertyInstructions.httpCodeValidator.skipOnHttpCode
(Array: <Integer>) list of http code that enables this property instruction e.g [500,501,400]
HttpCall API endpoints
POST
/httpcallsstore/httpcalls
http-call-model
N/A
GET
/httpcallsstore/httpcalls/descriptors
N/A
list of references to http-call-model
DELETE
/httpcallsstore/httpcalls/{id}
N/A
N/A
GET
/httpcallsstore/httpcalls/{id}
N/A
http-call-model
PUT
/httpcallsstore/httpcalls/{id}
http-call-model
N/A
GET
/httpcallsstore/httpcalls/{id}/currentversion
N/A
http-call-model
POST
/httpcallsstore/httpcalls/{id}/currentversion
http-call-model
N/A
httpCall Sample
Step by step example
We will do a step by step example from scratch (Agent creation to a simple conversation that uses httpCall)
For the sake of simplicity we will use a free weather API to fetch weather of cities by their names (api.openweathermap.org).
1 - Create regularDictionnary
More about regular dictionaries can be found here.
Request URL
POST http://localhost:7070/regulardictionarystore/regulardictionaries
Request Body
Response Body
no content
Response Code
201
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.regulardictionary/regulardictionarystore/regulardictionaries/<id>?version=1
2 - Create the behaviorSet
More about behaviorSets can be found in Behavior Rules
Request URL
POST http://localhost:7070/behaviorstore/behaviorsets
Response Body
no content
Response Code
201
Request Body
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.behavior/behaviorstore/behaviorsets/<id>?version=1
3 - Create the httpCall
Note that we can pass user input to the http call using {memory.current.input}
Request URL
POST http://localhost:7070/httpcallsstore/httpcalls
Request Body
Response Body
no content
Response Code
201
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.httpcalls/httpcallsstore/httpcalls/<id>?version=1
4 - Create the outputSet
More about outputSet can be found Output Configuration.
Note When you set
"saveResponse" : trueinhttpCallthen you can use{memory.current.httpCalls.<responseObjectName>}to access the response data and use Qute ({#for}) to iterate overJSONarraysif you have them in yourJSONresponse.
Request URL
POST http://localhost:7070/outputstore/outputsets
Request Body
Response Body
no content
Response Code
201
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.output/outputstore/outputsets/<id>?version=1
5 - Creating the package
More about packages can be found here.
Important Workflow note
ai.labs.httpcalls&ai.labs.outputmust come afterai.labs.behaviorin order of the package definition
ai.labs.templatinghas to be afterai.labs.output
Request URL
POST http://localhost:7070/packagestore/packages
Request Body
Response Body
no content
Response Code
201
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.package/packagestore/packages/<id>?version=1
6 - Creating the agent
Request URL
POST http://localhost:7070/agentstore/agents
Request Body
Response Body
no content
Response Code
201
The
Locationheader contains the resource URI, e.g.eddi://ai.labs.agent/agentstore/agents/<id>?version=1
7 - Deploy the agent
Request URL
POST http://localhost:7070/administration/production/deploy/**<agent_id>**?version=1&autoDeploy=true
Response Body
no content
Response Code
202
8 - Create the conversation
Request URL
POST http://localhost:7070/agents/**<env>**/**<agent_id>**
Response Body
no content
Response Code
201
The
Locationheader contains the conversation URI.
9 - Say weather
Request URL
POST http://localhost:7070/agents/<env>/<agent_id>/<conversation_id>?returnDetailed=false&returnCurrentStepOnly=true
Request Body
Response Body
Response Code
200
10 - Say "Vienna"
Request URL
POST http://localhost:7070/agents/<env>/<agent_id>/<conversation_id>?returnDetailed=false&returnCurrentStepOnly=true
Request Body
Response Code
200
Full Example
Download the Weather Agent Postman Collection to run the full example.
Last updated
Was this helpful?