dialcode – Phone Number Services

The dialcode service can be used determine which phone number shall be used to call a specific location.

This service can be tested with the Query Builder.

Request Parameters. 

NameDescriptionRequired
fromid

Specify the ID of the location you want to call from. If the location is not specified, the service will return the phone number in international format.

Type: String/Location Id

No
toid

Specify the ID of the location you want to call to.

Type: String/Location Id

Yes
number

Local number you want to call (without area or country code). If the number is not supplied, the calling information without the local number is returned (the number will contain the letter X instead).

Type: String

Example: 123 456 7890

Default value: X

No
locinfo

Return detailed information about the supplied locations.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No
geo

Return longitude and latitude for the geo object.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No
time

Adds current time under the location object.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No
verbosetime

Adds verbose time specification to all ISO 8601 time stamps.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No
tz

Add time zone information under the time object.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No

See also the section called “General Parameters”.

Response Elements. 

NameDescription
number

Resulting phone number which should be dialed.

Type: String

composition

This array contains the phone number split up into the parts which it is composed from. The element also contains notes in case the supplied number was ambiguous.

Type: Array of CompositionPartType

location (XML), locations (JSON)

This element contains the time information for the fromid and toid locations. For the XML format, the element will be repeated two times, while for JSON it is modeled as an array of objects (with the same content).

Type: Array of LocationType

Example JSON Request. 

https://api.xmltime.com/dialcode?fromid=187&toid=16&version=2&out=json&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example JSON response

{
  "version": 1,
  "number": {
    "full": "00 31 20 X"
  },
  "composition": [{
    "id": "international-prefix",
    "iddesc": "International Prefix",
    "number": "00",
    "description": "00 is the international prefix used to dial somewhere outside of Norway."
  },{
    "id": "country-prefix",
    "iddesc": "Country Prefix",
    "number": "31",
    "description": "31 is the international code used to dial to Netherlands."
  },{
    "id": "area-code",
    "iddesc": "Area Code",
    "number": "20",
    "description": "20 is the local area or city code used to dial to Amsterdam. "
  },{
    "id": "local-number",
    "iddesc": "Local Number",
    "number": "X",
    "description": "X is the local number you wrote. Exchange X with your number"
  }],
  "locations": [{
    "id": 187,
    "geo": {
      "name": "Oslo",
      "country": {
        "id": "no",
        "name": "Norway"
      },
      "latitude": 59.913,
      "longitude": 10.740
    },
    "time": {
      "iso": "2011-11-09T08:59:10+01:00",
      "datetime": {
        "year": 2011,
        "month": 11,
        "day": 9,
        "hour": 8,
        "minute": 59,
        "second": 10
      },
      "timezone": {
        "offset": "+01:00",
        "zoneabb": "CET",
        "zonename": "Central European Time",
        "zoneoffset": 3600,
        "zonedst": 0,
        "zonetotaloffset": 3600
      }
    }
  },{
    "id": 16,
    "geo": {
      "name": "Amsterdam",
      "country": {
        "id": "nl",
        "name": "Netherlands"
      },
      "latitude": 52.350,
      "longitude": 4.867
    },
    "time": {
      "iso": "2011-11-09T08:59:10+01:00",
      "datetime": {
        "year": 2011,
        "month": 11,
        "day": 9,
        "hour": 8,
        "minute": 59,
        "second": 10
      },
      "timezone": {
        "offset": "+01:00",
        "zoneabb": "CET",
        "zonename": "Central European Time",
        "zoneoffset": 3600,
        "zonedst": 0,
        "zonetotaloffset": 3600
      }
    }
  }]
}

Example XML Request. 

https://api.xmltime.com/dialcode?fromid=187&toid=16&version=2&out=xml&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example XML response

<?xml version="1.0" encoding="UTF-8"?>
<data version="1">
  <number>
    <full>00 31 20 X</full>
  </number>
  <composition>
    <part id="international-prefix" iddesc="International Prefix" number="00" description="00 is the international prefix used to dial somewhere outside of Norway."/>
    <part id="country-prefix" iddesc="Country Prefix" number="31" description="31 is the international code used to dial to Netherlands."/>
    <part id="area-code" iddesc="Area Code" number="20" description="20 is the local area or city code used to dial to Amsterdam. "/>
    <part id="local-number" iddesc="Local Number" number="X" description="X is the local number you wrote. Exchange X with your number"/>
  </composition>
  <location id="187">
    <geo>
      <name>Oslo</name>
      <country id="no">Norway</country>
      <latitude>59.913</latitude>
      <longitude>10.740</longitude>
    </geo>
    <time iso="2011-11-09T09:00:01+01:00">
      <datetime>
        <year>2011</year>
        <month>11</month>
        <day>9</day>
        <hour>09</hour>
        <minute>00</minute>
        <second>01</second>
      </datetime>
      <timezone offset="+01:00">
        <zoneabb>CET</zoneabb>
        <zonename>Central European Time</zonename>
        <zoneoffset>3600</zoneoffset>
        <zonedst>0</zonedst>
        <zonetotaloffset>3600</zonetotaloffset>
      </timezone>
    </time>
  </location>
  <location id="16">
    <geo>
      <name>Amsterdam</name>
      <country id="nl">Netherlands</country>
      <latitude>52.350</latitude>
      <longitude>4.867</longitude>
    </geo>
    <time iso="2011-11-09T09:00:01+01:00">
      <datetime>
        <year>2011</year>
        <month>11</month>
        <day>9</day>
        <hour>09</hour>
        <minute>00</minute>
        <second>01</second>
      </datetime>
      <timezone offset="+01:00">
        <zoneabb>CET</zoneabb>
        <zonename>Central European Time</zonename>
        <zoneoffset>3600</zoneoffset>
        <zonedst>0</zonedst>
        <zonetotaloffset>3600</zonetotaloffset>
      </timezone>
    </time>
  </location>
</data>

prev top | next >
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com