Services
Easily connect our resources to your client's by using our Service cell. They can be:
Rest Connector
Webhook
Implementation Steps
Name it and Header and Value (optional).
Insert the URL.
Define options: For each API response, create options that your agent can handle.
Set answer Path: Specify where each service cell will seek information and determine the flow based on the conditions met.
Flow navigation: Decide the next steps in the user flow contingent on the API's success or failure.

Rest Connector
The Rest Connector cell executes the Rest Request you configure based on user inputs and retrieves the results into a designated hiddenContext parameter.
Each Rest cell has its own unique URL and requires an Authentication step. This allows you to incorporate different APIs and integrations into your existing flow.
Implementation steps:
Proceed to the "Advanced Options" on the cells library in the workspace.
Name it and insert your URL.
Provide any amount of header pairs you need
Fill your Request type and then your content-type, which will include items available for the Request Type you chose. (As of now, PATCH is unavailable).
The last field you must fill is the Body. This may be empty, and otherwise should meet the expected body type criteria. This field works exactly as in the Code cell. You may parse the result however you want. The result will always be available as "hiddenContext.RestConnectorResponse". From there, you can choose to extract and handle specific parts, similar to how you would do it in a Code cell.

Since this cell is intended to access APIs you have access to, we do not validate the correctness of the body. It is expected that you can debug the integration using your own logs.
Authentication
Just above the URL, you'll see the "Edit the Authentication service" text button. Click it to choose from the available Authentication types. Those will either require you to simply fill a static Basic or Bearer authentication, or allow you to setup an oAuth2 form.
The oAuth2 form allows you to choose between Password and Client Credentials. By selecting this, a separate call will be used immediately before the configured cell's, and it's resulting body will be used as it's Bearers header.
Dynamic Fields
Much like other cells, some fields in the Rest Connector are compliant with Dynamic Content. You may access any environment-defined parameter, bot-defined parameter or user context and you will have its data filled during execution. The fields are:
Url
Body
Authentication fields
Headers
This means that you can use ongoing conversation data such as previous results stored in context variables or user inputs into your API.
This tools is particularly useful if you handle user input and format it with the assistance of Generative cells.
Handling Service Errors
External services may occasionally fail. In such cases, Syntphony CAI automatically generates a service error option. These errors are managed like any standard service option, allowing you to add responses after them.
By structuring error handling as part of the regular service option process, you ensure seamless interaction flow and clarity in response management.

Last updated
Was this helpful?