Computing the signature
Every request to the MIOeSIM API requires asign parameter. Use the bpm_sign function below to compute it.
sign.php
- Removes
signfrom the array so it is never part of the input. - Formats each remaining parameter as
key=valueand sorts them alphabetically. - Concatenates the sorted strings, appends your secret key, and URL-encodes the result with
customURLEncode. - Returns the uppercase MD5 hex digest of the encoded string.
Why customURLEncode is needed
PHP’s rawurlencode encodes the string according to RFC 3986, but produces output that differs slightly from the encoding expected by the MIOeSIM signing algorithm:
Always pass the pre-signature string through
customURLEncode before hashing. Skipping this step produces an incorrect signature.
Logging in
CallPOST /api_order/login to exchange your phone number and password for a session token. The login request itself must include a valid sign.
login.php
data field:
Making authenticated API calls
After login, include bothtoken and sign on every request. The example below calls GET /api_esim/getSkus to retrieve available eSIM packages.
get-skus.php
token first, compute sign from that array, then add sign to the array before appending it to the request URL.
Tokens are valid for 2 hours. Store the token and its issue time, then re-authenticate before the token expires rather than calling login on every request.
