Products · Exchange & Dynamic API
Subscriber Identification
Recognise subscribers with subscriberId, and use the masked subscriberMsisdn only for display.
Requests to your server don't include the subscriber's full phone number. They include two fields based on it:
| Field | Contains | Use it for |
|---|---|---|
global.subscriberId | A stable ID made from the phone number | Recognising the subscriber, database lookups |
global.subscriberMsisdn | The phone number with four digits hidden, for example +23276****56 | Showing the subscriber which number a transaction is for |
subscriberId
global.subscriberId is a UUID (version 5, URL namespace) made from the subscriber's phone number in international format with the +, for example +23276123456. The same number always gives the same ID, so you can store it and use it to recognise the subscriber next time.
There are two ways to use it:
- Store it as the subscriber's ID. You never need the phone number itself to link sessions to the same person.
- Match it against a number you already have. If the subscriber gave you their number another way, such as at sign-up, compute the ID from that number and compare.
You can't turn subscriberId back into a phone number directly. But anyone can compute it from a known number, so treat it as personal data.
subscriberMsisdn
global.subscriberMsisdn is the phone number with four digits replaced by *, for example +23276****56. Use it only in text shown to the subscriber, such as "Paying from +23276****56".
Getting the full phone number
To get the subscriber's full number, ask for their consent with the get_subscriber_msisdn template. You can then pass the number to your server through on_done.dataExport, for example "phone_number": "$(rc.player_msisdn)". It arrives in exportedData. Without the subscriber's consent, Monime sends the number masked.
Matching a number you already have
Compute the ID from the stored number and compare it with subscriberId. Store numbers in the same format: international, with the +.
// npm install uuid
const { v5: uuidv5 } = require("uuid");
function isSameSubscriber(storedPhoneNumber, subscriberId) {
return uuidv5(storedPhoneNumber, uuidv5.URL) === subscriberId;
}
isSameSubscriber("+23276123456", payload.global.subscriberId);For example, +23276123456 gives c9b4e86f-a1d8-5056-8dc4-5d1aafc6994a. Use this pair to check your code.