API client for The cBrain F2 Platform.
See the F2 REST API documentation for details.
composer require itk-dev/f2-api-clientSee F2ApiClientCommand for an example usage.
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 getServiceIndexto 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 testSee case details:
task f2-api-client:run -- caseById 2204For 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'`
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:serveand 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
The client MUST read the service index at runtime and use it to locate the links it needs.