Table of Contents

Pay-per-use API

Handle your clients accounts with these API end points.

Each client will get an unique ID. If you work with your own client IDs, please note the following:

API end points

Base URI:

https://api.forecast.solar/:apikey/payperuse

:apikey : Your administrative API key

The response format can be controlled with the Accept header, as described in the documentation.

If the response status code is 404, the API key is probably incorrect.

Create account

POST /account/create

Create a client account connected to your account.

Payload: If you want to use your own ID for the account, pass this as POST field id, otherwise a unique ID will be created.

To reactivate a suspended account, just use this route for the ID again. This will then also assign a new API key.

Response:

Accounts information

GET /accounts

Information about all your clients accounts.

Response:

Account information

GET /account/:id

Information about one specific clients account.

Response:

Accounts statistics

GET /usage(/:year)(/:month)(/:day)

Get the usage statistics for your client accounts for a year, month or day.

If no variable parameter is given, defaults to current year.

Response:

Reset API key

POST /account/reset

Assigns a new API key for a given client account.

Payload: POST body parameter id is required.

Response:

Suspend account

POST /account/suspend

Invalidate a given client account (just sets the expiration date to yesterday).

Payload: POST body parameter id is required.

To reactivate a suspended client account, use the Create account route for the ID again. This will then also assign a new API key.

Suspended client accounts are permanently deleted after 1 year.

You can not suspend your administrative account 8-)

Response:

Delete account

POST /account/delete

Delete a given client account final.

Payload: POST body parameter id is required.

You can not delete your administrative account 8-)

Response: