Sorry, you need to enable JavaScript to visit this website.

You are here

Unable to determine message part order?

2 posts / 0 new
Last post

Dan's picture
by Dan

Unable to determine message part order?

With the /messages/sms API, how are you meant to determine which 'partial' messages to join together?

Consider example where the 1 phone number is sending 2 messages to your number - and each message is 2 SMS due to their length.

The API can give this, and they can be in random order:

...,"message":"pt1/2:<part of message>,"senderAddress":"MySenderID",...

...,"message":"pt1/2:<part of message>,"senderAddress":"MySenderID",..

...,"message":"pt2/2:<part of message>,"senderAddress":"MySenderID",..

...,"message":"pt2/2:<part of message>,"senderAddress":"MySenderID",...

For all 4 messages the 'apiMsgId' field is empty and the 'messageId' field is different for all 4.... so how do you know which pt2 matches to which pt1?

 

 

John's picture
by John

When using the /messages/sms

When using the /messages/sms API to receive multipart SMS messages, you can determine which partial messages belong to the same message by looking at the multipartRefId field in the response.

In your example, if the two messages from the same phone number were meant to be part of the same message, they should have the same multipartRefId. Therefore, you would need to check the multipartRefId field of each partial message to determine which ones belong together. The partial messages with the same multipartRefId should be joined together in the order specified by the partNumber field.

So, for example, if the first partial message has multipartRefId set to "abc" and partNumber set to "1", and the second partial message has multipartRefId set to "abc" and partNumber set to "2", then you would know that these two partial messages belong to the same message and should be joined together in the order specified by the partNumber field.

If the partial messages do not have a multipartRefId field, you could try using the messageId field to group them together, assuming that the sender is correctly setting the messageId field to the same value for all partial messages that belong to the same message.

Source: SMSala Bulk SMS Service Provider

Log in or register to post comments