Hi Hamidreza,
Based on the error message, it seems that the API you are trying to access does not support delegated context, which means that you cannot use delegated permissions to access the API. Instead, you need to use application permissions to access this API.
To fix this issue, you should modify the permission settings for your Azure Active Directory App Registration and add the necessary application permissions to access the required API. You can refer to the following guide to learn how to add application permissions to your app:
https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-add-app-roles-in-azure-ad-apps
Once you have added the necessary permissions to your app, you should use the appropriate authentication flow to obtain an access token with application permissions. You can refer to the following guide to learn how to use the client credentials flow to obtain an access token with application permissions:
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
After obtaining the access token, you should use it to make the API request to retrieve the channel messages.
I hope this helps!