Get Started with REST APIs
Start building by implementing our Backend REST API and Pricing API. The following diagram shows the simplified architecture of the Cleverbridge platform.
flowchart LR
A[Modules ]:::mainColor <--> B[Cleverbridge REST API]:::mainColor
B <--> C[Client Server ]:::mainColor
C <--> D[Storefront UI]:::mainColor
C <--> E[Reseller Portal]:::mainColor
classDef mainColor fill:#ffffff,color:#96C34B,stroke:#0F967D,stroke-width:2px
BACKEND REST API
Some common scenarios for implementing Backend REST API:
Subscriptions
- Add subscriptions
- Offer discounts
- Bill for Usage
- Renew subscriptions
- Upgrade subscriptions
- Cancel subscriptions
- Get analytics
URL Generator
Cart
Purchase
npx run command
This is the response
inputs start with a dollar sign
outputs start with no prefix
and can be multiline
| Code | Status | Description | Message |
|---|---|---|---|
| APIKEY_EMPTY | Unauthorized | An API key was not supplied. | You must pass in an API key. |
| APIKEY_MISMATCH | Forbidden | The API key doesn't match the project. | The API key doesn't match the project. |
| APIKEY_NOTFOUND | Unauthorized | The API key couldn't be located. | We couldn't find your API key. |
| API_ACCESS_REVOKED | Forbidden | Your ReadMe API access has been revoked. | Your ReadMe API access has been revoked. |
| API_ACCESS_UNAVAILABLE | Forbidden | Your ReadMe project does not have access to this API. Please reach out to [email protected]. | Your ReadMe project does not have access to this API. Please reach out to [email protected]. |
| APPLY_INVALID_EMAIL | Bad Request | You need to provide a valid email. | You need to provide a valid email. |
Troubleshooting
For common errors, refer to Troubleshoot Backend REST APIs.
Create an API key
Sign up for an Acme account and navigate to your API settings to generate a new API key.
POST https://api.acme.com/v1/keysAuthenticate your request
Include your API key in the Authorization header of your requests.
const response = await fetch('https://api.acme.com/v1/data', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});Make your first API call
You're all set! Start making requests to the Acme API.