Download the PHP package bapp/api-client without Composer
On this page you can find all versions of the php package bapp/api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bapp/api-client
More information about bapp/api-client
Files in bapp/api-client
Package api-client
Short Description BAPP Auto API Client for PHP
License MIT
Homepage https://www.bapp.ro
Informations about the package api-client
BAPP Auto API Client — PHP
Official PHP client for the BAPP Auto API. Provides a simple, consistent interface for authentication, entity CRUD, and task execution.
Getting Started
1. Install
2. Create a client
3. Make your first request
Authentication
The client supports Token (API key) and Bearer (JWT / OAuth) authentication.
Token auth already includes a tenant binding, so you don't need to specify tenant separately.
Configuration
tenant and app can be changed at any time after construction:
API Reference
Client options
| Option | Description | Default |
|---|---|---|
token |
Static API token (Token <value>) — includes tenant |
— |
bearer |
Bearer / JWT token | — |
host |
API base URL | https://panel.bapp.ro/api |
tenant |
Tenant ID (x-tenant-id header) |
None |
app |
App slug (x-app-slug header) |
"account" |
timeout |
HTTP request timeout (seconds) | 30 |
max_retries |
Max retries on transient errors (5xx, 429, connection) | 3 |
Methods
| Method | Description |
|---|---|
me() |
Get current user profile |
get_app(app_slug) |
Get app configuration by slug |
list(content_type, **filters) |
List entities (paginated) |
get(content_type, id) |
Get a single entity |
create(content_type, data) |
Create an entity |
update(content_type, id, data) |
Full update (PUT) |
patch(content_type, id, data) |
Partial update (PATCH) |
delete(content_type, id) |
Delete an entity |
list_introspect(content_type) |
Get list view metadata |
detail_introspect(content_type) |
Get detail view metadata |
get_document_views(record) |
Extract available views from a record |
get_document_url(record, output?, label?, variation?) |
Build a render/download URL |
get_document_content(record, output?, label?, variation?) |
Fetch document bytes (PDF, HTML, JPG) |
download_document(record, dest, output?, label?, variation?) |
Stream document to file (memory-efficient) |
list_tasks() |
List available task codes |
detail_task(code) |
Get task configuration |
run_task(code, payload?) |
Execute a task |
run_task_async(code, payload?) |
Run a long-running task and poll until done |
Paginated responses
list() returns the results directly as a list/array. Pagination metadata is
available as extra attributes:
count— total number of items across all pagesnext— URL of the next page (ornull)previous— URL of the previous page (ornull)
File Uploads
When data contains file objects, the client automatically switches from JSON to
multipart/form-data. Mix regular fields and files in the same call:
Document Views
Records may include public_view and/or view_token fields with JWT tokens
for rendering documents (invoices, orders, reports, etc.) as HTML, PDF, or images.
The SDK normalises both formats and builds the correct URL automatically:
get_document_views() returns a list of normalised view entries with label,
token, type ("public_view" or "view_token"), variations, and
default_variation. Use it to enumerate available views (e.g. for a dropdown).
Tasks
Tasks are server-side actions identified by a dotted code (e.g. myapp.export_report).
Long-running tasks
Some tasks run asynchronously on the server. When triggered, they return an id
that can be polled via bapp_framework.taskdata. Use run_task_async() to
handle this automatically — it polls until finished is true and returns the
final task data (which includes a file URL when the task produces a download).
License
MIT