From 69de2be9d9274d4b7de87eb10d2982261a4b61c7 Mon Sep 17 00:00:00 2001 From: jarrah31 Date: Wed, 2 Mar 2022 22:04:04 +0000 Subject: [PATCH] Update EXAMPLES.md Include a working example for sending images and videos --- doc/EXAMPLES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/EXAMPLES.md b/doc/EXAMPLES.md index f7762bd..b19075a 100644 --- a/doc/EXAMPLES.md +++ b/doc/EXAMPLES.md @@ -49,6 +49,17 @@ e.g: `curl -X POST -H "Content-Type: application/json" -d '{"message": "", "base64_attachments": [""], "number": "", "recipients": ["", ""]}' 'http://127.0.0.1:8080/v2/send'` +- Send a message with a base64 encoded attachment + + e.g: + `TMPFILE="$(base64 image_9.jpg)"` + `curl -X POST -H "Content-Type: application/json" -d '{"message": "Test image", "base64_attachments": ["'"${TMPFILE}"'"], "number": "+431212131491291", "recipients": ["+4354546464654"]}' 'http://127.0.0.1:8080/v2/send'` + + For sending larger files such as a 4MB mp4 video file: + + `TMPFILE="$(base64 video.mp4)"` + `echo '{"message": "Test video", "base64_attachments": ["'"$TMPFILE"'"], "number": "+431212131491291", "recipients": ["+4354546464654"]}' | curl -X POST -H "Content-Type: application/json" -d @- 'http://127.0.0.1:8080/v2/send'` + - Send a message to a group The group id can be obtained via the "List groups" REST call.