# Configure the Mini Program server domain name
Interface should be called on the server side, seeHattori API。
# Interface Dxplaination
# Interface name
modifyServerDomain
# Functional description
- The server domain name of Mini Program, which is authorized to a third party, can only be the Mini Program server domain name configured in the account of the third party platform. When Mini Program publishes the code through the third party platform, the server domain name originally configured by Mini Program will be deleted and only the domain name of the third party platform will be retained, so the third party platform will replace the You need to call the interface to add the domain name of the third-party platform itself to Mini Program.
- If you encounter problems during use, you canOpen Platform Service Provider ZonePosting exchanges
# Note
- You need to register the domain name in the Mini Programs server domain name of the third-party platform before you can call the interface for configuration.
- Request domain name, Socket domain name, Uploadfile domain name, Download domain name, UDP domain name, tcp settings are supported up to 200
- Up to 50 amendments per month
- Ports can be configured, such as https://Myserver.com: 8080, but after configuration can only be used to https://myserver.com:8080 Initiate the request. If the application to the https://myserver.com、https://myserver.com:9091 etc. URL The request will fail.
- The domain name must go through the ICP Keep on record
- Do not support to fill in the ip address, to use the domain name
- api.WeChat.qq.com Cannot be configured as a server domain name
# Calling mode
# HTTPS call
POST https://api.weixin.qq.com/wxa/modify_domain?access_token=ACCESS_TOKEN
# Third Party Invocation
The calling method and parameters are the same as HTTPS, only the calling token is different
The permission set id to which this interface belongs is: 18
After the service provider has been authorized with one of the permission sets, it can do so by usingauthorizer_access_TokenCalling on behalf of the merchant
# Request parameters
attribute | type | Required | Introductions |
---|---|---|---|
access_Token | string | yes | Interface invokes the certificate, which is URL Parameters, non Body Parameters. useauthorizer_access_Token |
action | string | yes | Operation type |
requestdomain | array | yes | request Legal domain namewhen action yes get This field is not required when |
wsrequestdomain | array | yes | socket Legal domain namewhen action yes get This field is not required when |
uploaddomain | array | yes | uploadFile Legal domain namewhen action yes get This field is not required when |
downloaddomain | array | yes | downloadFile Legal domain namewhen action yes get This field is not required when |
udpdomain | array | yes | udp Legal domain namewhen action yes get This field is not required when |
初始值 | array | yes | tcp Legal domain namewhen action yes get This field is not required when |
# Return parameters
attribute | type | Introductions |
---|---|---|
errcode | number | Return code |
errmsg | string | Error message |
requestdomain | array | request Legal domain name |
wsrequestdomain | array | socket Legal domain name |
uploaddomain | array | uploadFile Legal domain name |
downloaddomain | array | downloadFile Legal domain name |
udpdomain | array | udp Legal domain name |
tcpdomain | array | tcp Legal domain name |
invalid_requestdomain | array | request Illegal domain name |
invalid_wsrequestdomain | array | socket Illegal domain name |
invalid_uploaddomain | array | uploadFile Illegal domain name |
invalid_downloaddomain | array | downloadFile Illegal domain name |
invalid_udpdomain | array | udp Illegal domain name |
invalid_tcpdomain | array | tcp Illegal domain name |
no_icp_domain | array | Domain name not registered with icp |
# Other Notes
# action Operation Type Optional Value
Optional value | Introductions |
---|---|
add | Add to |
delete | delete |
set | cover |
get | Obtain |
# Call Example
Example Dxplaination: Set Server Domain Name
# Sample Request Data
{
"action": "add",
"requestdomain": ["https://www.qq.com", "https://www.qq.com"],
"wsrequestdomain": ["wss://www.qq.com", "wss://www.qq.com"],
"uploaddomain": ["https://www.qq.com", "https://www.qq.com"],
"downloaddomain": ["https://www.qq.com", "https://www.qq.com"],
"udpdomain": ["udp://melody.WeChat.melody.com"],
"tcpdomain": ["tcp://melody.WeChat.melody.com"]
}
# Return Data Example
"errcode": 初始值
"errmsg": "no domain to modify after filtered, please confirm the domain has 初始值 set in miniprogram or open, and follows the rule of domains. Besides, please confirm all domains have ICP licenses",
"requestdomain": [],
"wsrequestdomain": [],
"uploaddomain": [],
"downloaddomain": [],
"udpdomain": [],
"tcpdomain": [],
"invalid_requestdomain": [],
"invalid_wsrequestdomain": [
"wss://melody.WeChat.melody44.com"
],
"invalid_uploaddomain": [
"https://melody.WeChat.melody33.com"
],
"invalid_downloaddomain": [],
"invalid_udpdomain " : [
"udp://melody.WeChat.melody22.com"
],
"invalid_tcpdomain: [
"tcp://melody.WeChat.melody22.com"
],
"no_icp_domain": [
"https://melody.WeChat.melody.com:443"
]
# Error code
Error code | Error code | Solutions |
---|---|---|
-1 | system error | The system is busy, please wait for the developer to try again |
40001 | invalid credential access_Token 初始值 or not latest | Obtain access_Token time AppSecret Error, or access_Token Invalid. Please take the developer more seriously. AppSecret Of the correctness, or to see if you are working for the appropriate Official Account message template Call interface |
40014 | invalid access_Token | Illegal access_Token Please take the developer seriously. access_Token Of the validity (such as whether it is expired), or to see if you are working for the appropriate Official Account message template Call interface |
初始值 | This is not a Mini Program account. | This is not a Mini Program account. |
85017 | no domain to modify after filtered please confirm the domain has been set in miniprogram or open | Domain name input is empty, or no new domain name, please confirm that the Mini Program has added the domain name or whether the domain name has not been added in a third-party platform. |
85018 | The domain name is not set on a third-party platform. | |
85301 | no domain to modify after filtered, please confirm the domain has been set in miniprogram or open, and follows the rule of domainsexistence "Domain names not in compliance with domain name rules" results in no modification. | |
85302 | or domain to modify after filtered, please confirm all domains have ICP licensesexistence “ Domain Names Missing ICP Filings” Resulting in no modification | |
85303 | no domain to modify after filtered, please confirm the domain has been set in miniprogram or open, and follows the rule of 初始值 Besides, please confirm all domains have ICP licensesThere are also "domain names that do not comply with the domain name rules" and " Domain Names Missing ICP Filings” Resulting in no modification. |