Stream: bulk data
Topic: Epic Bulk Data Export 401 Error
Robert Barrett (Dec 08 2021 at 20:00):
Hey all,
I'm implementing a FHIR integration in Python to pull data from Epic's sandbox environment. I wanted to see if anyone else has attempted this, or has had any issues with token authentication when doing the kick-off request.
Some notable information on my build/progress:
- I'm using https://fhir.epic.com/interconnect-fhir-oauth/oauth2/token to get the token
- The JWT passed back is valid and signed
- Per Epic's bulk export specification, I'm using https://apporchard.epic.com/interconnect-aocurprd-oauth/api/FHIR/R4/Group/eIscQb2HmqkT.aPxBKDR1mIj3721CpVk1suC7rlu3yX83/$export as the endpoint to request data from.
-
To the above url, in my get request, I pass the following headers:
'Accept':'application/fhir+json',
'Content-type' : 'application/fhir+json', <- I've also tried removing this as it isn't explicitly stated to be passed
'Prefer':'respond-async',
'Authorization' : 'Bearer ' + token -
I use a session to handle requests, and preserve the Authorization header by overriding NoRebuildAuthSession in requests.Session
The response from the get request comes back with a 401 error and the following information under www-authenticate:
Bearer error="invalid_token", error_description="The access token provided is not valid"
Any guidance would be helpful! I think I might be using the wrong endpoint but I'm totally stumped right now.
Grahame Grieve (Dec 08 2021 at 23:37):
https://stackoverflow.com/questions/70281101/issues-with-epic-bulk-data-request-401-error - please only ask in one place at a time
Robert Barrett (Dec 09 2021 at 02:36):
Apologies - I haven't used this forum before and wasn't sure if it was the appropriate place to ask questions pertaining to Epic.
Grahame Grieve (Dec 09 2021 at 03:23):
probably this is the best place
Cooper Thompson (Dec 09 2021 at 14:09):
For troubleshooting Epic sandbox auth issues, open@epic.com is probably the best support channel. Can you send your issue there, and include your client ID and the access token you got from the sandbox?
Justin Kenel (Dec 09 2021 at 19:48):
@Robert Barrett I've been running into a similar issue and have sent a similar e-mail to Epic. I _think_ in your case that the access token is invalid because you got a token from https://fhir.epic.com/interconnect-fhir-oauth/oauth2/token and are trying to use it against app orchard, which I believe is different.
Last updated: Apr 12 2022 at 19:14 UTC