Skip to content

nuxeo-sandbox/nuxeo-slack

Repository files navigation

Description

This repository contains a plugin to post messages on Slack from the Nuxeo Platform

How to build

git clone https://github.com/nuxeo-sandbox/nuxeo-slack
cd nuxeo-slack
mvn clean install

Slack App Configuration

  • Go to https://api.slack.com/apps
  • Create a new app
  • Copy the Bot User OAuth Token
  • Open the OAuth & Permissions menu
    • Add the following scopes
      • channels:read
      • chat:write
      • chat:write.public
      • groups:write
      • im:write
      • mpim:write
      • users:read
      • users:read.email
      • files:write

Nuxeo Configuration

In nuxeo.conf, set the following property

nuxeo.slack.token=<Bot User OAuth Token>

Features

This plugin contains two automation operations.

Post message

The Notification.SendSlackNotification operation takes three parameters:

  • channel: the channel name where to post. Ignored if the nuxeoUsername parameter is used
  • nuxeoUsernames: a list of nuxeo usernames. For each user, the email address must be set in the user profile in Nuxeo and must be the same as the user's email in the target slack workspace
  • message: the message to post
  • blocks: json string containing a message built with the Block Kit UI framework

Upload File

The Slack.UploadFile takes a blob as the input and returns a String Blob containing a slack file object

Samples

Test

Assuming the docker image was built, set the app bot token in conf.d/docker.conf

docker compose up -d

Use the following curl command to test that the integration is working correctly

curl --location --request POST 'http://localhost:8080/nuxeo/site/api/v1/automation/Notification.SendSlackNotification' \
--header 'Authorization: Basic QWRtaW5pc3RyYXRvcjpBZG1pbmlzdHJhdG9y' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"channel":"general",
"message":"Salut!!!"
}
}'

Known limitations

This plugin is a work in progress.

Support

These features are not part of the Nuxeo Production platform.

These solutions are provided for inspiration and we encourage customers to use them as code samples and learning resources.

This is a moving project (no API maintenance, no deprecation process, etc.) If any of these solutions are found to be useful for the Nuxeo Platform in general, they will be integrated directly into platform, not maintained here.

Nuxeo Marketplace

This plugin is published on the marketplace

License

Apache License, Version 2.0

About Nuxeo

Nuxeo Platform is an open source Content Services platform, written in Java. Data can be stored in both SQL & NoSQL databases.

The development of the Nuxeo Platform is mostly done by Nuxeo employees with an open development model.

The source code, documentation, roadmap, issue tracker, testing, benchmarks are all public.

Typically, Nuxeo users build different types of information management solutions for document management, case management, and digital asset management, use cases. It uses schema-flexible metadata & content models that allows content to be repurposed to fulfill future use cases.

More information is available at www.nuxeo.com

About

Slack Integration for the Nuxeo Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published