Skip to content
Scripts for node api + particle IOT device
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Scripts for node api + particle IOT device

Use Slack slash commands to send text to a scrolling marquee!


alt tag

This example using a Photon, however the Argon or Boron will work fine as well.


This example project uses now to host the nodeJS api.

You do not need to use now, but I have included the now.json manifest if you wish to do so.
The manifest exposes the 2 available routes of the api (/hr and /display), and also references the same secret variable values as listed in the following .env file.


Keep your secrets safe!
This example references environment variables, so if you wish to use this api locally, you should create an .env file and include your secret credentials.

The Slack slash commands are each assigned an id which is passed along in the payload. For some added security, our api checks if we have the correct HRKEY and DISPLAYKEY values.



If you wish to recreate this project, you'll need a Slack app.

Once created, you will need to allow the slash command integrations. Administrations > Manage apps > custom-integrations.

Once enabled, create the following integrations:

Command: /hr
URL: path_to_your_server/api/hr
Token: Take note of this value and store it in your .env file
Command: /display
URL: path_to_your_server/api/display
Token: Take note of this value and store it in your .env file

Once created, you should be able to use the slash commands like so:

/hr Pete

Pete is required by HR.

/display Where are we going for lunch today?

Now displaying: Where are we going for lunch today?

You do not have to use Slack

You can get away with just using an app like Postman or cURL.

You will just need to make sure the body contains text and the correct slash command token.

curl -d '{ "text": "Pete", "token": "your_slash_command_token" }' -H "Content-Type: application/json" -X POST https://path_to_your_server/api/hr

Pete is required by HR.%
You can’t perform that action at this time.