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
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.