Number Masking - Create masked session for SMS

📘

NOTE:

To add this product to your account, contact a Telesign expert. This product is available for full-service accounts only.

This page shows you how to create an anonymous session where two users can send text messages to each other using assigned masking IDs instead of their real phone numbers. You must use only SMS capable (not voice capable or dual-capable) numbers from Telesign as masking IDs when using this action. You must have Telesign Number Masking enabled to use this action.

Reference Page

POST https://rest-ww.telesign.com/v1/anonymous/session/sms - See complete technical details for this action, including all request parameters and response properties.

📘

NOTE:

It is possible that the masking ID for both parties is the same number. This does not impact SMS communication between the two parties.

How it Works

A diagram showing the workflow when using a masked session for SMS using Number Masking.

To connect two users without either knowing the other's true phone number, the flow works like this:

  1. You receive a request for communication from an end user wanting to text with another end user (say a rider wants to text the driver in a taxi app).
  2. You send an anonymous SMS session request to Telesign. Your request will include the real phone numbers of both parties.
  3. The rider sends their message. This arrives at Telesign's servers.
  4. Telesign receives the message and sends a text message to the driver, but masked.

📘

NOTE:

Any time a message is sent in an anonymous session, you are billed for two text messages. The first message is the one sent to Telesign from the originating end user. The second message is the one Telesign sends to the destination end user.

Example

Request

POST https://rest-ww.telesign.com/v1/anonymous/session/sms HTTP/1.1
Authorization: Basic 12345678-9ABC-DEF0-1234-56789ABCDEF0:vjE/ZDfPvDkuGNsuqCFFO4neYIs=
Content-Type: application/json; charset=utf-8
Date: Tue, 31 Jan 2017 14:51:26 GMT

{
   "phone_number_1": "15555551212", 
   "phone_number_2": "15558675309",
   "validity_period": 500
}

Response (body only)

{
  "reference_id": "B5862A14363C016C8832D53625270015",
  "session_data": {
    "message": "",
    "phone_number_1": {
      "complete_phone_number": "15555551212",
      "country_code": "1",
      "country_iso2": "US",
      "country_iso3": "USA",
      "country_name": "United States",
      "masked_id": "15557740233"
    },
    "phone_number_2": {
      "complete_phone_number": "15558675309",
      "country_code": "1",
      "country_iso2": "US",
      "country_iso3": "USA",
      "country_name": "United States",
      "masked_id": "15557740234"
    },
    "resource": "sms",
    "session_end_on": "2018-03-05 10:59:13.761245",
    "validity": 500
  },
  "status": {
    "code": 2700,
    "description": "Session successfully created",
    "updated_on": "2018-02-12T14:57:11.765723Z"
  }
}