Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] batch endpoint

Jennifer Leigh Vendetti vendetti at
Tue Oct 4 12:08:40 PDT 2016

Hello Ben,

The curl application sends POST requests with a default content type of 'application/x-www-form-urlencoded'.  If you want to send a JSON request, the content type needs to be specified in the curl call.  In order to execute the example from our documentation, you could use something like this:

➜  ~ curl -vX POST -d @batch.json --header 'Content-Type: application/json' --header 'Authorization: apikey token=<your api key here>’

… which yields a successful result:

*   Trying
* Connected to<> ( port 80 (#0)
> POST /batch HTTP/1.1
> Host:<>
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Authorization: apikey token=
> Content-Length: 769
* upload completely sent off: 769 out of 769 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.10.1
< Date: Tue, 04 Oct 2016 18:56:24 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 8198
< Connection: keep-alive
< X-Rack-Cache: invalidate, pass
< Vary: Origin
< X-Content-Type-Options: nosniff
{"":[{"prefLabel":"Ontology Development and Management","synonym":[],"@id":"","@type":"","links":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":"","@context":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":""}},"@context":{"@vocab":"","prefLabel":"","synonym":""}},{"prefLabel":"Modular Component","synonym":[],"@id":"","@type":"","links":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":"","@context":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":""}},"@context":{"@vocab":"","prefLabel":"","synonym":""}},{"prefLabel":"Stimulator","synonym":[],"@id":"","@type":"","links":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":"","@context":{"self":"","ontology":"","children":"","parents":"","descendants":"","ancestors":"","instances":"","tree":"","notes":"","mappings":"","ui":""}},"@context":{"@vocab":"","prefLabel":"","synonym":"* Connection #0 to host<> left intact

Kind Regards,

On Sep 29, 2016, at 5:04 PM, Ben Leinfelder <leinfelder at<mailto:leinfelder at>> wrote:

I'm investigating BioPortal's "batch" endpoint - described here: - but haven't been able to retrieve results from it.

I've used your example, verbatim, to construct the json request and post it to the endpoint:
         curl -X POST -v -d @batch.json "" -H "Authorization: apikey token=<my token>"
But get this response:
        {"errors":["Batch endpoint only support calls to owl:Class resources"],"status":422}

Am I missing something?

Thank you,
Ben Leinfelder

bioontology-support mailing list
bioontology-support at<mailto:bioontology-support at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list