Attention: Jupyter services at CINECA will be unavailable tomorrow, Thursday 16th October, for up to 1 hour for maintenance. You can still select Jupyter in JSC for your workloads. Thank you for your understanding


Wiki source code of Interacting with the drive

Last modified by allan on 2020/03/10 13:57

Hide last authors
villemai 1.1 1 == REST API ==
2
3 The drive is based on Seafile. Seafile comes with a restful API which allows you to interact with the content and libraries. You can find the documentation for the Seafile API here: [[https:~~/~~/download.seafile.com/published/web-api/home.md>>https://download.seafile.com/published/web-api/home.md]]
4
villemai 2.1 5 The Collaboratory.Drive is protected using OpenID Connect. The authentication is done by using [[access tokens>>https://tools.ietf.org/html/rfc6750#section-2.1]]. You need to have an application which the user logs into to obtain a token for the user. This application will need an OpenID Connect client to be registered. You can find instructions here: [[Creating Your OpenID Connect Client>>doc:Collabs.collaboratory-community-apps.Community App Developer Guide.WebHome||anchor="HCreatingyourOpenIDConnectclient"]].
villemai 1.1 6
7 (% class="box infomessage" %)
8 (((
9 In order to read from the Collaboratory.Drive, you currently need the `collab.drive` and `email` scopes. In the near future, you will need the `email` scope, as well as the`clb.drive:read` scope to access documents, and the `clb.drive:write` scope to make changes. You can already request these scopes to future proof your application.
10 )))
11
12 To authenticate to the API, you add an `Authorization` header to the HTTP request with the content `Bearer {TOKEN}`.
13
14
15 {{code language="bash"}}
allan 2.2 16 curl -H "Authorization: Bearer $access_token" https://drive.ebrains.eu/api2/...
villemai 1.1 17 {{/code}}
18
19