Build on CloudCharge.

HTTP APIs for the CloudCharge charging platform. Every published service answers on one host, and every endpoint it publishes is documented here.

Base URLhttps://api.cloudcharge.tech

Making requests

Every endpoint sits under its service's name and one of two access levels, followed by the resource, or by a partner profile and its version where a service offers one. Bodies are JSON unless an endpoint says otherwise.

GET https://api.cloudcharge.tech/<service>/public/...
GET https://api.cloudcharge.tech/<service>/auth/...
Authorization: Bearer <access token>
LimitValue
ProtocolHTTPS only. A request to an endpoint over plain HTTP is refused with 403, not redirected, so a client set up with http:// fails at once instead of sending its credentials in clear first.
Request bodyUp to 8 KB. A larger body is refused with 403 before it reaches the service.
Response bodyUp to 10 MB.
HeadersSend a User-Agent header; a request without one is refused with 403.
Response timeA request still unanswered after 30 seconds fails with a 5xx response.
Request rateTraffic from one address is limited per five minutes; requests above that limit are refused with 403. The host also has a ceiling for all callers together; above it requests are refused with 429. Retry both after a pause, with backoff.
WebSocketsNot supported on this host.

Access levels

This host checks the access token on every authenticated request before it reaches the service; the service then decides what the caller may do.

public

/<service>/public/…

No CloudCharge account needed. An endpoint may still take a token of its own, such as a signed link, as its reference describes.

authenticated

/<service>/auth/…

Needs an OAuth 2.0 access token, as described under Authentication. Contact your CloudCharge representative for access. A missing or rejected credential is answered with 401 or 403.

Authentication

Authenticated endpoints take an OAuth 2.0 access token. CloudCharge issues each integrator a client id and secret; exchange them for a token with the client-credentials grant and send it as a bearer token.

curl -X POST https://auth.cloudcharge.tech/realms/cc-api/protocol/openid-connect/token \
  -u '<client id>:<client secret>' \
  -d grant_type=client_credentials

GET https://api.cloudcharge.tech/<service>/auth/...
Authorization: Bearer <access_token>
WhatHow
Token endpointhttps://auth.cloudcharge.tech/realms/cc-api/protocol/openid-connect/token
GrantClient credentials. Keep the secret on your servers: it goes to the token endpoint only, never to the API.
ScopesOne per service, named after it. Your client is granted the scopes of the services you may call, and every token carries them.
LifetimeA token is valid for a few minutes (expires_in in the response). Take a new one when it expires.
Refused401 when the token is missing, invalid or expired; 403 when it lacks the service's scope. Both before the service is reached.

Services

The reference for each service lists its endpoints, parameters, request and response bodies, and the credentials it expects.