This guide provides instructions on how to use the API endpoints of Silverbucket using HTTP requests. The API allows you to perform CRUD (Create, Read, Update, Delete) operations on various resources within the application.
Before making any API requests, you must know the base URL where the API is hosted. The base URL for our API is:
https://<your_environment>.agbucket.com/customer-api/1.0/
Authentication is required to access most API endpoints. You must include an authentication token in the request headers. To obtain an authentication token, please refer to our authentication documentation.
[Resource Name] represents the specific resource you want to interact with, such as "users," "projects," or "programs." Each resource has its set of endpoints for CRUD operations.
: POST /resource-name/
To create a new [resource], send a POST
request to the endpoint with the following JSON data:
{
"key1": "value1",
"key2": "value2",
...
}
To create a list of [resources], send a POST
request to the endpoint with the following JSON data:
[
{
"key1": "value1",
"key2": "value2",
...
},
{
"key1": "value1",
"key2": "value2",
...
},
{
"key1": "value1",
"key2": "value2",
...
}
]
: GET /resource-name/{id}/
To retrieve a specific [resource] by its unique ID, send a GET
request to the endpoint, replacing {id}
with the actual ID of the resource.
: GET /resource-name/
To retrieve a list of all [resources], send a GET
request to the endpoint. You can apply filters and pagination to limit the results.
: PUT /resource-name/{id}/
To update a specific [resource] by its ID, send a PUT
request to the endpoint with the following JSON data:
{
"key1": "new-value1",
"key2": "new-value2",
...
}
: DELETE /resource-name/{id}/
To delete a specific [resource] by its ID, send a DELETE
request to the endpoint.
: POST /resource-name/bulk-update/
To update multiple [resources] in bulk, send a POST
request to the endpoint with a JSON array of objects representing the updates.
[
{
"id": 1,
"key1": "new-value1"
},
{
"id": 2,
"key1": "new-value2"
}
]
All API responses are returned in JSON format and include relevant status codes and data. Successful responses typically have a status code of 200 OK
or 201 Created
, while errors are accompanied by appropriate status codes and error messages.
Here's a sample successful response:
{
"next": null,
"previous": null,
"current": 1,
"itemsPerPage": 500,
"count": 1,
"lastPage": 1,
"data": [
{
"id": 8,
"key1": "value1",
"key2": "value2",
}
],
"excelUrl": "/customer-api/1.0/users/?user.id=8&excel=true",
"csvUrl": "/customer-api/1.0/users/?user.id=8&csv=true"
}