BloomERP

API views

Use api for an HTTP endpoint with application-wide scope, such as a status endpoint. The router mounts path="status/" at /api/status/. Supply an sdk contract when the endpoint should appear in the generated SDK.

Use api_model for collection operations such as listing or creating records. Select the models through models. Each route starts at the model's API collection path, such as /api/customers/. Use path="/" for the collection itself or supply a suffix for a separate collection operation.

Use api_detail for an operation on one record, such as retrieving or updating it. Select the models through models. The router inserts <int_or_uuid:pk> after the model's API collection path and before any suffix you supply. The view can use the captured pk to resolve the record.

Browse this section