HealthShare Exchange (HSX): API Connection

Tech: ruby, rails, dotenv, httparty, APIs!

Challenge: connect & query HSX’s API. Querying APIs is relatively new to me, and I wanted to capture the solution to a particular issue I encountered. The authorization POST required the params as a json body (specifically noted in the docs), but the GET required an URL query string (not specified in docs!). Basic, but was confusing for a minute.

Code:

auth with JSON body params

hsx_json_auth

provider query

hsx_get_query

 

Reference:

https://www.healthshareexchange.org/