Changes

Jump to: navigation, search

External Data Source Integration

4,120 bytes added, 7 February
Created page with "=Overview= This article is about how to set up an integration to pull data from an external source using the variable processor. This gives you the ability to pull data from e..."
=Overview=
This article is about how to set up an integration to pull data from an external source using the variable processor. This gives you the ability to pull data from external sources into SmartSimple on demand. This article will show you how to set up the integration and an explanation of the settings.

=Configuration=
==Setting up a New Integration==
To set up a new configuration, follow these steps:

# Go to '''Global Settings''' > '''Integrations''' tab > '''External Data Source Integration''' > Click the plus sign button to create a new external data source integration.
# 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 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”.
## To create new records, select “POST”.
## To replace an existing record with an updated version, select “PUT”.
## To remove data, select “DELETE”.
# 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 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==
In this example, the template is formatted as a JSON:

<pre>{
"model": "gpt-3.5-turbo",
"temperature":#temperature#,
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": @thisrole@,
"content": @content@
}
]
}
</pre>
<u>'''Note:'''</u>

* 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 character

==Values Template Example: Name Pairs==
In this example, the template is formatted with name pairs. Each name pair must be delimited by a line break.

<pre>role=@thisrole@
temperature=#temperature#
model=gpt-3.5-turbo
content=@content@
</pre>


==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 values

===Example Syntax (Default Delimiter)===
In this example, “chatbot” is the '''Reference Name''' of our external integration. Note that we do not need to specify the delimiter because a semicolon is used by default.

[[File:Ticket-149530-1.png]]

===Example Syntax (Custom Delimiter)===
In this example, we can use a custom delimiter in the form of a double colon ( :: ) by passing the symbol as the second parameter in our call to the external data source.

[[File:Ticket-149530-2.png]]
Smartstaff
2,103
edits

Navigation menu