2d8f396eeb
Previously the base path for the API was hardcoded to `/api` and the specified version. This was not obvious that the generated code was setting that base path and it was not flexible for serving the API under a different path than `/api`. We will likely need to set a different base path if we pretend to serve the new back office API that we are going to implement alongside the current admin API until the new back office is fully implemented and verified that works properly. This commit also fix add the base path of the endpoints to the documentation because it was even more confusing for somebody that wants to use the API having to find out them through looking to the generated code. Change-Id: I6efab6b6f3d295129d6f42f7fbba8c2dc19725f4 |
||
---|---|---|
.. | ||
main.go | ||
README.md |
Generated Console REST API
The API defined in this package allows users to make requests related to their accounts, projects, and buckets, which would normally be performed within the Satellite UI.
This API is not enabled in all production environments, and it is not generally available to Storj customers.
Available Endpoints
Generated detailed documentation for each endpoint implemented can be found here.
Usage
Requires setting 'Authorization' header for requests. Users cannot currently generate their own REST API keys.
Example of request
curl -i -L \
-H "Accept: application/json" \
-H 'Authorization: Bearer <key>' \
-X GET \
"https://satellite.qa.storj.io/api/v0/projects/"
Successful responses
All the requests (except DELETE) have a non-empty response body for the resource that you're interacting with.
Example:
{
"project": {
"name": "My Awesome Project",
"description": "it is perfect"
}
}
Error responses
When an API endpoint returns an error (status code 4XX) it contains a JSON error response with 1 error field:
Example:
{
"error": "authorization key format is incorrect. Should be 'Bearer <key>'"
}