Changes

External Data Source Integration

307 bytes added, 1 April
Setting up a New Integration
# Go to '''Global Settings''' > '''Integrations''' tab > '''External Data Source Integration''' > Click the '''New External Data Source Integration''' button (looks like a plus sign).
# For '''Reference Name''', enter the name by which the integration will be referenced by the variable processor. For example, “chatbot”.
# For '''Data Source URL''', enter the URL of the third-party data source (API) endpoint from which we are pulling the external data.
# Under '''Method''', select the desired HTTP method for the operation.
## To retrieve data from a server, select “GET”.
# Under '''Format''', select the data format to be used in the HTTP call.
# Under '''Header''', enter the HTTP headers to be sent in the request (Example: Content-Type, Authorization, etc). Each header pair must be delimited by a line break.
# Under '''Values Template''', set up the instructions to the data source parameters or request body in either JSON or parameter value pair format.
# For '''Cache for''', enter how many hours the data should be cached for before pulling from the data source again. Set '''Cache for''' to “0” if you don’t want to use cached data.
==Header Example==
For the '''Header''' field, enter the HTTP headers to be sent in the request. Each header pair must be delimited by a line break. For example, this is a sample header that could be used when properly filled out:
<pre>Content-Type: application/json
Authorization: Bearer xxxxxxxxx
</pre>
 
==Values Template Example: JSON Format==
* When a numeric values is required as the data value inside the JSON, wrap the variable name with the number symbol ( # ). For example, enter <code>"temperature":#temperature#</code> to resolve the variable name <code>"temperature"</code> as a numeric value. 
* If the variable is a string type, the system will put double quotation marks ( " " ) around the value and escape all special charactercharacters* The example provided above is based on OpenAI's Chat Completions API endpoint available at: https://platform.openai.com/docs/api-reference/chat* The accepted JSON Format varies depending on the API's requirements, defined by the Data Source URL field. Please consult the configured API's own documentation when structuring the JSON Object within the Values Template field.
==Values Template Example: Name Pairs==
==Using the Variable Processor==
Once the previous integration has been set up, we can interact with the external data source by calling it through the variable processor. The variable processor uses semicolons ( ; ) as the default delimiter. However, the syntax can be modified to use other delimiters as well. To test this integration, do the following:
# Go to the desired UTA and open a record
# Go to '''Tools''' > '''Configuration Mode''' > '''Variable Syntax Helper'''
# In the '''Expressions''' input, enter a call to the integration using the syntax examples below
# Click '''Evaluate''' to ensure proper resolution of valuesthe request resolves as expected
===Example Syntax (Default Delimiter)===
Smartstaff, administrator
3,566
edits