Postman collection¶
The Postman collection has all requests of this guide. A script in the collection signs each request. Use it to try the requests with your test credentials.
Import the collection¶
- In Postman, select Import and select the file
megogo-terminals.postman_collection.json. - Make an environment, for example "MEGOGO test".
- Add the variables of the table below to the environment.
- Select the environment.
| Variable | Value |
|---|---|
partner_id |
Your test partner ID |
public_key |
Your public key |
private_key |
Your private key. Type: secret |
phone |
The phone number of your test SIM card: digits only, international format, without + |
service_id |
The service ID of a test subscription |
WARNING
Do not put the private key in the collection. Do not share or export an environment that contains it.
CAUTION
Write the phone number without +. Postman does not encode + in the
URL, and the server reads it as a space: the request gets HTTP 401.
Send the requests¶
Send the requests from a computer with an IP address of your list. See Credentials.
- Send Your services. Expected result: a list that contains your
service_id. - Send Check the phone number. The Postman console shows if the number is registered.
- Send Subscribe. Expected result:
"successful": true. - Send User services. The list contains your service with the end date.
- Send Unsubscribe. Send User services again: the result is
[].
Each request has a test that checks the result.
WARNING
Subscribe and User services create a MEGOGO user if the phone number is not registered. Use only the number of your test SIM card.
Suspend and Resume are also in the collection. Send Resume only after Suspend. See Renew, suspend and stop a subscription.
Variables¶
| Variable | Default | Description |
|---|---|---|
terminals_api |
https://billing.megogo.net |
Base URL of the API |
How the script signs a request¶
Before each request, the script:
- Removes
signfrom the URL. - Writes the private key,
GETand the path, with the variables replaced by their values. - Adds all enabled query parameters, sorted by name, as
name=value. - Calculates the SHA-256 hash, encodes the hexadecimal text with Base64,
removes
=, replaces/and+with-, and adds_and the public key. - Adds
signto the URL.
If you add a parameter to a request, the script includes it in the signature. See Sign a request.
Guide version 1.3.0, 2026-11-02 · Report a problem on this page