Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Nov 28, 2024
1 parent 0081da3 commit 5b9542f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sda/cmd/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ Admin endpoints are only available to a set of whitelisted users specified in th
curl -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"accession_id": "my-id-01", "filepath": "/uploads/file.c4gh", "user": "testuser"}' https://HOSTNAME/file/accession
```

- `/file/verify/*accession`
- accepts `PUT` requests with an accession ID as the last element in the query
- triggers re-verification of the file with the specific accession ID.

- Error codes
- `200` Query execute ok.
- `404` Error due to non existing accession ID.
- `401` Token user is not in the list of admins.
- `500` Internal error due to DB or MQ failures.

Example:

```bash
curl -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"accession_id": "my-id-01", "filepath": "/uploads/file.c4gh", "user": "testuser"}' https://HOSTNAME/file/accession
```

- `/dataset/create`
- accepts `POST` requests with JSON data with the format: `{"accession_ids": ["<FILE_ACCESSION_01>", "<FILE_ACCESSION_02>"], "dataset_id": "<DATASET_01>", "user": "<SUBMISSION_USER>"}`
- creates a dataset from the list of accession IDs and the dataset ID.
Expand Down

0 comments on commit 5b9542f

Please sign in to comment.