Getting Started With MediaStore API

This guide outlines basic information about the Cleeng MediaStore API.

Host URL

Access to API

In order to proceed with MediaStore Cleeng API, you must have Cleeng Core.

SDK Components

MediaStore SDK components are hosted in Github. It consists of components that will empower you to build and design a seamless checkout process, help visitors become subscribers, and then allow them to manage their subscriptions.

What will be needed?

Go through prerequisites section to set up everything that you will need.

Authorization

Some of the endpoints require authorization with JWT.

JWT contains customerId, publisherId, and expiration date (it is valid for 15 minutes).

You can decode JWT using packages like jwt-decode or you can also use online decoder like jwt.io

For more information, see Authorisation.

How to get?
JWT is returned after successful registration and login.

How to use?
Add a header while requesting to protected endpoints.

{
  Authorization: "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJvZmZlcklkIjoiUzg3NzM2NTgyMF9aVyJ9.dUn9mer-5srDEtSrDnVxM44hdZk1NHHZBM-gNYWJbCelN2LlwG8ynAk5qMzBOWiKtdZYZTxJnJGB1xsme2Gz8-9xgFhsNjxP8MRSpfGwyJ3etQ6ZJ6aqBYM7_re6I9-4OonjKE6Q4IOKBJzEviAD7NBuKOoMmzGeceCilMq0PJexN1aYSemkLNFB9fptAMq9eAqBDMczDN7PBNQCvAQFvfoHaefZMerlNk-tohw-wc_BTGrYXQpwx88uZL59rDfkfxw7M28zxwkZj5W7OZu-_LM_T9Fgirvv1tA-NUbS9KyqHhOe4QcI1b3z9g-0MwVIsLPxL47NxXZhn7S7DKDlDQ"	
}

Rate limiting

The Mediastore API limits how often each customer can call authenticated endpoints, to keep the service responsive for everyone. Limits apply per customer per endpoint.

Limits:

  • Default - all authenticated endpoints

    Up to 20 requests in quick succession, within an overall limit of 100 requests per 15 minutes
    (about 1 request every 9 seconds on average).

  • Password reset - PUT /customers/passwords

    Up to 5 requests in quick succession, within an overall limit of 10 requests per 15 minutes (about 1 request every 90 seconds on average).

Your quick-succession allowance refills while you stay below the overall rate. A few minutes restores it fully.

When a limit is exceeded, you get an error:

HTTP/1.1 429 Too Many Requests

  {
    "errors":  ["Too many requests"],
    "message": "Too many requests",
    "code":    "MSSDK0002"
  }