Skip to content

Operations

This page gives the rules for a stable and safe integration in production: limits, cache, retries, logs and security.

Limits

Interface Limit Above the limit
Content API 1000 requests per minute for each key HTTP 429 Too Many Requests
Billing API 1000 requests per minute for each key HTTP 429, or code 42901 in the body (from the documentation)

The responses have no rate-limit headers. To increase a limit, ask your MEGOGO manager.

Cache

Data Rule
/configuration Keep it in a cache. Update it one time each day
XML feed Download it one time each day, after 05:00 UTC
List requests without access_token You can keep them in a cache for some minutes
/video/info Send it only after a user action, for example when the user opens the page of a video. Do not use it to collect the data of many videos
/stream (src) Do not keep it in a cache. Send a new request each time the user starts the playback
Access token Keep it until access_token_expires_at. Then get a new one with /auth/refresh

Retries

Content API:

  • After HTTP 429, wait and send fewer requests.
  • After a timeout or HTTP 5xx, you can send the request again.

Billing API:

  1. Send the request again only after a timeout or HTTP 5xx.
  2. Before you send it again, send user/subscriptions. Make sure that the first request did not change the service. subscribe and buyMovie are not idempotent.
  3. Wait 1 minute between the attempts. Make a maximum of 6 attempts.

Do not send the request again after an error in the response body (for example code 2023 or 40416). The result is the same.

Logs

We recommend that you keep a log of all Billing API requests and responses with the time (UTC). Give the time and the error code to MEGOGO support when you report a problem.

WARNING

Do not write these values to logs: the private keys, the salt, access tokens, remember-me tokens and src URLs.

Security

  • Keep the private keys and the salt only on your servers. The client application gets signed URLs from your server.
  • Send the Billing API requests only from your servers. MEGOGO accepts them only from the IP addresses in your list. To change the list, send an e-mail to supportpartners@megogo.net with your partner ID. A new address starts to work some minutes after the change.
  • Make sure that a user can watch AdVOD and FVOD videos only with your subscription. The Content API gives these streams without a user.
  • If an unauthorized person gets a key, the salt or a token, tell your MEGOGO manager immediately.

Time

All times in the Content API, the Billing API and the XML feed are UTC. Unix times are in seconds.

Test and production

MEGOGO does not have a separate test environment. Your test partner ID and test keys work on the production servers. Test subscriptions and purchases are real records in the MEGOGO billing of the test partner.