Skip to content

Commit

Permalink
[features] add simNumber field to webhooks' payload
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Jan 2, 2025
1 parent f3b627a commit 727080e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/features/multi-sim.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,32 @@ 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

<div align="center">
<img src="/assets/features-sim-rotation.png" alt="SIM rotation option">
</div>

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:

* **OS Default**: The app will not select any SIM card, delegating this to the default messaging app.
* **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:

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).
3 changes: 3 additions & 0 deletions docs/features/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 727080e

Please sign in to comment.