Compound name mapping APIs NOT working

name.vec ← c(“1,3-Diaminopropane;2-Ketobutyric acid;2-Hydroxybutyric acid;2-Methoxyestrone”)
toSend = list(queryList = name.vec, inputType = “name”)

library(httr)

The MetaboAnalyst API url

call ← “https://rest.xialab.ca/api/mapcompounds

Use httr::POST to send the request to the MetaboAnalyst API

The response will be saved in query_results

query_results ← httr::POST(call, body = toSend, encode = “json”)

Check if response is ok (TRUE)

200 is ok! 401 means an error has occured on the user’s end.

query_results$status_code==200
[1] FALSE
query_results$status_code
[1] 500