Workspace

A workspace is a collection of folders and files.

Postman collection: Workspace.postman_collection.json

Create a workspace

To create a workspace, you need to send an HTTP POST request to the /workspaces resource with parameters (FORM or JSON) :

  • alias: a unique identifier (alpha-numeric without space)
  • name: a workspace name
  • type: a workspace type (only USER is availabled for now)

If the workspace is created, a 201 HTTP code is returned. And the payload contains the workspace representation in JSON format. When the alias already exists, the server return a 409 HTTP Code.

Resource URL: https://repository.ortolang.fr/api/workspaces

Get information about a workspace

The JSON representation of a workspace is accessible by sending a HTTP GET request with the workspace key in the request path. When the parameter md is set to true, the response contains the metadata representation.

Resource URL: https://repository.ortolang.fr/api/workspaces/{wskey}

Create a folder in a workspace

A folder may be created by sending a HTTP POST request with a body in multipart/form format. Mandatory parameters are: path and type (must be collection).

The list of parameters is:

  • path: the path to the folder
  • type: the type of element (collection in this case)

Resource URL: https://repository.ortolang.fr/api/workspaces/{wskey}/elements

Upload a file to a workspace

As for the creation of a folder, the creation of a file is done by sending an HTTP POST request with a multipart/form body. The mandatory parameters are: path and type (must be object).

A file can be updated by the same mechanism or by sending a HTTP PUT request with a body in JSON format.

The list of parameters is:

  • path: the path to the file
  • type: the type of element (object in this case)
  • stream: the file content

Resource URL: https://repository.ortolang.fr/api/workspaces/{wskey}/elements

Get information about an element

Retrieves information about an element by sending a HTTP GET request.

List of parameters:

  • path: the path to the element (mandatory)
  • root: the version of the workspace (the value head is for the current content)
  • metadata: allows to retrieve a specific metadata element
  • policy: allows to get information about the publication policy

Resource URL: https://repository.ortolang.fr/api/workspaces/{wskey}/elements

Delete a file

Delete an element by sending a HTTP DELETE request.

List of parameters:

  • path: the path to the element (mandatory)
  • root: the version of the workspace (the value head is for the current content)
  • metadataname: to delete a metadata element
  • force: delete the folder even if it is not empty

Resource URL: https://repository.ortolang.fr/api/workspaces/{wskey}/elements