Hi @Aurovind Sagar Epari Greetings! Thank you for question here.
I would like to point out that the API end point has a GET method implementation and not POST. Please refer the documentation - Device - Receive Device Bound Notification for more information.
I believe the same SAS token should work for both, right?
To answer this question, I would like to make a note that each shared access policy comes with a different set of permissions to it. For more information on this, please find the below details which can be found from IoT hub-level shared access policies
Since the API reads cloud-to-device messages, Device shared access policy should work in trying to fetch the result. You wouldn't explicitly need iothubowner policy credentials.
May I also know the steps you have followed to create the SAA token? Please find the below code for reference that would help guide you in generating the token with the correct format.
var generateSasToken = function(resourceUri, signingKey, policyName, expiresInMins) {
resourceUri = encodeURIComponent(resourceUri);
// Set expiration in seconds
var expires = (Date.now() / 1000) + expiresInMins * 60;
expires = Math.ceil(expires);
var toSign = resourceUri + '\n' + expires;
// Use crypto
var hmac = crypto.createHmac('sha256', Buffer.from(signingKey, 'base64'));
hmac.update(toSign);
var base64UriEncoded = encodeURIComponent(hmac.digest('base64'));
// Construct authorization string
var token = "SharedAccessSignature sr=" + resourceUri + "&sig="
+ base64UriEncoded + "&se=" + expires;
if (policyName) token += "&skn="+policyName;
return token;
};
Lastly, please ensure that you are calling this end point to an IoT Hub on Standard tier because this capability is only available in the standard tier IoT Hub.
Please let us know if you have any further questions or need additional information.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.