Adding an app to an existing Collab via API


#1

I am trying to add an app into an existing Collab using the API. I followed the instructions here:
https://collab.humanbrainproject.eu/#/collab/54/nav/1878
where I am required to provide a dict with the following info:

{
   "app_id": "6",
   "context": "b2dd87c4-7e5d-4eb4-a8fe-8e7668d0ce63",
   "name": "New Item",
   "order_index": "-1",
   "parent": "61",
   "type": "IT"
}

I can understand all the parameters, except for context where a UUID4 needs to be specified. I am curious why the user is expected to generate a UUID4 locally and submit this through the API, when creating a new app (I can understand the need for doing this for existing apps, where the apps already have a context which represents them). Isn’t it more appropriate to have the Collaboratory generate this when a valid request is received.

p.s. As this seemed quite unusual I tested with empty values for the context. In this case the app did get registered on the Collab, albeit not functional (not sure if that is something specific with my apps implementation… it worked fine when a UUID4 was generated as mentioned above). On viewing the collab info via the API, I saw that this new app continued to have an empty context parameter. So apparently the API is allowing contextless apps to get registered. Is this the expected behavior?

Any reason why this isn’t handled at the level of the Collaboratory?