LLodi Agent

Last updated 21 days ago

Proxy

{your agent URL}/proxy?{your final endpoint}

This function allows you to make a request from the LLodi Agent, hence avoiding CORS issues.

Request
Response

Make the request as your final endpoint expects it: method, headers, payload...

You can add the header "llodi-auth" to use one of the connections created in your LLodi Agent.

Remember to include the header "llodi-key" if you have added it.

The LLodi Agent will bounce the response from the final endpoint as it is.

Example Proxy Request
GET https://myagent.com:8089/proxy?https://myJIRA.atlassian.net/rest/api/2/search
?jql=project=LLD&maxResults=20
HTTPHEADERS
llodi-key : "6f473260-74a5-f131-76ec-2e1dec040159"
llodi-auth : "MyJIRAConnection"
Example Proxy Response from JIRA API
{
"expand": "schema,names",
"startAt": 0,
"maxResults": 20,
"total": 242,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "15924",
"self": "https://myJIRA.atlassian.net/rest/api/2/issue/15924",
"key": "LLD-278",
"fields": {
"issuetype": {
...

Qlik Sense

post
Ping

{your agent URL}
/sense/ping
Make a ping request to ensure your Qlik Sense Repository Service or Engine is running.
Request
Response
Query Parameters
api
optional
string
repository/engine
200: OK
{
"status": "ok",
"result": "Ping successful."
}
404: Not Found
{
"status": "error"
}

Ping QRS function is not available in Qlik Sense Desktop.

post
Trigger

{your agent URL}
/sense/trigger
Insert some variables in a Qlik Sense App and reload it.
Request
Response
Headers
content-type
required
string
application/json
llodi-key
optional
string
(if required)
Body Parameters
app_id
required
string
ID of the Qlik App to trigger
tab_name
optional
string
Tab to insert variables.
tab_action
optional
string
Overwrite (default)/Append/Prepend
200: OK
{
"status": "ok",
"result": "Script modified and reload triggered!"
}

app_id, tab_name and tab_action can also be sent as query parameters.

Example Trigger Request
{
"app_id": "00xx00xx-x0x0-0x00-8270-aaa111111e11",
"tab_name": "My_LLoditab",//defaults to 'Tab Generated by LLodi'
"tab_action": "append",//defaults to 'overwrite'
"field1":"value1",
"field2":"value2",
}
Qlik Sense Script Result
LET field1 = 'value1';40
LET field2 = 'value2';

Find some cool use cases for the Trigger feature.

When using Trigger function in Qlik Sense Desktop the data load editor window of the target app must be closed.

Script

get
Get Script

{your agent URL}
/sense/script
Get the script from a Qlik Sense App or a specific tab from an app.
Request
Response
Headers
llodi-key
optional
string
(if required)
Query Parameters
app_id
required
string
ID of the Qlik App to get the script from.
tab_name
optional
string
Name of the tab to get the script from. Case sensitive, this tab must exist.
split
optional
boolean
True if we want to get the list as a table separated by qlik tabs
200: OK
{
"status": "ok",
"result": {
"app_id": "00xx00xx-x0x0-0x00-8270-aaa111111e11",
"tabs": [
{
"index": 1,
"name": "Main",
"script": "\r\nSET ThousandSep=',';\r\nSET DecimalSep='.';\r\nSET MoneyThousandSep=',';\r\nSET MoneyDecimalSep='.';\r\nSET MoneyFormat='$#,##0.00;-$#,##0.00';\r\nSET TimeFormat='h:mm:ss TT';\r\nSET DateFormat='M/D/YYYY';\r\nSET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';\r\nSET FirstWeekDay=6;\r\nSET BrokenWeeks=1;\r\nSET ReferenceDay=0;\r\nSET FirstMonthOfYear=1;\r\nSET CollationLocale='en-US';\r\nSET CreateSearchIndexOnReload=1;\r\nSET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';\r\nSET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';\r\nSET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';\r\nSET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';\r\nSET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';\r\n\r\n"
},
{
"index": 2,
"name": "Lib Connect to LLodi",
"script": "\r\nLIB CONNECT TO '_LLodi';\r\n\r\n"
}
]
}
}

Example Get Script Request
select
with connection
(
url "https://demo.server.com:8092/sense/script",
query "app_id" "00xx00xx-x0x0-0x00-8270-aaa111111e11"
query "tab_name" "Slack", //if we want one single tab
query "split" "true", //if we want to get the list as a table separared by qlik tabs
method "GET"
)
;

put
Paste Script

{your agent URL}
/sense/script
Add values in a tab of a preexisting Qlik app.
Request
Response
Headers
content-type
required
string
application/json
llodi-key
optional
string
(if required)
Body Parameters
script
required
string
The script that you want to copy
app_id
required
string
ID of the target Qlik App
tab_name
required
string
Tab to paste the script in, if does not exist will be created
reload
optional
boolean
True if we want to reload the app before pasting the script.
200: OK
{
"status": "ok",
"result": "Script modified"
}

app_id and tab_name can also be sent as query parameters.

Example Paste Script Request
select
with fields
(
script "This is the script I want in my Slack tab"
)
with connection
(
url "https://demo.server.com:8092/sense/script",
query "app_id" "00xx00xx-x0x0-0x00-8270-aaa111111e11"
query "tab_name" "Slack", //if we want one single tab
query "reload" "true",
method "PUT",
httpheader "content-type" "application/json"
)
;

When using Paste Script function in Qlik Sense Desktop the data load editor window of the target app must be closed.

post
Write Script

{your agent URL}
/sense/script
Overwrite the script in a Qlik Sense App.
Request
Response
Headers
content-type
required
string
application/json
llodi-key
optional
string
(if required)
Body Parameters
script
required
string
The script that you want to copy
app_id
required
string
ID of the target Qlik App
reload
optional
boolean
If we want to reload the app before pasting the script
200: OK
{
"status": "ok",
"result": "Script modified"
}

app_id can also be sent as query parameter.

Example Write Script Request
select
with fields
(
app_id "00xx00xx-x0x0-0x00-8270-aaa111111e11",
script "This is my new script"
reload "false"
)
with connection(
url "https://demo.server.com:8092/sense/script",
method "POST",
httpheader "content-type" "application/json"
)
;

When using Write Script function in Qlik Sense Desktop the data load editor window of the target app must be closed.

Social

post
Send Email

{your agent URL}
/email
Request
Response
Headers
content-type
required
string
application/json
llodi-key
optional
string
(if required)
200: OK
Example Payload
{
"from":"plain ‘sender@server.com’ or formatted ’“Sender Name” sender@server.com‘",
"to":"Comma separated list of recipients",
"cc":"Comma separated list of CC recipients",
"bcc":"Comma separated list of BCC recipients",
"subject":"The subject of the email",
"html":"<b>The content of the email, formatable with HTML code</b>"
}

You can also attach objects (see Using attachments for details). Attachments can be used for embedding images as well.

post
Send SMS

{your agent URL}
/sms
Request
Response
Headers
content-type
required
string
application/x-www-form-urlencoded
llodi-key
optional
string
(if included)
Body Parameters
from
optional
string
check your SMS provider account
to
required
string
include international prefix
text
required
string
the body of your message
200: OK
Example Response from Twilio
Example Response from Nexmo
{
"status": "ok",
"result": {
"accountSid": "AC3b82eb9e8fae4b4effa71856153e6e63",
"apiVersion": "2010-04-01",
"body": "Sent from your Twilio trial account",
"dateCreated": "2018-12-03T12:22:17.000Z",
"dateUpdated": "2018-12-03T12:22:17.000Z",
"dateSent": null,
"direction": "outbound-api",
"errorCode": null,
"errorMessage": null,
"from": "+34999999999",
"messagingServiceSid": null,
"numMedia": "0",
"numSegments": "1",
"price": null,
"priceUnit": "USD",
"sid": "Sacoma3524eae41c69d09a6481ba394dc",
"status": "queued",
"subresourceUris": {
"media": "/2010-04-01/Accounts/RA3b82eb9e8fae4b4effa71856153e6e81/Messages/Sacoma3524eae41c69d09a6481ba394dc/Media.json"
},
"to": "+34666666666",
"uri": "/2010-04-01/Accounts/RA3b82eb9e8fae4b4effa71856153e6e81/Messages/Sacoma3524eae41c69d09a6481ba394dc.json"
}
}

post
Send Tweet

{your agent URL}
/twitter
Send a tweet from your account.
Request
Response
Headers
content-type
required
string
application/json
llodi-key
optional
string
(if required)
Body Parameters
status
required
string
Content of the tweet.
200: OK

Connecting your Twitter Account.