This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ENA browser fasta endpoint returns 500, even on their own example

Hey everyone, just wanted to try and confirm that this is not a user error on my side. It seems like ENA browser API changed their accepted input format for the /fasta POST endpoint from form encoded to JSON since i last used it. However, i only get 500 internal server error responses from that endpoint, even when just using their example in the OpenAPI docs.

https://www.ebi.ac.uk/ena/browser/api/swagger-ui/index.html#/content-controller/getFastaPost

Edit: Note that this is also true for supplying an accession array with a valid accession such as

{
  "accessions": [
    "BN000065"
  ]
}

screenshot of endpoint documentation

screenshot of error

ena fasta

1 answer

This is autogenerated code, you need to replace the "string" in accessions: ["string"] with some real accession. Swagger doesn't extract parameters for HTTP POST messages because POST messages contain all the information in the message. If you want to see what needs to be specified, look at the same function with method GET below.

I know what you are saying, but a 500 is not what you expect as a response to input that is incorrectly supplied by the user. In fact, it even returns a 500 if you just supply a accession array with a valid accession.

Hmm, true. I checked with your accession both on their dev and prod systems with the same result. You can use their contact form to report the problem. In the meantime, you may consider the GET method instead. That works. Possibly, the POST methods are not working properly for this end-point.

Log in to answer this question.