Machine Learning Extractor API Key issue

I am using API key which is under Document Understanding. Still I am getting below error

Source: Machine learning extractor

Message: Request is unauthorized. Please make sure that a correct API Key was provided.

Exception Type: UiPath.DocumentUnderstanding.ML.Activities.Exceptions.MLRequestException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
UiPath.DocumentUnderstanding.ML.Activities.Exceptions.MLRequestException: Request is unauthorized. Please make sure that a correct API Key was provided. ----> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (UNAUTHORIZED).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at UiPath.DocumentUnderstanding.ML.Activities.Services.MLClient.d__6`1.MoveNext()
— End of inner ExceptionDetail stack trace —
at UiPath.DocumentUnderstanding.ML.Activities.MachineLearningExtractor.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

@loginerror, can you please help on this

Whether you are copying the API key from the Licenses tab as shown below,


Yes Manish, I tried both API keys, which are under Computer Vision and Document Understanding.
I generated new keys and tried as well.

Hi @prat
DId you try upgrading the activities to the latest version and then using the new API key that is under Document understanding section?

Let know your findings.

Hi Lehiru,

Thank you. I tried in this way but still getting the same error

Are you typing the API in the API field and the url in the url field of the activity? Verify that

Any help on this? I’m getting the same error.

After opening a ticket, they helped me. It was the endpoint:

You have to add “?edition=community” or “?edition=enterprise” to the endpoint depending the version you have.

In my case I was using Enterprise so that was the fail. If you don’t specifiy one by default “Community” is assumed by the endpoint.