Text Moderation API - Issue with subscription key

2023-01-18T05:28:44.16+00:00

I tried to call the Text Moderation API from Postman.

Text Moderation API :- [https://centralindia.api.cognitive.microsoft.com/contentmoderator/moderate/v1.0/ProcessText/Screen?classify=True

Header : It required to pass - Ocp-Apim-Subscription-Key

To get Ocp-Apim-Subscription-Key, I followed the steps mentioned in the below link

[https://learn.microsoft.com/en-us/answers/questions/62385/please-help-me-to-find-the-process-to-get-ocp-apim

Once i get this key, called the Text Moderation API, But i got the error response given below. Kindly help us to resolve this issue.

{
    "error": {
        "code": "401",
        "message": "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."
    }
}

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,203 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,286 Reputation points Microsoft Employee
    2023-01-18T11:25:33.33+00:00

    @venkata hanuman chowdary somepalli The steps mentioned in the referenced thread refer to using the keys for the API management service. In this case you will have to use the content moderator resource and use the keys from the Keys + Endpoint blade. Please see the screen shot below.

    Search for "Content Moderator" in Azure portal and use the "Keys + Endpoint" blade to copy any one of the keys.

    User's image

    0 comments No comments