Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Nov 18, 2024
1 parent 1e147dd commit 761a9e0
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 @@ -57,6 +57,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 761a9e0

Please sign in to comment.