itk-dev / f2-api-client
F2 API client
Requires
- php: ^8.3
- ext-simplexml: *
- psr/cache: ^2.0 || ^3.0
- swaggest/json-diff: ^3.12
- symfony/cache: ^6.4 || ^7.4 || ^8.1
- symfony/console: ^6.4 || ^7.4 || ^8.1
- symfony/http-client: ^6.4 || ^7.4 || ^8.1
- symfony/http-foundation: ^6.4 || ^7.4 || ^8.1
- symfony/options-resolver: ^6.4 || ^7.4 || ^8.1
Requires (Dev)
- ergebnis/composer-normalize: ^2.52
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12
- rector/rector: ^2.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-06 09:55:29 UTC
README
API client for The cBrain F2 Platform.
See the F2 REST API documentation for details.
Installation
composer require itk-dev/f2-api-client
Usage
See F2ApiClientCommand for an example usage.
Testing
Edit .env.local and set these variables:
# .env.local F2_API_URI= F2_API_USERNAME= F2_API_SECRET= F2_F2_USERNAME= F2_API_TIME_ZONE=
Run
docker compose run --quiet --rm phpfpm composer install docker compose run --quiet --rm phpfpm php bin/f2-api-client getServiceIndex
to check that you can talk to the F2 API.
Note
We'll use task f2-api-client:run (cf. Taskfile.yml) as a shorthand for running docker compose run --quiet --rm phpfpm php bin/f2-api-client (cf. Development).
Use task f2-api-client:debug to debug with Xdebug.
Search cases with
task f2-api-client:run -- caseSearch test
See case details:
task f2-api-client:run -- caseById 2204
Development
For development (and testing) a couple of useful tasks are defined:
* f2-api-client:run: Run bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:run -- caseSearch 'test'`
* f2-api-client:debug: Debug bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:debug -- caseSearch 'test'`
F2 REST documentation
The F2 REST documentation is available only as a PDF (!), but we need something we can refer to. Therefore, we convert the PDF to HTML and serve that.
Run
task f2-rest-docs:serve
and open http://127.0.0.1:8787/.
---
title: F2 Conceptual model
---
%% https://mermaid.ai/open-source/syntax/classDiagram.html
classDiagram
Document --> Matter
Matter --> CaseFile
Party
Note --> CaseFile: (only if not related to Matter)
Note --> Matter: (only if not related to CaseFile)
Chat --> Matter
%% class Item{
%% +String title
%% }
%%
%% Item <|-- Document
%% Item <|-- Matter
%% Item <|-- CaseFile
Loading
The client MUST read the service index at runtime and use it to locate the links it needs.