Web Action POST and Data format

Hi there,

I'm very close to integrating a Slack Bot with Repetier Server to post updates about the server's status. 

My question is:  what is the form of the command that's being sent via Post?  Is it using curl?  I'm trying to figure out formatting for the POST data but it's not immediately clear to me what it needs to look like. 

Here's a valid string which works in terminal to test my slackbot:

curl -X POST -H 'Content-type: application/json' --data '{"text":"this is a test!"}' https://hooks.slack.com/services/XXXXXXXXXX/YYYYYYYYYYYY



Comments

  • to be more specific, I'm trying to use Web Actions to trigger this command
  • Data is send as body content. So should be the same as your curl example, also we do not use curl. Did you check server.log for error messages from send?

    Which solution do you use for sendinf? webaction or computed expression http_post  or http_post_json?
    http_post send as form data while http_post_json uses content type application/json and sends also as body.
  • ah, i got it to work after playing with the formatting of the Post data. 

    {"text": "$1 - Print is finished"}

    Could you also do me a favor and obfuscate the link in my original post?  I would have edited it myself if I could.  Thanks. 
Sign In or Register to comment.