OHDSI Home | Forums | Wiki | Github

Is the ATLAS Demo WebAPI Not Working?

Hi all,

Was working on creating a network study and we ran into an issue where some of the queries we have been running against the WebAPI have been returning ERROR CODE 500 which suggest that there is an error on the WebAPI server for https://atlas-demo.ohdsi.org/

Here is an example query that we tried running that used to work against the ATLAS demo but no longer:

library("jsonlite")
library("httr")

test_url <- sprintf("http://atlas-demo.ohdsi.org/WebAPI/vocabulary/%s/relatedconcepts/", 13746004)
test_json <- jsonlite::toJSON(
  list(
    CONCEPT_ID = list(436665),
    CONCEPT_CLASS_ID = list("Clinical Finding"),
    VOCABULARY_ID = list("SNOMED")
  ),
  pretty = T, auto_unbox = T
)
httr::POST(test_url, body = test_json, encode = "json")

Here is what we now get:

{
    "payload": {
        "cause": null,
        "stackTrace": [],
        "message": "An exception occurred: javax.ws.rs.NotAllowedException",
        "localizedMessage": "An exception occurred: javax.ws.rs.NotAllowedException",
        "suppressed": []
    },
    "headers": {
        "id": "a2b7043f-37a0-37ee-861f-1a46a08083a8",
        "timestamp": 1634680466615
    }
}

Could anyone please help me?
We have also opened an issue here describing the problem further: https://github.com/OHDSI/WebAPI/issues/1951

Thank you!

According to the source code as of the v2.9.0 release, the only endpoint that matches that is via {sourcekey}/relatedconcepts, where you post a concept list.in the form you gave it (tho, i’m not sure your list of lists yields exactly the correct json format).

Are you sure you are passing in the right ‘sourcekey’ paramater? a sourcekey of 13746004 doesn’t look right.

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)
1 Like

Hey @admin - this worked perfectly! Super appreciate the help here! I missed seeing the upgrade take place recently and thought we had run into an issue with WebAPI as I also had a colleague test it and get the same errors we were getting on work that previously had functioned for them.

Thanks for the help! Posted your solution back to GitHub for posterity.

P.S. Thanks for the comment as well @Chris_Knoll - with your feedback here, we also identified a bug and solved it with your suggestion by double checking some of our formatting.

Thanks and all the best!

~ tcp

t