This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
API
How to use the AudioBookRequest API
Overview
AudioBookRequest provides a RESTful API for a select few endpoints.
The API uses Bearer token authentication with API keys that can be generated
through the web interface.
How to Create an API Key
Follow these steps to create an API key for accessing the AudioBookRequest API:
- In the Account settings page, look for the API Keys section
- Enter a unique name for your API key
- Click on Create API Key
- Important: The API key will only be displayed once for security reasons
- Copy the generated API key immediately and store it in a secure location
- If you lose the key, you’ll need to generate a new one
Use Your API Key
Include your API key in the Authorization header of your API requests:
Authorization: Bearer <your-api-key>
Example using cURL:
curl -H "Authorization: Bearer <your-api-key-here>" https://abr.example.com/api/users/me
API Documentation
For a SwaggerUI documentation with interactive testing capabilities:
- Set the environment variable
ABR_APP__OPENAPI_ENABLED=true
- Head to
<your-domain>/docs
.
1 - Indexers
Using the API to access/update indexers
There are two main endpoints to work with indexers:
- A
PATCH
to update indexer settings.
- A
GET
to get all the available configuration settings for the indexers.
Head to the main API Docs to see how you can access the SwaggerUI
and more easily test the endpoints.
Getting the Indexer Configurations
To figure out what values you need to adjust, GET
the endpoint
/api/indexers/configurations
.
This will give you something along the lines of this:
{
"MyAnonamouse": [
{
"name": "mam_session_id",
"description": null,
"default": null,
"required": true,
"type": "str"
},
{
"name": "mam_active",
"description": null,
"default": "True",
"required": false,
"type": "bool"
}
]
}
This gives you the full information about what values can be adjusted.
Updating Indexer Settings
You can update indexer settings by sending a PATCH
request to
/api/indexers/{indexer name}
. The name is case-sensitive. The body has to
be a JSON object with key-value pairs of the values you want to update.
Here is an example using cURL: as
curl -X 'PATCH' \
'https://abr.example.com/api/indexers/MyAnonamouse' \
-H 'accept: application/json' \
-H 'Authorization: Bearer MaEqMYAGY3qvXxtje6-YDxcs4damlyRaKzTC8itG2b8' \
-d '{"mam_session_id":"bXDv1tC1d2MVvOypbFy8Q4Q-rz6q-bKwdqaSZzm85Dg"}'