Skip to content

Commit fa2e6bf

Browse files
authored
Merge pull request #265 from flashcatcloud/docs/country-code-region
docs(api): document country_code as a validated ISO region code
2 parents 07dedf5 + 5724955 commit fa2e6bf

4 files changed

Lines changed: 84 additions & 40 deletions

File tree

api-reference/openapi.en.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17514,7 +17514,7 @@
1751417514
"Platform/Members"
1751517515
],
1751617516
"x-mint": {
17517-
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |",
17517+
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |\n\n## Usage\n\n- `country_code` must be an ISO 3166-1 alpha-2 region code (e.g. \"CN\"). It is validated and normalized to upper case before storage; invalid values are rejected with a 400.\n- When a member's `phone` has no \"+\" prefix, it is parsed with that member's `country_code` as the region hint (defaults to \"CN\" when omitted).",
1751817518
"href": "/en/api-reference/platform/members/member-invite",
1751917519
"metadata": {
1752017520
"sidebarTitle": "Invite members"
@@ -17584,6 +17584,13 @@
1758417584
"role_ids": [
1758517585
6
1758617586
]
17587+
},
17588+
{
17589+
"member_name": "Dave",
17590+
"phone": "13800138000",
17591+
"country_code": "CN",
17592+
"locale": "zh-CN",
17593+
"time_zone": "Asia/Shanghai"
1758717594
}
1758817595
]
1758917596
}
@@ -17821,7 +17828,7 @@
1782117828
"Platform/Members"
1782217829
],
1782317830
"x-mint": {
17824-
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **300 requests/minute**; **20 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Identify the member with one of `member_id`, `member_name`, `email`, `phone`, or `ref_id`. If multiple identifiers are present, the server checks them in that order.\n- When identifying or updating a member by `phone`, include `country_code` when the number needs country-specific parsing.\n- Put the profile fields to write under `updates`: `member_name`, `password`, `phone`, `country_code`, `email`, `avatar`, `locale`, `time_zone`, or `ref_id`.\n- Members provisioned by SSO cannot be changed when SSO marks them as externally managed.\n- `updates` must carry at least one field; an object with every field omitted is rejected.",
17831+
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **300 requests/minute**; **20 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Identify the member with one of `member_id`, `member_name`, `email`, `phone`, or `ref_id`. If multiple identifiers are present, the server checks them in that order.\n- `updates.country_code` is an ISO 3166-1 alpha-2 region code (e.g. \"CN\", \"US\"). It is an independently updatable field: `updates.phone` is not required, and the new region is stored even when the phone is unchanged. An explicit empty string is rejected with a 400.\n- When `updates.phone` has no \"+\" prefix, it is parsed with `updates.country_code` as the region hint, falling back to the member's stored region and then to \"CN\". Legacy digit calling codes such as \"86\" remain accepted only as parsing hints — stored values are always ISO region codes.\n- The top-level `country_code` is only a parsing hint for the identifying `phone`; it is never stored.\n- Put the profile fields to write under `updates`: `member_name`, `password`, `phone`, `country_code`, `email`, `avatar`, `locale`, `time_zone`, or `ref_id`.\n- Members provisioned by SSO cannot be changed when SSO marks them as externally managed.\n- `updates` must carry at least one field; an object with every field omitted is rejected.",
1782517832
"href": "/en/api-reference/platform/members/member-reset-info",
1782617833
"metadata": {
1782717834
"sidebarTitle": "Reset member info"
@@ -21020,7 +21027,7 @@
2102021027
"acme-corp"
2102121028
],
2102221029
"phone": "138****8000",
21023-
"country_code": "86",
21030+
"country_code": "CN",
2102421031
"email": "ops@acme.example",
2102521032
"avatar": "https://cdn.flashcat.cloud/avatar/acme.png",
2102621033
"locale": "zh-CN",
@@ -45489,7 +45496,7 @@
4548945496
},
4549045497
"country_code": {
4549145498
"type": "string",
45492-
"description": "Phone country code"
45499+
"description": "ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. \"CN\", \"US\", \"HK\")."
4549345500
},
4549445501
"avatar": {
4549545502
"type": "string",
@@ -45594,7 +45601,7 @@
4559445601
},
4559545602
"country_code": {
4559645603
"type": "string",
45597-
"description": "Phone country code"
45604+
"description": "ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. \"CN\", \"US\", \"HK\")."
4559845605
},
4559945606
"phone": {
4560045607
"type": "string",
@@ -45709,7 +45716,7 @@
4570945716
},
4571045717
"country_code": {
4571145718
"type": "string",
45712-
"description": "Phone country code, used with phone"
45719+
"description": "Region hint for parsing `phone` when it has no \"+\" prefix — an ISO 3166-1 alpha-2 code such as \"CN\" (the default when omitted). Legacy digit calling codes like \"86\" are still accepted in this parsing context."
4571345720
},
4571445721
"ref_id": {
4571545722
"type": "string",
@@ -45742,7 +45749,7 @@
4574245749
},
4574345750
"country_code": {
4574445751
"type": "string",
45745-
"description": "Country code"
45752+
"description": "ISO 3166-1 alpha-2 region code for `phone` (e.g. \"CN\"). Validated and normalized to upper case before storage; invalid values are rejected with a 400. Also the parsing hint when `phone` has no \"+\" prefix (defaults to \"CN\")."
4574645753
},
4574745754
"role_ids": {
4574845755
"type": "array",
@@ -45939,7 +45946,7 @@
4593945946
},
4594045947
"country_code": {
4594145948
"type": "string",
45942-
"description": "Country or region code used to parse phone."
45949+
"description": "Region hint for parsing `phone` when it has no \"+\" prefix — an ISO 3166-1 alpha-2 code such as \"CN\" (the default when omitted). Legacy digit calling codes like \"86\" are still accepted in this parsing context."
4594345950
},
4594445951
"ref_id": {
4594545952
"type": "string",
@@ -45975,7 +45982,7 @@
4597545982
},
4597645983
"country_code": {
4597745984
"type": "string",
45978-
"description": "Country or region code for the new phone number."
45985+
"description": "ISO 3166-1 alpha-2 region code (e.g. \"CN\", \"US\"). Updated independently — `phone` is not required — and also used as the parsing hint for `phone`. Invalid values are rejected with a 400; an explicit empty string is not allowed."
4597945986
},
4598045987
"email": {
4598145988
"type": "string",
@@ -46061,6 +46068,10 @@
4606146068
"type": "string",
4606246069
"description": "Email address"
4606346070
},
46071+
"country_code": {
46072+
"type": "string",
46073+
"description": "ISO 3166-1 alpha-2 region code of the contact phone (e.g. \"CN\", \"US\", \"HK\")."
46074+
},
4606446075
"phone": {
4606546076
"type": "string",
4606646077
"description": "Phone number"
@@ -48361,7 +48372,7 @@
4836148372
},
4836248373
"country_code": {
4836348374
"type": "string",
48364-
"description": "Calling country code for the contact phone."
48375+
"description": "ISO 3166-1 alpha-2 region code of the contact phone (e.g. \"CN\", \"US\", \"HK\")."
4836548376
},
4836648377
"email": {
4836748378
"type": "string",

api-reference/openapi.zh.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17506,7 +17506,7 @@
1750617506
"平台/成员管理"
1750717507
],
1750817508
"x-mint": {
17509-
"content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |",
17509+
"content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |\n\n## 使用说明\n\n- `country_code` 必须是 ISO 3166-1 alpha-2 地区代码(如 \"CN\");写入前校验并统一转为大写,非法值返回 400。\n- 当成员的 `phone` 不带 \"+\" 前缀时,按该成员的 `country_code` 作为地区提示解析(未传时默认 \"CN\")。",
1751017510
"href": "/zh/api-reference/platform/members/member-invite",
1751117511
"metadata": {
1751217512
"sidebarTitle": "邀请成员"
@@ -17576,6 +17576,13 @@
1757617576
"role_ids": [
1757717577
6
1757817578
]
17579+
},
17580+
{
17581+
"member_name": "Dave",
17582+
"phone": "13800138000",
17583+
"country_code": "CN",
17584+
"locale": "zh-CN",
17585+
"time_zone": "Asia/Shanghai"
1757917586
}
1758017587
]
1758117588
}
@@ -17813,7 +17820,7 @@
1781317820
"平台/成员管理"
1781417821
],
1781517822
"x-mint": {
17816-
"content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **300 次/分钟**;**20 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `member_id`、`member_name`、`email`、`phone` 或 `ref_id` 中任一字段定位成员;如果同时传多个字段,服务端按上述顺序匹配。\n- 使用 `phone` 定位或更新手机号时,可同时传 `country_code` 辅助解析。\n- `updates` 承载要写入的新资料,支持 `member_name`、`password`、`phone`、`country_code`、`email`、`avatar`、`locale`、`time_zone`、`ref_id`。\n- 由 SSO 托管且不可编辑的成员不能通过此接口修改。\n- `updates` 至少要带一个字段;所有字段都不传的空对象会被拒绝。",
17823+
"content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **300 次/分钟**;**20 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `member_id`、`member_name`、`email`、`phone` 或 `ref_id` 中任一字段定位成员;如果同时传多个字段,服务端按上述顺序匹配。\n- `updates.country_code` 为 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\")。它是独立可更新字段:无需同时传 `updates.phone`,即使手机号不变也会写入新的地区代码;显式传空字符串会被拒绝(400)。\n- 当 `updates.phone` 不带 \"+\" 前缀时,按 `updates.country_code` 作为地区提示解析;未传时依次回退到成员已存的地区代码、默认值 \"CN\"。\"86\" 等数字电话区号仅在解析场景兼容,存储值一律为 ISO 地区代码。\n- 顶层的 `country_code` 仅作为定位用 `phone` 的解析提示,不会被存储。\n- `updates` 承载要写入的新资料,支持 `member_name`、`password`、`phone`、`country_code`、`email`、`avatar`、`locale`、`time_zone`、`ref_id`。\n- 由 SSO 托管且不可编辑的成员不能通过此接口修改。\n- `updates` 至少要带一个字段;所有字段都不传的空对象会被拒绝。",
1781717824
"href": "/zh/api-reference/platform/members/member-reset-info",
1781817825
"metadata": {
1781917826
"sidebarTitle": "重置成员信息"
@@ -21012,7 +21019,7 @@
2101221019
"acme-corp"
2101321020
],
2101421021
"phone": "138****8000",
21015-
"country_code": "86",
21022+
"country_code": "CN",
2101621023
"email": "ops@acme.example",
2101721024
"avatar": "https://cdn.flashcat.cloud/avatar/acme.png",
2101821025
"locale": "zh-CN",
@@ -45480,7 +45487,7 @@
4548045487
},
4548145488
"country_code": {
4548245489
"type": "string",
45483-
"description": "手机国家区号"
45490+
"description": "成员联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。"
4548445491
},
4548545492
"avatar": {
4548645493
"type": "string",
@@ -45585,7 +45592,7 @@
4558545592
},
4558645593
"country_code": {
4558745594
"type": "string",
45588-
"description": "手机国家区号"
45595+
"description": "成员联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。"
4558945596
},
4559045597
"phone": {
4559145598
"type": "string",
@@ -45700,7 +45707,7 @@
4570045707
},
4570145708
"country_code": {
4570245709
"type": "string",
45703-
"description": "国家区号,配合 phone 使用"
45710+
"description": "当 `phone` 不带 \"+\" 前缀时的解析地区提示 —— ISO 3166-1 alpha-2 地区代码(如 \"CN\",未传时默认 \"CN\")。此解析场景仍兼容 \"86\" 等数字电话区号。"
4570445711
},
4570545712
"ref_id": {
4570645713
"type": "string",
@@ -45733,7 +45740,7 @@
4573345740
},
4573445741
"country_code": {
4573545742
"type": "string",
45736-
"description": "国家区号"
45743+
"description": "`phone` 的 ISO 3166-1 alpha-2 地区代码(如 \"CN\");写入前校验并统一转为大写,非法值返回 400。当 `phone` 不带 \"+\" 前缀时兼作解析提示(未传时默认 \"CN\")。"
4573745744
},
4573845745
"role_ids": {
4573945746
"type": "array",
@@ -45930,7 +45937,7 @@
4593045937
},
4593145938
"country_code": {
4593245939
"type": "string",
45933-
"description": "手机号对应的国家或地区区号,用于解析 phone。"
45940+
"description": "当 `phone` 不带 \"+\" 前缀时的解析地区提示 —— ISO 3166-1 alpha-2 地区代码(如 \"CN\",未传时默认 \"CN\")。此解析场景仍兼容 \"86\" 等数字电话区号。"
4593445941
},
4593545942
"ref_id": {
4593645943
"type": "string",
@@ -45966,7 +45973,7 @@
4596645973
},
4596745974
"country_code": {
4596845975
"type": "string",
45969-
"description": "新手机号对应的国家或地区区号。"
45976+
"description": "ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\")。可独立更新(无需同时传 `phone`),并兼作解析 `phone` 的地区提示;非法值返回 400,显式传空字符串也会被拒绝。"
4597045977
},
4597145978
"email": {
4597245979
"type": "string",
@@ -46052,6 +46059,10 @@
4605246059
"type": "string",
4605346060
"description": "邮箱地址"
4605446061
},
46062+
"country_code": {
46063+
"type": "string",
46064+
"description": "联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。"
46065+
},
4605546066
"phone": {
4605646067
"type": "string",
4605746068
"description": "手机号"
@@ -48352,7 +48363,7 @@
4835248363
},
4835348364
"country_code": {
4835448365
"type": "string",
48355-
"description": "联系电话的国家区号。"
48366+
"description": "联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。"
4835648367
},
4835748368
"email": {
4835848369
"type": "string",

0 commit comments

Comments
 (0)