diff --git a/examples/bash/post/messages/post b/examples/bash/post/messages/post new file mode 100755 index 0000000..d112a2f --- /dev/null +++ b/examples/bash/post/messages/post @@ -0,0 +1,15 @@ +#!/bin/bash +if [ $# -ne 3 ] +then + echo "./post " + exit 1 +fi +data="{\"content\": \"$3\", \"attachments\": []}" + +SERVER=${SERVER:=api} +curl "https://$SERVER.getsling.com/conversations/$2/messages" \ + -X POST \ + -d "${data}" \ + -H "Content-Type: application/json" \ + -H "Authorization: ${1//[$'\t\r\n ']}" \ + -H "accept: */*" \