POST activity notification to an endpoint

cancel
Showing results for 
Search instead for 
Did you mean: 
dennis_z
Member II

POST activity notification to an endpoint

I am a newbie to Alfresco , I am trying to establish a HTTP POST to send activity notifications in a particular folder to our Mattermost chat group . I've tested it by running CURL and it works. but when it comes to Alfresco I was totally lost , 

I wrote a couple of different scripts by using different methods but none of them work . 

 

What I have done was : apply a rule to a particular folder , the rule is when there's a new folder or file added to the folder , execute the script Mattermost-test-v1.js or Mattermost-test-v2.js  , this two scripts are doing the same thing just trying out different methods.    

 

The error message I received for Mattermost-test-v1.js is "remote is not defined" and Mattermost-test-v2.js is "http is not definded". I've been searching for a solution on Google without any result . Can someone please help .

 

The CURL commend that I'm using for testing is below :

 

this command is just an example , won't be able to provide the key here due to security reason . but it's exactly the same just with a different key .

 

 

curl -i -X POST -H 'Content-Type: application/json' -d '{"text": "Hello, this is some text\nThis is more text. :tada:"}' http://{your-mattermost-site}/hooks/xxx-generatedkey-xxx

1 Reply
angelborroy
Alfresco Employee

Re: POST activity notification to an endpoint

You are using this JavaScript API:

https://docs.alfresco.com/community/references/API-JS-rootscoped.html

There is no support to HTTP calls.

Probably the easier way is to develop a behaviour in Java to send the communications to Mattermost.

Hyland Developer Evangelist