Create Masked Session for SMS or Voice

This page shows you how to create an anonymous session where two users can communicate with each other using assigned masking IDs instead of their real phone numbers. The session can be used later for either SMS communication or a voice call, determined based on the inputs in the request. You must use only dual-capable (both SMS and voice capable) numbers from TeleSign as masking IDs when using this action. You must have the Number Masking API enabled to use this action.

Reference Page

POST /v1/anonymous/session/sms_voice - See complete technical details for this action, including all request parameters and response properties.

NOTE:

Creating an anonymous voice session with the Number Masking API is just one part of a larger procedure for making a voice call with number masking. See Set Up a Call with Number Masking to see instructions for the rest of the procedure.

Endpoint

The full endpoint for this action is: https://rest-ww.telesign.com/v1/anonymous/session/sms_voice

How It Works

When Used for Voice

To connect two users with this type of session for a voice call, the flow works like this:

  1. You receive a request for a call from an end user wanting to speak with another end user (say a rider wants to call the driver in a taxi app).
  2. You create a session request and send it to TeleSign. Your request will include the phone numbers of both parties.
  3. The rider initiates their call. This call request is routed to TeleSign’s servers.
  4. TeleSign receives the call request and connects the call to the driver. Both the sender ID of the rider and the sender ID of the driver are masked from each other.

When Used for SMS

To connect two users for SMS communication with this type of session, the flow works the same as for an SMS-only session (see Create Masked Session for SMS).

NOTE:

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

NOTE:

TeleSign calls have a maximum call duration of four hours.

Example

Below is an example of basic usage of this action.

Request
application/json
POST https://rest-ww.telesign.com/v1/anonymous/session/sms_voice HTTP/1.1
Authorization: Basic 12345678-9ABC-DEF0-1234-56789ABCDEF0:vjE/ZDfPvDkuGNsuqCFFO4neYIs=
Content-Type: application/json; charset=utf-8

{
   "phone_number_1": "15555551212", 
   "phone_number_2": "15558675309",
   "validity_period": 500
}
Response (body only)
application/json
{
  "reference_id": "C5B8F46B7D2C016C88308ABCE1D00169",
  "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": "16467740233"
    },
    "phone_number_2": {
      "complete_phone_number": "15558675309",
      "country_code": "1",
      "country_iso2": "US",
      "country_iso3": "USA",
      "country_name": "United States",
      "masked_id": "16467740234"
    },
    "resource": "sms_voice",
    "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"
  }
}

Next Steps

Check out these related pages: