View Phone Formats
This documentation will describe the View Phone Formats (XMPHNPFX) endpoint. This endpoint allows users to view all the available phone formats on their system.
See the Authentication documentation for information on how to obtain the authentication headers within the request.
Use cases
- Get phone format information to use for data entry.
- View available phone format and masking options.
Supported attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
| *setMethod | string | Yes | Determines the endpoint you are calling. Must be XMPHNPFX to view formats. |
| OPTION | string | No | Determines if phone masking options are included. Use INCLUDE_DCOUNTY to view available phone masks. More information on using this option can be found below. |
View phone formats
View available country formats.
Example request
curl --location "https://example.securemcloud.com/rest/rest.php?dataSource=methods&*view=xmsubmit" \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
--header 'Accept: application/json' \
--form '*setMethod="XMPHNPFX"' \
Example response
{
"DCCNTRYC": [
{
"COUNTRY": "AUS",
"COUNTRY_CODE": "61",
"DESCRIPTION": "AUSTRALIA"
},
{
"COUNTRY": "CAN",
"COUNTRY_CODE": "1",
"DESCRIPTION": "CANADA"
},
{
"COUNTRY": "CHN",
"COUNTRY_CODE": "86",
"DESCRIPTION": "CHINA"
},
{
"COUNTRY": "FRA",
"COUNTRY_CODE": "33",
"DESCRIPTION": "FRANCE"
},
{
"COUNTRY": "DEU",
"COUNTRY_CODE": "49",
"DESCRIPTION": "GERMANY"
},
{
"COUNTRY": "GRC",
"COUNTRY_CODE": "30",
"DESCRIPTION": "GREECE"
},
{
"COUNTRY": "IRL",
"COUNTRY_CODE": "353",
"DESCRIPTION": "IRELAND"
},
{
"COUNTRY": "JPN",
"COUNTRY_CODE": "81",
"DESCRIPTION": "JAPAN"
},
{
"COUNTRY": "UK",
"COUNTRY_CODE": "44",
"DESCRIPTION": "UNITED KINDOM"
},
{
"COUNTRY": "GBR",
"COUNTRY_CODE": "44",
"DESCRIPTION": "UNITED KINGDOM"
},
{
"COUNTRY": "USA",
"COUNTRY_CODE": "1",
"DESCRIPTION": "UNITED STATES"
},
]
}
View phone formats and masks
Include available phone masking options in the response.
Example request
curl --location "https://example.securemcloud.com/rest/rest.php?dataSource=methods&*view=xmsubmit" \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
--header 'Accept: application/json' \
--form '*setMethod="XMPHNPFX"' \
--form 'OPTION="INCLUDE_DCOUNTY"'
Example response
{
"DCOUNTRY": [
{
"PHONE_FORMAT": "#",
"PHONE_MASK": "XXX",
"PREFIX_START": "03",
"COUNTRY": "USA",
"PHONE_LENGTH": "03",
"AREA_CODE_LENGTH": "00"
},
{
"PHONE_FORMAT": "\"",
"PHONE_MASK": "XXX-XXXX",
"PREFIX_START": "07",
"COUNTRY": "USA",
"PHONE_LENGTH": "07",
"AREA_CODE_LENGTH": "00"
},
{
"PHONE_FORMAT": "!",
"PHONE_MASK": "(XXX) XXX-XXXX",
"PREFIX_START": "10",
"COUNTRY": "USA",
"PHONE_LENGTH": "10",
"AREA_CODE_LENGTH": "03"
},
{
"PHONE_FORMAT": "%",
"PHONE_MASK": "XX-XXXXXXXX",
"PREFIX_START": "10",
"COUNTRY": "CAN",
"PHONE_LENGTH": "10"
}
],
"DCCNTRYC": [
{
"COUNTRY": "AUS",
"COUNTRY_CODE": "61",
"DESCRIPTION": "AUSTRALIA"
},
{
"COUNTRY": "CAN",
"COUNTRY_CODE": "1",
"DESCRIPTION": "CANADA"
},
{
"COUNTRY": "CHN",
"COUNTRY_CODE": "86",
"DESCRIPTION": "CHINA"
},
{
"COUNTRY": "FRA",
"COUNTRY_CODE": "33",
"DESCRIPTION": "FRANCE"
}
]
}
Possible error messages
Invalid Method
Verify you are specifying XMPHNPFX as the method.
{
"ERROR_CODE": "999",
"ERROR_DESCRIPTION": "INVALID%20METHOD%20METHOD",
"PROGRAM_ERROR": "11",
"PROGRAM_ERROR_DESCRIPTION": "Missing%20or%20Duplicate%20key",
"ERROR_ON_LINE": "240",
"ADDITIONAL_INFO": "%3CMETHOD_NAME%3EXMPHNPF%20%3C%2FMETHOD_NAME%3E"
}