diff --git a/docs/src/content/docs/for-users/approve-submissions.md b/docs/src/content/docs/for-users/approve-submissions.md index bab64d2d7..5cef1d45a 100644 --- a/docs/src/content/docs/for-users/approve-submissions.md +++ b/docs/src/content/docs/for-users/approve-submissions.md @@ -4,7 +4,7 @@ title: Approve submissions Once you've uploaded sequences (this applies for new submissions as well as revisions and revocations), you will have to approve them before they are fully submitted. -# Website +## Website After submitting sequences, you'll be taken to a page showing the progress of processing every sequence. For each sequence, it will show whether its awaiting processing, being processed, or has finished processing. @@ -36,6 +36,67 @@ Releasing: You can release all valid sequences (those without warnings or errors If you leave any sequences unreleased, you can view, edit, and release (if they have no errors) them at a later time. -# API +## API -_Instructions coming soon_ +The following API requests all require an authentication token. Please read [Authenticating via API guide](../authenticate-via-api/) for the instructions to obtain the token an include the token in the HTTP header `Authorization: Bearer `. + +You also need to identify the URL to the backend of the Loculus instance. Usually, it is at `https://backend.`. You can find the exact link in the instance-specific Backend API Documentation which you can find by going to the "API docs" linked in the footer. + +You can retrieve a list of uploaded but not released sequences by sending a GET request to the endpoint: + +``` +//get-sequences?groupIdsFilter=&statusesFilter=RECEIVED&statusesFilter=IN_PROCESSING&statusesFilter=HAS_ERRORS&statusesFilter=AWAITING_APPROVAL&warningsFilter=INCLUDE_WARNINGS +``` + +The `sequenceEntries` field of the returned object contains a list of sequences with their corresponding `status`: + +- Sequence that are in the status `RECEIVED` have not yet been processed. This should usually happen within a few minutes. +- Sequences that are in the status `IN_PROCESSING` are currently being processed, please wait a few more moments. +- Sequences that are in the status `HAS_ERRORS` contain errors. To find out details, we recommend going to the review page on the website: you can find it by going to the Submission Portal and clicking on "Review". +- Sequences that are in the status `AWAITING_APPROVAL` have passed the processing and quality checks and can be approved. + +A cURL request could be: + +``` +curl -X 'GET' \ + '//get-sequences?groupIdsFilter=&statusesFilter=RECEIVED&statusesFilter=IN_PROCESSING&statusesFilter=HAS_ERRORS&statusesFilter=AWAITING_APPROVAL&warningsFilter=INCLUDE_WARNINGS' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer ' +``` + +You can either approve selected sequences or approve all sequences that are in the status `AWAITING_APPROVAL`. To do that, send a POST request to `//approve-processed-data` with the following request body: + +``` +// For a specific list of sequences: +{ + "accessionVersionsFilter": [ + { "accession": "", "version": }, + … + ], + "groupIdsFilter": [], + "scope": "ALL" +} + +// Or to approve all entries without errors (which may include sequences with warnings): + +{ + "groupIdsFilter": [], + "scope": "ALL" +} +``` + +A cURL request could be: + +``` +curl -X 'POST' \ + '//approve-processed-data' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "groupIdsFilter": [], + "scope": "ALL" +}' +``` + +Further information can be found in the API documentation of the instance. diff --git a/docs/src/content/docs/for-users/create-manage-groups.md b/docs/src/content/docs/for-users/create-manage-groups.md index 21f435eab..48d541da6 100644 --- a/docs/src/content/docs/for-users/create-manage-groups.md +++ b/docs/src/content/docs/for-users/create-manage-groups.md @@ -37,4 +37,3 @@ Any group member can edit all group information such as the group name, contact 2. Within your groups, select the name of the group that you would like to edit 3. In the group detail view, click the 'Edit group' button at the top 4. Update any information in the edit group form that you would like to change and then click the 'Update group' button - diff --git a/docs/src/content/docs/for-users/submit-sequences.md b/docs/src/content/docs/for-users/submit-sequences.md index a427ff5ca..203aa27a6 100644 --- a/docs/src/content/docs/for-users/submit-sequences.md +++ b/docs/src/content/docs/for-users/submit-sequences.md @@ -31,4 +31,32 @@ The data will now be processed, and you will have to approve your submission bef ## API -_Instructions coming soon_ +It is possible to upload sequences through an HTTP API. We also plan to release a command-line interface soon. + +To upload sequences through the HTTP API you will need to: + +1. Identify the URL to the backend of the Loculus instance. Usually, it is at `https://backend.`. You can find the exact link in the instance-specific Backend API Documentation which you can find by going to the "API docs" linked in the footer. +2. Retrieve an authentication JSON web token: see the [Authenticating via API guide](../authenticate-via-api/). +3. Identify the Group ID of your group: you can find it on the page of your group. +4. Send a POST request: + - To upload sequences with the **open use terms**: `//submit?groupId=&dataUseTermsType=OPEN` + - The header should contain + - `Authorization: Bearer ` + - `Content-Type: multipart/form-data` + - The request body should contain the FASTA and metadata TSV files with the keys `sequenceFile` and `metadataFile` + +With cURL, the corresponding command for sending the POST request can be: + +``` +curl -X 'POST' \ + '//submit?groupId=&dataUseTermsType=OPEN' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: multipart/form-data' \ + -F 'metadataFile=@' \ + -F 'sequenceFile=@' +``` + +Further information can be found in the API documentation of the instance. + +As with the website, data will now be processed, and you will have to approve your submission before it is finalized. You can see how to do this [here](../approve-submissions/).