cURL
curl -X POST 'https://miyaip.com/api/SysLogin/Login' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}'const url = 'https://miyaip.com/api/SysLogin/Login';
const response = await fetch(url, {
method: 'POST',
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}),
});
const result = await response.text();
console.log(result);import requests
url = "https://miyaip.com/api/SysLogin/Login"
headers = {
"Accept": "application/json"
}
payload = {
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.text){
"code": 200,
"message": "Success",
"body": {
"id": 1024,
"name": "developer",
"token": "<ACCESS_TOKEN>"
}
}{
"code": 500,
"message": "Invalid request",
"body": null
}身份认证
MiyaIP 登录 API:获取访问 Token
通过 MiyaIP 登录接口使用邮箱密码或验证码完成认证,获取访问 Token,并用于需要 Bearer 鉴权的账户和代理接口。
cURL
curl -X POST 'https://miyaip.com/api/SysLogin/Login' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}'const url = 'https://miyaip.com/api/SysLogin/Login';
const response = await fetch(url, {
method: 'POST',
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}),
});
const result = await response.text();
console.log(result);import requests
url = "https://miyaip.com/api/SysLogin/Login"
headers = {
"Accept": "application/json"
}
payload = {
"email": "you@example.com",
"loginType": "pwd",
"passWord": "<YOUR_PASSWORD>"
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.text){
"code": 200,
"message": "Success",
"body": {
"id": 1024,
"name": "developer",
"token": "<ACCESS_TOKEN>"
}
}{
"code": 500,
"message": "Invalid request",
"body": null
}登录后取得访问 Token,用于账户、用量、代理资产和短效生成接口。此请求不需要已有 Token。
完成认证
- 填写邮箱,选择登录方式。
loginType=pwd时填写passWord;loginType=code时填写verifyCode。仅提交当前分支对应的凭据。- 检查 HTTP 状态与 JSON 业务结果。成功后,主动显示或复制
body.token,再填写到需要调用的接口页。