elixir-europe / MARS

Multi-Repository Data Submission using ISA-JSON
MIT License
5 stars 4 forks source link

BioSamples response as per receipt format #44

Open dipayan1985 opened 3 weeks ago

bedroesb commented 3 weeks ago

hey @dipayan1985, thanks a lot!

I was testing out the API using docker compose, and tried submitting a ISA JSON through the swagger page.

Depending on which ISA JSON I use, I get another error.

/test-data/biosamples-input-isa.json gives:

repository-services-isa_biosamples-1  | 2024-08-21 08:41:45.244 ERROR 1 --- [nio-8032-exec-7] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/isabiosamples] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: Failed to parse ISA Json and create samples in BioSamples] with root cause
repository-services-isa_biosamples-1  | 
repository-services-isa_biosamples-1  | org.springframework.web.client.HttpClientErrorException$BadRequest: 400 : "{"timestamp":"2024-08-21T08:41:45.104+00:00","status":400,"error":"Bad Request","message":"Sample must specify a domain","path":"/biosamples/samples/"}"

/test-data/ISA-BH2023-ALL/isa-bh2023-all.json gives:

repository-services-isa_biosamples-1  | 2024-08-21 08:45:04.531  INFO 1 --- [nio-8032-exec-9] .e.b.I.b.c.BioSampleSubmissionController : Failed to parse ISA JSON and get studies

I was wondering which ISA JSON you used to test it?

dipayan1985 commented 3 weeks ago

Hi @bedroesb wondering if you passed the webinJwt?

bedroesb commented 3 weeks ago

yes @dipayan1985 I did! using curl -u <your_aap_username>:<your_aap_password> https://api.aai.ebi.ac.uk/auth. It's also required, so I don't think I can submit without it :)

bedroesb commented 2 weeks ago

I managed to get it working using the right token generated by: https://wwwdev.ebi.ac.uk/ena/submit/webin/auth/swagger-ui/index.html#/AuthenticationAPI/getToken , giving

{
  "targetRepository" : "biosamples",
  "accessions" : [ {
    "id" : "SAMEA131351359"
  }, {
    "id" : "SAMEA131351360"
  } ]
}

But notice that normally the accession object contains the path of the ISA JSON, and not only the accession, see our repository api document.

bedroesb commented 2 days ago

@Pedram-A-Keyvani Is it ok if I merge this PR?