Elemental lowcode development platform.
The integrations service allows you to call into any integrations defined within the system. It surfaces the following methods:
These methods are covered in more detail below.
Parameters:
name
- string, the name of the ruleset to callmethod
- string, the HTTP method to call the integration usingparams
- object, the query parameters (or body) to send to the integration endpointtoken
- string, the access token to use to access the API optionalCalls the named integration with the paramters given and returns the JSON response (as a parsed object) within a promise. This method can reject with an error and needs to be handled correctly.
This can be called from your controllers like so:
module.exports = {
events : {
load : (event) => {
return this.integrationService.callIntegration(
"getWeatherReport",
"get",
{
location : "Cullingworth, UK"
}
).then((result) => {
...
}).catch((err) => {
...
});
}
}
};