Skip to main content
Every MIOeSIM API request requires two security elements: a token that identifies your session, and a sign that proves the request parameters have not been tampered with. You obtain the token by calling the login endpoint; you compute the sign yourself using an HMAC-MD5 algorithm applied to the sorted request parameters and your secret key.

Obtaining a token

Call POST /api_order/login to exchange your credentials for a session token. The login request itself also requires a sign — see Computing the signature below for how to generate it.

Request parameters

string
required
Your MIOeSIM account phone number. This is your login username.
string
required
Your MIOeSIM account password.
string
required
HMAC-MD5 signature computed from phonenumber and password. See Computing the signature.

Example request and response


Computing the signature

Every API request — including the login request — requires a sign parameter. Compute it using the following algorithm:
  1. Collect all request parameters except sign itself.
  2. Format each parameter as key=value.
  3. Sort the resulting strings alphabetically.
  4. Concatenate all sorted strings with no separator.
  5. Append your secret key directly to the end of the concatenated string.
  6. MD5 hash the full string (UTF-8 encoded).
  7. Use the hex digest as the sign value.
Example — signing a login request with phonenumber=13800000000 and password=mypassword:
Your secret key grants full access to your account. Never expose it in client-side code, public repositories, or logs.

Code examples


Using the token

After a successful login, include the token and sign on every subsequent request. For GET requests, pass them as query parameters. For POST requests, include them in the request body. GET example:
POST example:
Compute the sign fresh for each request, using all parameters in that specific request (excluding sign itself).

Token expiry

Tokens are valid for 2 hours from the time of issue. After a token expires, all requests return an authentication error. To handle expiry gracefully:
  • Store the token and its issue timestamp locally.
  • Before each request, check whether the token is within 10–15 minutes of its 2-hour expiry.
  • If it is, call POST /api_order/login to obtain a fresh token before proceeding.
Avoid calling the login endpoint on every request — fetch a new token only when necessary.

Error codes

The login endpoint returns the following error codes in the code field of the response: If you receive -30, verify that your signature algorithm sorts parameters alphabetically and that you are using the correct secret key.