dennis_z

POST activity notification to an endpoint

Discussion created by dennis_z on Jun 13, 2018
Latest reply on Jun 13, 2018 by angelborroy

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

Outcomes