Authentication problems using Java codesample (HTTP 401 response code)

  • Last Post 19 March 2012
  • Topic Is Solved
Srinivasan Chokkalingam posted this 19 March 2012


I have download the sample Java client application from github. I have my applicationid and application password But still I am unable to access the cloud and convert the document!

The error message that I am getting is as follows.

Exception in thread "main" Server returned HTTP response code: 401 for URL:
    at Source)
    at com.abbyy.ocrsdk.Client.processImage(
    at com.abbyy.ocrsdk.AbbyyClient.main(

Please advice me on this (Note : applicationid / application password is different from the cloud userid and password)

Thanks Sriniasan. C

Order By: Standard | Newest | Votes
Nikolay_Kh posted this 19 March 2012

Hi there! HTTP 401 response code stands for unauthorized request.

First, please make sure that you're using right Application ID & Application Password. You can find your AppID in your dashboard:

alt text

Keep in mind that capitalization and whitespaces matter.

Your Application Password was sent to you by e-mail when you created it. You can try to reset it (use Reset Application Password link in the dashboard).

If the above doesn't help, please send the piece of code where you perform authentication with the AppID and App password credentials that produce the error to Thanks!

Attached Files

  • Liked by
  • Andrey Isaev
Nikolay_Kh posted this 19 March 2012

I've converted this thread to a separate question for convinience.

Srinivasan Chokkalingam posted this 19 March 2012

@Nikolay_Kh, Thanks for the quick reply. It works for me. Can any one tell me how keep on pinging a particular task to understand whether the conversion is completed or not?

Nikolay_Kh posted this 19 March 2012

Basically, you need to loop a HTTP Get request of http(s)://<yourtaskid> until the status attribute in xml response has a state of "Completed".

You can refer to this quickstart guide and getTaskStatus method documentation for details.