创建一个新的店铺记录,支持常用字段别名,未识别的字段会按原样透传给店铺新增接口。
基本信息
Path: /createEnv
Method: POST
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
method |
string |
是 | 固定为 createEnv。 | createEnv |
storeName |
string |
是 | 环境/店铺名称。也兼容别名 name。 | Outlook 账号环境 |
platform |
string |
是 | 二级平台/站点名称。 | Outlook邮箱 |
storeUrl |
string |
是 | 平台登录地址,建议取 sites[].siteUrl。Outlook 使用 https://login.live.com/。 | https://login.live.com/ |
platformType |
number/string |
是 | 创建/编辑表单类型:官方内置平台传 1,自定义平台传 2。注意:这里不是 queryEnvV2 的平台筛选 ID。 | 1 |
actualPlatform |
string |
否 | 一级平台名称,取 platform-hierarchy.json 的 platformName。创建已知站点时可省略。 | 邮箱 |
storeAccount |
string |
否 | 登录账号。也兼容别名 username。 | user@example.com |
storePassword |
string |
否 | 登录密码。也兼容别名 password。 | password |
tagIdList |
array |
否 | 标签 ID 列表。 | [] |
lockAccount |
string/boolean |
否 | 账号锁定标记,建议按前端表单传 N/Y。 | N |
initPlatform |
array |
否 | 前端表单辅助字段,最小请求不需要。 | ["邮箱", "Outlook邮箱"] |
补充说明
接口内部会把 name 转成 storeName,把 username 转成 storeAccount,把 password 转成 storePassword。
后端返回 code=200 或 code=104001 时都会按成功处理。
请求示例
{"method": "createEnv","storeName": "Outlook 账号环境","platform": "Outlook邮箱","storeAccount": "user@example.com","storePassword": "password","storeUrl": "https://login.live.com/","tagIdList": [],"platformType": 1,"lockAccount": "N"}
成功返回示例
{
"method": "createEnv",
"response": {
"code": 200,
"msg": "success",
"storeId": 10001,
"data": 10001
}
}
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
response.code |
number | 200 或 104001 表示创建成功。 |
response.msg |
string | 后端返回提示。 |
response.storeId |
number/string | 新建店铺 ID。 |
response.data |
any | 后端原始返回数据。 |
失败返回示例
{
"method": "createEnv",
"status": "error",
"code": "400",
"msg": "create env failed"
}