San K
San K

Reputation: 31

How to hit Microsoft language detection API through POSTMAN

I am running Language Detection Cognitive Service API locally(by using below command).

docker run --rm -it -p 5003:5003 --memory 1g --cpus 1 mcr.microsoft.com/azure-cognitive-services/speechservices/language-detection Eula=accept Billing=https://.api.cognitive.microsoft.com/sts/v1.0/issuetoken ApiKey=*** HTTP_PROXY=********

enter image description here

Issue: Getting 404 when i am hitting through Postman

enter image description here

Note: My cognitive service region is westeurope and Pricing tier F0

Please let me know right way to test locally running congnitive api

Upvotes: 0

Views: 584

Answers (2)

Nicolas R
Nicolas R

Reputation: 14619

Local Run

docker run --rm -it -p 5003:5003 --memory 1g --cpus 1 mcr.microsoft.com/azure-cognitive-services/speechservices/language-detection Eula=accept Billing=https://.api.cognitive.microsoft.com/sts/v1.0/issuetoken ApiKey=*** HTTP_PROXY=********

In your case, your Billing value is incorrect: you have set https://.api.cognitive.microsoft.com/sts/v1.0/issuetoken but you should use your Endpoint URI which is visible on your Azure resource Overview page, see below for my resource: Cognitive Resource Overview

This is well described in the official documentation (see here)

Consumption

Then, with your postman, you should call your local instance. In your capture, you are calling the API on Microsoft side (https://westeurope...). You should use http://localhost:5003/speech/languagedetection/cognitiveservices/v1 as visible in the swagger capture you posted

Upvotes: 0

codeninja
codeninja

Reputation: 1

@SanK, are you trying to do Speech Language Detection or TextAnalytics Language Detection? Because that is two different features, make sure your subscription register with the correct one.

Speech Language Detection - Detect the language from Speech. TextAnalytics Language Detection - Detect the language from Text.

Upvotes: 0

Related Questions