From 727080ebbce3d7d49850f7a697cd70d562066991 Mon Sep 17 00:00:00 2001 From: Aleksandr Soloshenko Date: Mon, 23 Dec 2024 06:37:25 +0700 Subject: [PATCH] [features] add `simNumber` field to webhooks' payload --- docs/features/multi-sim.md | 8 ++++++-- docs/features/webhooks.md | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/features/multi-sim.md b/docs/features/multi-sim.md index 3a765dd..8eb3fe4 100644 --- a/docs/features/multi-sim.md +++ b/docs/features/multi-sim.md @@ -24,7 +24,7 @@ curl -X POST \ ## Webhooks -To receive SMS messages, use the [Webhooks](./webhooks.md) feature. The `sms:received` event payload includes a `simNumber` field to identify which SIM card received the message. +When using the [Webhooks](./webhooks.md) feature all events include a `simNumber` field to identify which SIM card was used. ## SIM Card Rotation @@ -32,7 +32,7 @@ To receive SMS messages, use the [Webhooks](./webhooks.md) feature. The `sms:rec SIM rotation option -When the `simNumber` is not specified in the request, you can configure which SIM card will be used to send messages on the device. This option is located in the "Settings" tab under the "Messages" section. +When the `simNumber` is not specified in the request, you can configure which SIM card will be used to send the message on the device. This option is located in the "Settings" tab under the "Messages" section. Available options: @@ -40,6 +40,8 @@ Available options: * **Round Robin**: The app will rotate between SIM cards in a round-robin fashion. * **Random**: The app will select a SIM card at random for each message. +When a non-default option is used, you can receive the selected SIM number through the webhooks' `simNumber` field. + ## Troubleshooting If you encounter issues with multi-SIM functionality: @@ -47,5 +49,7 @@ If you encounter issues with multi-SIM functionality: 1. Ensure that your device supports multiple SIM cards and that they are properly installed. 2. Verify that the app has the necessary permissions to access and use all SIM cards. 3. Check the app's logs for any error messages related to SIM card access or usage. +4. Make sure your device's SIM cards are active and have sufficient credit or data allowance. +5. Restart the app and/or device if persistent issues occur. For further assistance, please contact our [support team](mailto:support@sms-gate.app). diff --git a/docs/features/webhooks.md b/docs/features/webhooks.md index d0446e2..c5827e7 100644 --- a/docs/features/webhooks.md +++ b/docs/features/webhooks.md @@ -14,14 +14,17 @@ Currently, the following event is supported: - `sms:sent` - Triggered when an SMS is sent by the device. The payload for this event includes: * `messageId`: The ID of the SMS message. * `phoneNumber`: The recipient's phone number. + * `simNumber`: The SIM card number that sent the SMS. May be `null` if default SIM is used. * `sentAt`: The timestamp when the message was sent. - `sms:delivered` - Triggered when an SMS is delivered to the recipient. The payload for this event includes: * `messageId`: The ID of the SMS message. * `phoneNumber`: The recipient's phone number. + * `simNumber`: The SIM card number that sent the SMS. May be `null` if default SIM is used. * `deliveredAt`: The timestamp when the message was delivered. - `sms:failed` - Triggered when an SMS fails to be sent to the recipient. The payload for this event includes: * `messageId`: The ID of the SMS message. * `phoneNumber`: The recipient's phone number. + * `simNumber`: The SIM card number that sent the SMS. May be `null` if default SIM is used. * `failedAt`: The timestamp when the message failed. * `reason`: The reason for the failure. - `system:ping` - Triggered when the device pings the server. Has no payload.