1. Home
  2. Help Articles
  3. How to use API Documentation

How to use API Documentation

Accessing Integrations

Workstorm offers your company the ability to connect to incoming webhooks to post messages to a Channel.

Your Company Admin can access the Workstorm webhook setup assistant by clicking on Settings in the top right of your Workstorm window and then Integrations under Organization Settings. 

Setting Up a New Integration  

Click on New Integration, enter a name, a description for your webhook, and copy the API Token generated. Paste the API Token somewhere handy. 

Double check that the Integration is enabled toggle is on before moving any further.  

Next, search for the Channel you want to deliver an automated message to. Click on the matching search result. 

The Channel should now appear below the Channels with Integration section. Click the Copy Conversation ID to Clipboard button below the selected Channel’s name. Store this ID for later use (see HTTP Post Instructions below). Then, save your integration.  

Deleting Integrations 

If you would like to remove an enabled integration, click on Settings, Integrations, and then check the box to the left of the Integration you want to delete. Click the dropdown arrow within the Action box to the right of Select All and then choose Delete

HTTP POST Request Instructions  

To post a message to a conversation, send an HTTP POST request to https://app.workstorm.com/api/v1/post.  

Request parameters can be passed as headers, query string params or in the request body as JSON-formatted document. 

  • Token (mandatory) – a secret sequence of characters used to authenticate the incoming webhook 
  • Conversation (mandatory) – the ID of a conversation to post the message to, which can be a Channel or a Division. An Incoming Webhook must have explicit permission to post to the conversation. 
  • Urgent (optional) – send as urgent, same as clicking on the SEND AS URGENT button in the message bar. Valid values are y, yes, true, n, no or false 
  • Text – the contents of a message to post. 

Instead of passing message contents as a text field, you can set Content-Type header to text/plain and send the contents as the request body. 

Examples 

Posting a message with all parameters in JSON: 

curl {{baseURL}}/api/v1/post 

   -d ‘{ 

     “token”: “<token>”, 

     “conversation”: “<conversation ID>”, 

     “text”: “Hello, world!” 

   }’ 

Posting an urgent message as text/plain body with parameters in headers and query string: 

curl -H “Content-Type: text/plain” \ 

   -H “token: <token>” \ 

   {{baseURL}}/api/v1/post?’conversation=<conversation ID>&urgent=y’ \ 

   -d ‘message content’ 

Updated on June 26, 2024

Related Articles