mirror of
https://github.com/NdoleStudio/httpsms.git
synced 2026-04-27 11:55:58 +03:00
[GH-ISSUE #242] Optional Reference Id for every SMS #30
Labels
No labels
In Review
documentation
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/httpsms#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ay1man4 on GitHub (Jul 13, 2023).
Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/242
Most of systems have their own internal tables to track the sent messages and updating the status. To identify the response for every message we can't just rely on to/from fields because multiple messages can be sent to the same phone number.
Another solution is to let consumer can optionally add RefId field, which will be delivered back in webhook response. Consumer then can use this RefId to update internal tables.
Also, in case of webhook delivery failed for any reason, consumer can query the message status using RefId at any time.
@AchoArnold commented on GitHub (Jul 14, 2023):
Hello @ay1man4
Can you use the message ID to achieve this?
When you send a message, the system generates an ID for that message. You store this ID in your database.
When you get a delivery report, you check this delivery report gainst the message ID.
You can currently fetch messages by ID
@ay1man4 commented on GitHub (Jul 16, 2023):
Message ID will be received in response to sending the message, if response not received for any reason, then no consumer will consider message is not sent. Later once webhook provide the status, status can't be updated.
So, in worst case, consumer will consider the message is not sent and re-send again. Eventually, it will lead to message duplicate.
By providing Ref Id ahead (during submission), you have full control.
My suggestion to make it optional parameter, so api consumer can use any Id system (message ID or Ref ID).
Thansk.
@AchoArnold commented on GitHub (Jul 17, 2023):
Hello @ay1man4
Will this feature mean I'll have to build the "deduplication" logic on my end, So if you send 2 SMS messages with the same reference ID, I should only send out 1 of them?
@ay1man4 commented on GitHub (Jul 17, 2023):
Hi Arnold,
The logic should not change, what I suggest is to add provided Reference ID to message response. Then consumer have the option to use Message ID or Reference ID in his internal logic.
As I mentioned, it is optional ID, so it should not be involved in any logic. It is something API consumer may use.
@AchoArnold commented on GitHub (Jul 17, 2023):
@ay1man4
I got you now, I'll add the optional reference ID.
Thanks for explaining.