In general all add-ons have the ability to access the docupike API. With the API it is possible to interact or change the data of the application. In this section we will describe how the add-on can gain access to it.
To install the docupike API-Client it can be done via composer require docupike/api-client:^v1.0.0. After it has been installed the add-on can use the docupike API client which contains all necessary methods to interact with the data of the docupike application.
...// Create an object$id = $api->object->create([ 'title' => 'New Object', 'class' => 'Class-ID']);// Get the object data by id$objectData = $api->object->get('object-id');// Update an object$api->object->update('object-id', ['title' => 'Modified Object']);// Delete an object$api->object->delete('object-id');...
...// Create an entry in a category$id = $api->entry->create( 'category-id', ['property01' => 'value01']);// Get category entry data by id$entryData = $api->entry->get('category-id', 'entry-id');// Update an entry$api->entry->update('category-id', 'entry-id', ['property01' => 'modifiedValue01']);// Delete an entry$api->entry->delete('category-id', 'entry-id');...