#SLACK API – step by step integration instructions

May 23, 2023


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

JSON / XML Designer

JSON / XML Designer

JSON/XML Designer in ERPAG is a visual tool that will allow users to transform data from the ERPAG database into JSON or XML format. This can be further used for future integration with API services. This tool provides a user-friendly interface where users can define...

read more
Change log 05/29/2023

Change log 05/29/2023

The biggest change we developed is Automatization and Customization. This change is a huge milestone for us, and we will publish individual instructions for using the new features in the upcoming period. This module is divided into individual wholes: JSON Designer -...

read more
ERPAG Change Log 11/30/2022

ERPAG Change Log 11/30/2022

Let's wrap up November with some more changes: Validation values (Quantity and Price) - will forbid you to process any documents that have values above the given limits. This option is used to decrease the number of unwanted errors during document processing....

read more