Code examples

The following code blocks give examples of how to query number information on an MSISDN.

Example for Query GNV (synchronous response):

curl
    -u username:password
    -X GET
    -H "Accept: application/json"
    https://rest.tyntec.com/nis/v1/gnv?msisdn=+491622943176

Example for Query GNV (asynchronous response):

curl
    -u username:password
    -X GET
    -H "Accept: application/json"
    https://rest.tyntec.com/nis/v1/gnv?msisdn=+491622943176&callbackUrl=https://rest.customer.com/inbound/

Response to Query GNV containing the requested number information:

{
"requestId":"12-86cfafba-8677-f42b-5050-ece6af6abf01",
"msisdn":"+491622943176",
 "nrhMCC":"262",
 "nrhMNC":"02",
 "nrhTtId“:15,
 "nrhOperator":"Vodafone",
 "nrhCountry":"DEU",
 "nrhTimezone":"+0100",
 "nrhTechnology":"GSM",
 "imsiMCC":"262",
 "imsiMNC":"02",
 "imsiTtId":15,
 "imsiOperator":"Vodafone",
 "imsiCountry":"DEU",
 "imsiTimezone":"+0100",
 "imsiTechnology":"GSM",
 "hlrCC":"49",
 "hlrNDC":"162",
 "hlrMCC":"262",
 "hlrMNC":"02",
 "hlrTtId":"15,
 "hlrOperator":"Vodafone",
 "hlrCountry":"DEU",
 "hlrTimezone":"+0100",
 "hlrTechnology":"GSM", 
 "mscCC":"49",
 "mscNDC":"162",
 "mscMCC":"262",
 "mscMNC":"02",
 "mscTtId":15,
 "mscOperator":"Vodafone",
 "mscCountry":"DEU",
 "mscTimezone":"+0100",
 "mscTechnology":"GSM",
 "ported":"false",
 "roaming":"false",
 "presence":"true ",
 "price":0.001,
 "currency":"EUR",
 "priceEffective":"2010-11-01T00:00:00+0000",
 "errorCode":"0",
}

In this request, there are a number of parameters that need to be defined, while others are optional:

Parameter

Possible Values

Description

requestId

UUID according to RFC 4122

The unique identifier provided for each request. 

msisdn

Phone number according to ITU E.164

The phone number of interest given in international format. 

nrhMCC

UTF-8 encoded string according to ITU E.212

A representative MCC (Mobile Country Code) of the NRH’s network (Number Range Holder). 

nrhMNC

UTF-8 encoded string according to ITU E.212

A representative MNCs (Mobile Network Codes) of the NRH’s network. 

nrhTtId

integer

The respective tyntec ID of the NRH.

nrhOperator

string

Human readable name of the NRH. 

nrhCountry

Country code following ISO 3166-1 alpha-3

The three-letter country code where the NRH’s network is located. 

nrhTimezone

+HH:mm (according to ISO 8601)

Local time zone of NRH’s network relative to UTC. 

nrhTechnology

UTF-8 encoded string

The technology used by NRH operator’s network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed.

imsiMCC

UTF-8 encoded string according to ITU E.212

The MCC of the subscriber’s IMSI (International Mobile Subscriber Identity). 

imsiMNC

UTF-8 encoded string according to ITU E.212

The MNC of the subscriber’s IMSI. 

imsiTtId

integer

The respective tyntec ID of the subscription network operator.

imsiOperator

string

Human readable name of the subscription network operator. 

imsiCountry

Country code following ISO 3166-1 alpha-3

The three-letter country code where the subscription network is located. 

imsiTimezone

+HH:mm (according to ISO 8601)

Local time zone of the subscription network relative to UTC. 

imsiTechnology

UTF-8 encoded string

The technology used by the subscription network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed.

hlrCC

UTF-8 encoded string according to ITU E.214

The CC (Country Code) of the responding HLR (Home Location Register). 

hlrNDC

UTF-8 encoded string according to ITU E.214

The NDC (National Dialling Code) of the responding HLR. 

hlrMCC

UTF-8 encoded string according to ITU E.212

A representative MCC of the HLR’s operator. 

hlrMNC

UTF-8 encoded string according to ITU E.212

A representative MNC of the HLR’s operator.

hlrTtId

integer

The respective tyntec ID of the operator’s HLR.

hlrOperator

string

Human readable name of operator’s HLR. 

hlrCountry

Country code following ISO 3166-1 alpha-3

The three-letter country code where the HLR is located.

hlrTimezone

+HH:mm (according to ISO 8601)

Local time zone of the HLR relative to UTC. 

hlrTechnology

UTF-8 encoded string

The technology used by the HLR operator network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed.

mscCC

UTF-8 encoded string according to ITU E.214

The CC of the MSC (Mobile Switching Center). 

mscNDC

UTF-8 encoded string according to ITU E.214

The MSC of the NDC. 

mscMCC

UTF-8 encoded string according to ITU E.212

A representative MCC of the operator’s MSC. 

mscMNC

UTF-8 encoded string according to ITU E.212

A representative MNC of the operator’s MSC. 

mscTtId

integer

The respective tyntec ID of the operator’s MSC.

mscCountry

Country code following ISO 3166-1 alpha-3

The three-letter country code of the network operating the MSC. 

mscTimezone

+HH:mm (according to ISO 8601)

Local time zone of the MSC relative to UTC. 

mscTechnology

UTF-8 encoded string

The technology used by the MSC operator’s network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed.

ported

string

Indicating the porting status true/false/unknown. 

roaming

string

Indicating the roaming status true/false/unknown. 

presence

string

Latest handset status (switched on/off) known by the operator (stored in respective HLR). 

price

float

The price for the query. 

currency

currency code following ISO 4217

The currency in which the price is given; corresponding to the currency of the invoice. 

priceEffective

Date in the format “yyyy-MM-ddTH-HH:mm:ss”(according to ISO 8601)

The date when the “price” became effective. 

errorCode

 The reason for an unsuccessful attempts.

 Possible values for error codes are given in a following table.