[GH-ISSUE #242] Optional Reference Id for every SMS #30

Closed
opened 2026-03-03 16:36:04 +03:00 by kerem · 5 comments
Owner

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.

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.
kerem closed this issue 2026-03-03 16:36:04 +03:00
Author
Owner

@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

<!-- gh-comment-id:1635082720 --> @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
Author
Owner

@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.

<!-- gh-comment-id:1637177011 --> @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.
Author
Owner

@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?

<!-- gh-comment-id:1637548802 --> @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?
Author
Owner

@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.

<!-- gh-comment-id:1638022804 --> @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.
Author
Owner

@AchoArnold commented on GitHub (Jul 17, 2023):

@ay1man4

I got you now, I'll add the optional reference ID.

Thanks for explaining.

<!-- gh-comment-id:1638490386 --> @AchoArnold commented on GitHub (Jul 17, 2023): @ay1man4 I got you now, I'll add the optional reference ID. Thanks for explaining.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/httpsms#30
No description provided.