ERPAG has the ability to use Blockly Script to send or receive data via the HTTP protocol.

BLOCKLY

Integration of two systems via API (Application Programming Interface) is always a complex process, especially for someone with little experience. In this blog we will explain a simple integration with the SLACK service, ie. sending a text message to a Slack Channel. Text messages are sent from ERPAG via HTTP – Post block in Blockly Script, while SLACK application receives messages via Webhook service.

Access to an API service always requires some authorization (to know who is sending the data and to whom the data belongs). The first step is to enable access to the application in SLACK.

Note: We assume that you have an account open in the on the SLACK application and that you are logged into your SLACK account in the browser.

Registration on the SLACK portal


Full information can be found at this URL address https://api.slack.com/messaging/webhooks .

The first step is to create an application. This is not a real software application, but only enabling connection to existing application (without fear that programming experience is required).

slack api

create app in slack

After the selection, you enter the name of the application (any name is possible) and you must specify the “workspace” with which you are integrating.

create erpag in slack

Note: Due to instruction purposes , we opened a workspace called Erpag in the SLACK account.

In the settings in the SLACK API you need to activate Incoming Webhooks and add the Webhook to the “workspace”.

incoming webhooks

While adding, you specify the channel to which messages will be sent (in our example, we opened a channel called #tickets).

erpag permissions

After confirmation, the URL address will appear in the Webhook URL section.

webhook url

You can “copy” and save it somewhere because you will enter that address in Erpag.

Creating a Blockly Script


Sending data can be done from any Blockly Script in Erpag, but in our example we will do it in Blockly Script type “On-Demand Script” in Tickets.

erpag on demand scripts

Note: The On-demand Script is activated by the user by clicking the mouse on the document itself ( right call to action bar).

erpag blockly script ticket

This is what Blockly Script would look like.

erpag and slack api
Note: Enter the Webhook URL from the SLACK portal (previously copied) in the URL text in the HTTP block.   

Activating an On-demand Script in a document.

erpag and slack

And display on the SLACK portal.

slack

A short video on creating a Blockly Script:

Start NOW

Read More

Related Posts

​ERPAG API – Dropbox OAuth 2.0 authorization

​ERPAG API – Dropbox OAuth 2.0 authorization

In this instruction blog, we will show you how to create OAuth 2.0 API keys on your Dropbox account. These are necessary to make API calls from ERPAG via Blockly scripts. The instructions show how the process itself currently looks. But in the meantime, the design of...

read more
Fixed Assets Management

Fixed Assets Management

Basic information about fixed assets This is a specific type of item. The basic characteristic is that it serves to perform activities/tasks, its life cycle is of a longer period (usually several years) during which it is gradually consumed (amortized/depreciated)....

read more
ERPAG Change Log 04-10-2024

ERPAG Change Log 04-10-2024

We prepared a new set of changes that are already up and running in your databases! Backdating documents - you can now change the document date: https://www.erpag.com/news/change-doc-date You can now undo document actions (such as pack, receive, invoice, record...

read more