Postman collection¶
The Postman collection has the main requests of the Content API and the Billing API. A script in the collection signs the Content API requests and calculates the authorization token. Use it to try the requests with your test credentials.
Import the collection¶
- In Postman, select Import and select the file
megogo-partner-api.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 |
The public key of one platform |
private_key |
The private key of the same platform. Type: secret |
salt |
Your salt. Type: secret |
service_id |
The service ID of the test subscription |
user_id |
A test user identifier, for example postman-test-001 |
WARNING
Do not put the keys and the salt in the collection. Do not share or export an environment that contains them.
Send the requests¶
- Send Billing API › Subscribe. Expected result:
"successful": true. - Send Content API › Authorize a user (by_partners). The script saves
access_tokenin the collection variables. - Send Content API › Video details and Content API › Stream. They
use
video_id(default6680) andaccess_token. - Send Billing API › Unsubscribe.
Each request has a test that checks the result. A Billing API request works only from an IP address of your list: send it from a computer with this address. See Credentials.
Variables¶
| Variable | Default | Description |
|---|---|---|
content_api |
https://api.megogo.net/v1 |
Base URL of the Content API |
billing_api |
https://billing.megogo.net |
Base URL of the Billing API |
lang |
en |
Language of the texts |
video_id |
6680 |
ID of a video. See Test data |
tariff_id |
— | tariff_id of a TVOD or DTO offer from /video/info, for Buy a video |
access_token, rememberme_token |
— | Set by Authorize a user and Refresh the access token |
auth_token |
— | Set by the collection script: md5(user_id + partner_id + salt) |
How the script signs a request¶
Before each Content API request, the script:
- Removes
signfrom the URL. - Joins all enabled query parameters in the URL order as
name=value, with the variables replaced by their values. - Adds
sign=md5(joined parameters + private_key) + public_keyas the last parameter.
If you add a parameter to a request, the script includes it in the signature. See Sign a request.
NOTE
Buy a video records a real rent or purchase for the test user. The Billing API has no request to cancel it. See Test data.
Guide version 1.4.1, 2026-10-31 · Report a problem on this page