A005 Referral Request using Integration environment

We are testing out the e-Referral Service FHIR API. We have so far tested the sandbox environment for various endpoints including A004 and A005. These work as expected via your ‘Try this API’ page, Postman and via C# code.

We are able to retrieve an access token (for application restricted access) via the https://int.api.service.nhs.uk/oauth2/token end point, but trying to use this access token to call the A004 or A005 endpoints. e.g. https://int.api.service.nhs.uk/referrals/FHIR/STU3/ReferralRequest/000000070000 results in a Server 500 error.

Specific Error message is:
“fault”: {
“faultstring”: “AssignMessage[AssignMessage.PopulateAsidFromApp]: failed to assign message to message”,
“detail”: {
“errorcode”: “steps.assignmessage.SetVariableFailed”

Thanks for any help or guidance

I have been stuck in the same error msg for over a week…
The auth method that I used, was ‘CIS2 combined authentication and authorisation’.

I just had a reply from API team.
Initial feedback suggests the application is missing an Accredited System Identifiers (ASID), more information can be found here Security and authorisation options for accessing the e-Referral Service API - NHS Digital under the section Accredited System Identifiers and message sets.

Apparently, I was using an application that was not created by the account that we applied with ASID originally.