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
}Authentication
MiyaIP login API: obtain an access token
Authenticate with email and a password or verification code through the MiyaIP login API, then copy the access token for Bearer-protected endpoints.
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
}Log in to obtain an access token for the account, usage, proxy asset, and short-lived generation endpoints. This request does not require an existing token.
Complete authentication
- Enter your email and choose a login method.
- For
loginType=pwd, providepassWord. ForloginType=code, provideverifyCode. Send only the credential for the selected branch. - Check the HTTP status and JSON business result. On success, deliberately reveal or copy
body.tokenand enter it on the endpoint you want to use.
Online debugging
Source: official login reference.Body
application/json
- Option 1
- Option 2
Choose password or verification-code authentication.
Available options:
pwd Example:
"pwd"
Email address used to sign in.
Example:
"you@example.com"
Required when loginType is pwd.
Required when loginType is code.