We’re trying to call A033 (https://digital.nhs.uk/developer/api-catalogue/e-referral-service-fhir#get-/R4/HealthcareService/-id-) via application-restricted and we’re getting this error back:
Endpoint not authorised for Business Function (PROVIDER_AUTHORISED_APPLICATION).
Looking at the docs, we need to be working in the context of a Referring Organisation. We’re already using other endpoints that require Service Provider Organisation, and they work fine, so I think this will be a role/permission issue, but I don’t know exactly what I’m missing.
Is there a specific role that I need to be using here, or is this something to do with the organisation this user is a member of?
Hi Jamie, thanks for your query.
The issue is that A033 is a referring-side endpoint, so requires the REFERRER_AUTHORISED_APPLICATION business function rather than the Provider one.
Therefore, it is easiest to change the NHSD-eRS-Business-Function header to value REFERRER_AUTHORISED_APPLICATION.
THis also applies to other read-only healthcare service endpoints (A030, A035 and A037). Your existing provider endpoints should continue to work with PROVIDER_AUTHORISED_APPLICATION as before. The two business functions are independent but can be used alongside each other.
Hope this helps.
George
Hi George,
Thanks for getting back to me. I’m not currently setting the NHSD-eRS-Business-Function header because I’m calling it via application-restricted, and the docs say that this header is only available for user-restricted. Should I be setting something else for application-restricted to change the business function?
Thanks,
Jamie
Hi @Jamie_Burns In the case of referrer app restricted, there is an attribute we will need to add to your application - sorry for the confusion. Can you post your app id and I’ll submit a request
Hi Tony,
Thank you, that would be great - my app id is 00b67abe-1fb0-4c3d-85e1-4a3d36f04487.
With this attribute set, will I still be able to use the same app to call PROVIDER_AUTHORISED_APPLICATION endpoints, or would I need to have separate apps for each type?
Thanks,
Jamie
2 Apps please! 
If you move into production in the future this is site level, so if you had say, 5 sites, it would be 1 app per auth mode, per site.
Sorry, should have said above, create a new app and send that over and I’ll send the request for the new one to be referrer app restricted.
Hi Tony,
Thanks for explaining, my new application id is da62210d-b0f6-49e6-a2d4-49b212a4d03d
Thank you.
Jamie
Hi Tony,
Just checking, do you have a rough idea of when this request might be applied to this new app please? Just so we can plan our work around it.
Thanks,
Jamie
Edit: just realised my message yesterday was a reply to my question, not a direct reply to you, so apologies if you didn’t get a notification for that message
Jamie - so sorry! We had some release activity to focus on, just made the request, shouldnt take more than a day or so - i’ll reply when complete.
That change is complete - ready to re-try! let me know if it works and i will mark as resolved on the forum
Hi Tony,
Thanks for sorting this, I can call that endpoint using this application now.
Thanks for your help,
Jamie
excellent. glad that is sorted! 