atlas-demo.ohdsi.org was recently moved from http to https (with auto redirect from http to https) as requested in this post:
Accessing WebAPI URL over SSL - #7 by cukarthik
I would recommend using the atlas-demo.ohdsi.org hostname to access the atlas-demo.ohdsi.org WebAPI instance, instead of api.ohdsi.org which will eventually move to the secure atlas.ohdsi.org WebAPI instance.
I added a call to content_type_json() to the R code and changed http to https and let WebAPI use the default vocabulary. If you want to specify a vocabulary you could include the string ‘SYNPUF5PCT’ (without the quotes) in the url.
You can use the below code:
library("jsonlite")
library("httr")
test_url <- sprintf("https://atlas-demo.ohdsi.org/WebAPI/vocabulary/relatedconcepts/")
test_json <- jsonlite::toJSON(
list(
CONCEPT_ID = list(436665),
CONCEPT_CLASS_ID = list("Clinical Finding"),
VOCABULARY_ID = list("SNOMED")
),
pretty = T, auto_unbox = T
)
resp <- httr::POST(test_url, body = test_json, content_type_json())
jsonlite::fromJSON(content(resp, "text"), simplifyVector = FALSE)