MESH Endpoint Lookup Service - help please

I believe it’s https://192.168.128.11/messageexchange but haven’t had time to check.

1 Like

Did you get an answer to the original question.

The API documentation has moved to Message Exchange for Social Care and Health (MESH) API - NHS Digital

Slightly different problem

I can call the opentest version of lookup with no issues

https://192.168.128.11/endpointlookup/mesh/SCREEN2/SPINE_GPCAPITATION_EXTRACT

However when I try to do an inbox query

https://192.168.128.11/messageexchange/Y90638OT002/inbox

I get 403 error.

I’m presuming I have got something wrong with my Authorization header (as both spine and mesh certs appear to be ok with the endpointlookup call)

Presume the HMACSECRETKEY is always ‘BackBone’?

I think my error is around this:

Is the hmac_msg in this call base64 encoded, some NEMS documentation seems to indicate it is?

UPDATE

Was a problem with how I was build the hash

public static String getHash(String data, String key)
    {
        String algorithm = "HmacSHA256";
        try {
            SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(), algorithm);
            Mac mac = Mac.getInstance(algorithm);
            mac.init(secretKeySpec);
            byte[] result = mac.doFinal(data.getBytes());
            return Hex.encodeHexString(result);
        }
        catch (Exception ex) {
            return ex.getMessage();
        }
    }

I found this on github which I found a lot clearer to understand :slight_smile:
integration-adaptor-nhais/mesh.sh at develop · nhsconnect/integration-adaptor-nhais · GitHub