Customer Identity (CIAM)

Get International Dialing Codes

This document introduces the content related to the interface for querying international dialing codes supported by the IDaaS server.

# Request Description

GET https://{your_domain}/api/v2/sdk/country-codes

# Request Headers

Parameter Name Chinese Name Required Type Example
X-operating-sys-version Calling Client OS Version Yes String windows10.1.1
X-device-fingerprint Calling Client Device Fingerprint Yes String 156aysdna213sc50
X-device-ip Calling Client IP No String 192.168.1.2
X-agent User-Agent Information Yes String Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X)
X-L For internationalization language setting No String zh
X-client-id Application Authorization ID Yes String nTo1eRIub60vPb54WeE6aojPwYwImtl4
content-type Content Format Type Yes String application/json

# Request Example

None

# Request Parameters

None

# Response Example

Success Example:
HTTP/1.1 200 OK
Content-Type: application/json
{
	"phoneAreaCodeDefinitions": [{
			"areaCode": "86",
			"displayMapping": {
				"zh-TW": "中國大陸",
				"en": "China",
				"zh-CN": "中国大陆"
			},
			"countryCode": "CN",
			"mobileRegex": "^(\\+86){0,1}\\-?1\\d{10}$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "852",
			"displayMapping": {
				"zh-TW": "中國香港",
				"en": "Hong Kong",
				"zh-CN": "中国香港"
			},
			"countryCode": "HK",
			"mobileRegex": "^(\\+852){1}\\-?0{0,1}[1,4,5,6,7,8,9](?:\\d{7}|\\d{8}|\\d{12})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "886",
			"displayMapping": {
				"zh-TW": "中國臺灣",
				"en": "Taiwan",
				"zh-CN": "中国台湾"
			},
			"countryCode": "TW",
			"mobileRegex": "^(\\+886){1}\\-?[6,7,9](?:\\d{7}|\\d{8})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "853",
			"displayMapping": {
				"zh-TW": "中國澳門",
				"en": "Macau",
				"zh-CN": "中国澳门"
			},
			"countryCode": "MO",
			"mobileRegex": "^(\\+853){1}\\-?0{0,1}[1,4,5,6,7,8,9](?:\\d{7}|\\d{8}|\\d{12})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "93",
			"displayMapping": {
				"zh-TW": "阿富汗",
				"en": "Afghanistan",
				"zh-CN": "阿富汗"
			},
			"countryCode": "AF",
			"mobileRegex": "^(\\+93){1}\\-\\d{6,11}",
			"areaCodeSuffixes": []
		}
	],
	"preferredAreaCode": "CN"
}


Error Example:
HTTP/1.1 400 Bad Request
{
    "error_code": "IDAAS.SDK.PARAM.0001",
    "error_msg": "Device information is incomplete"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

# Response Parameters

Parameter Name Chinese Name Type Description
preferredAreaCode Preferred International Area Code String The preferred international area code configured for the current enterprise center.
countryCode Country/Region Code String Country/Region Code
areaCode International Telephone Area Code String International Telephone Area Code
areaCodeSuffixes International Telephone Area Code Suffixes String International Telephone Area Code Suffixes
mobileRegex Mobile Number Format Regular Expression String Mobile Number Format Regular Expression
displayMapping Multilingual Display Name Mapping String Multilingual Display Name Mapping

# Error Codes

Status Code Error Code Error Message Handling Measures
400 IDAAS.SDK.PARAM.0001 Device information is incomplete Please check if the input device information is complete
设备信息不完整
400 IDAAS.SDK.PARAM.0002 clientId cannot be empty Please check if the input clientId is empty
clientId不能为空
400 IDAAS.SDK.PARAM.0003 The app is not registered, please register the app first Please check if the input clientId is correct
应用未注册,请先注册应用
500 IDAAS.SDK.COM.0002 System busy, please try again later Please retry or contact Zhuyun staff
系统繁忙,请稍后再试