From 2bf69e1b5ec873476504629ec7f265943aaa9c72 Mon Sep 17 00:00:00 2001 From: isra el Date: Mon, 23 Sep 2024 08:46:10 +0300 Subject: [PATCH] docs: update readme --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 34cf469..22415c6 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,43 @@ await axios.post(`https://api.textbee.dev/api/v1/gateway/devices/${DEVICE_ID}/se ``` +**Code Snippet**: Curl command to send an SMS message via the REST API + +```bash +curl -X POST" https://api.textbee.dev/api/v1/gateway/devices/YOUR_DEVICE_ID/sendSMS" \ + -H 'x-api-key: YOUR_API_KEY' \ + -H 'Content-Type: application/json' \ + -d '{ + "recipients": [ "+251912345678" ], + "message": "Hello World!" + }' +``` + +### Receiving SMS Messages + +To receive SMS messages, you can enable the feature from the mobile app. You can then fetch the received SMS messages via the REST API or view them in the dashboard. (Webhook notifications are coming soon) + +**Code Snippet**: Few lines of code showing how to fetch received SMS messages via the REST API + +```javascript +const API_KEY = 'YOUR_API_KEY'; +const DEVICE_ID = 'YOUR_DEVICE_ID'; + +await axios.get(`https://api.textbee.dev/api/v1/gateway/devices/${DEVICE_ID}/getReceivedSMS`, { + headers: { + 'x-api-key': API_KEY, + }, +}); + +``` + +**Code Snippet**: Curl command to fetch received SMS messages + +```bash +curl -X GET "https://api.textbee.dev/api/v1/gateway/devices/YOUR_DEVICE_ID/getReceivedSMS"\ + -H "x-api-key: YOUR_API_KEY" +``` + ## Contributing Contributions are welcome!