Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Feature/add message post #22

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/bash/post/messages/post
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
if [ $# -ne 3 ]
then
echo "./post <token> <conversation_id> <message>"
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: */*" \