Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

401 Errors Calling the Microsoft Luis.ai Programmatic API

ASKING THIS HERE AT THE EXPLICIT REQUEST OF THE MICROSOFT AZURE SUPPORT TEAM.

I've been attempting to call the MS Luis.ai programmatic API (bit.ly/2iev01n) and have been receiving a 401 unauthorized response to every request. Here's a simple GET example: https://api.projectoxford.ai/luis/v1.0/prog/apps/{appId}/entities?subscription-key={subscription_key}.

I am providing my appId from the Luis.ai GUI (as specified by the API docs), here:
Luis.ai App Settings App Id

I am providing my subscription key from Azure (as specified by the API docs), here:
Azure Console

The app ID and subscription key, sourced from above, are the exact same as what I'm using to hit the query API successfully (see note at bottom). My account is pay-as-you-go (not free).

Am I doing something wrong here? Is this API deprecated, moved, down, or out-of-sync with the docs?

NOTE: I can manipulate my model through the online GUI but that approach will be far too manual for our business needs where our model will need to be programmatically updated as new business entities come into existence.

NOTE: The programmatic API is different from the query API which has this request URL, which is working fine for me:
https://api.projectoxford.ai/luis/v2.0/apps/{appId}?subscription-key={subscription_key}&verbose=true&q={utterance}

NOTE: There doesn't seem to be a Luis.ai programmatic API for v2.0--which is why the URLs from the query and programmatic APIs have different versions.

like image 693
Pete Terlep Avatar asked Mar 10 '23 04:03

Pete Terlep


1 Answers

Answering my own question here:

I have found my LUIS.ai programmatic API key. It is found by: LUIS.ai dashboard -> username (upper-right) -> settings in dropdown -> Subscription Keys tab -> Programmatic API Key

It was not immediately obvious since it's found nowhere else: not alongside any of the other key listings in cognitive services or the LUIS.

like image 114
Pete Terlep Avatar answered Mar 23 '23 10:03

Pete Terlep