API Call Internal Viktor Application

Description of the limitation and why it is relevant to address

We have a sub-module that is now part of different bigger applications. The only interface is an API-call (one-way) to get the params file as a dict (.json) through the API module.
This API call is done based on an SiblingEntityOptionField, however I would like to make an API call to application x - EntityType y.

Submitter proposed design (optional)

The data stored in this sub-module is saved in one database and can only be changed/updated in one place. A single request could do a call to the other module to return either a list of possible entities or based on a selected entity id return the corresponding data.
The aim is to be able to build a bigger Viktor application with multiple (or just two) smaller submodules with a simple API call.

Current workarounds

Have a defined manifest/names and directory structure and compare within the IDE after a new version, update the corresponding data for each module using the sub-module. Takes more effort and more sensitive for mistakes

Hi @Johan_Tuls,

If I understand your usecase correctly this is about data transfer between workspaces using the API. With the latest SDK release we have added the possibility to insert the workspace id and token in the api module, enabling you to use the api module also for cross workspace data transfer.

To support your usecase you need to:

  • add a personal access token to the app variables
  • use this personal access token + the right workspace id to initialize the API instance
  • call the methods you want to use :slight_smile:

in short:

workspace = API(token='XXXXXX').get_workspace(id=X)
workspace.get_entity(entity_id=X)

Hope this helps and solves your usecase