PersonGroup - List/Request URL

Adam 21 Reputation points
2020-12-04T06:31:21.823+00:00

HI
Very green user here - just getting my head around alot of this.

Using the console, I can retrieve the list no problems, but what I would like to know is, when i copy & paste the request url (https://australiaeast.api.cognitive.microsoft.com/face/v1.0/persongroups?top=1000&returnRecognitionModel=false) into my browser, i get this error code:
{"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."}}

Is this normal, because the url does not have my api key in the path?

I also get the same error, when i use a http request node in node red!!

just after some guidance
Thanks

Azure Face
Azure Face
An Azure service that provides artificial intelligence algorithms that detect, recognize, and analyze human faces in images.
158 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 43,696 Reputation points Microsoft Employee
    2020-12-04T07:01:19.583+00:00

    @Adam It looks like you pasted the link directly in your browser window. Please use the API console and provide your keys and the request body to get the response. Here is the link for Austraila.

    https://australiaeast.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395246/console

    You can add additional parameters and refine your results if required.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Harneet Singh 1 Reputation point
    2020-12-04T06:39:45.393+00:00

    You must use the same region in your REST API call as you used to obtain your subscription keys.
    For details refer to this link
    https://stackoverflow.com/questions/42123633/access-denied-due-to-invalid-subscription-key-face-api

    0 comments No comments

  2. Adam 21 Reputation points
    2020-12-04T06:42:47.743+00:00

    Thanks.
    My region matches the api url

    0 comments No comments

  3. Adam 21 Reputation points
    2020-12-06T12:11:34.65+00:00

    @romungi-MSFT
    Yes, Correct! I was pasting the link directly in my browser, and as I suspected, it didn't work because the subscription key was not present.
    I was trying to work out why my Node Red HTTP node was not working. It was because i was not passing the sub key in as a msg.header

    All working now.
    Thanks

    0 comments No comments