0

I have used the Subscription ID in my App and am getting following error at runtime.

Error Domain=POFaceServiceClient error - http response is not success : 
                {"error":{"code":"Unspecified","message":"Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."}}
                     Code=401 "(null)"

I taken the ID from the Keys after creating a new service. I even regenerated them. Every time I run the program, same error is thrown.

Hope you guys have a fix.

Cheers!

Aakash Dave
  • 866
  • 1
  • 15
  • 30
  • Have you tried https://stackoverflow.com/questions/42123633/access-denied-due-to-invalid-subscription-key-face-api ? – nathan Jul 30 '17 at 21:12
  • Yup! Been there, done that. Didn't work! – Aakash Dave Jul 30 '17 at 21:30
  • Is your API key for West US? The github [sample](https://github.com/Microsoft/Cognitive-Face-iOS/blob/e67a1ff0fb0d0ccb2ff7f121c9831765c6814c45/Example/ProjectOxfordFace/MPOAppDelegate.h#L36) is hard-coded to westus. – cthrash Jul 30 '17 at 21:30
  • No. Its not. I've gone with the southwest asia option. – Aakash Dave Jul 30 '17 at 21:33
  • And you changed `ProjectOxfordFaceEndpoint` to reflect this? It should be `https://southeastasia.api.cognitive.microsoft.com/face/v1.0/` – cthrash Jul 30 '17 at 21:58
  • Yes! Tried that. I am getting the following error : `Error Domain=POFaceServiceClient error - http response is not success : { "statusCode": 404, "message": "Resource not found" } Code=404 "(null)"` – Aakash Dave Jul 31 '17 at 07:42

1 Answers1

2

I could fix it finally. :)

Over creating the API KEY, just make sure that you supply for westus server and the endpoint should be:

https://westus.api.cognitive.microsoft.com/face/v1.0

In my case, it works.

Hamid Hoseini
  • 1,560
  • 17
  • 21