Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BioSamples response as per receipt format #44

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Conversation

dipayan1985
Copy link
Collaborator

No description provided.

@dipayan1985 dipayan1985 requested a review from bedroesb August 19, 2024 10:33
@bedroesb
Copy link
Member

bedroesb commented Aug 21, 2024

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
Copy link
Collaborator Author

Hi @bedroesb wondering if you passed the webinJwt?

@bedroesb
Copy link
Member

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
Copy link
Member

bedroesb commented Aug 26, 2024

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
Copy link
Member

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

@Pedram-A-Keyvani
Copy link
Collaborator

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

Sure!

@bedroesb bedroesb merged commit b901090 into main Sep 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants