Community

Authentication problems using Java codesample (HTTP 401 response code) Answered

Hi

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" java.io.IOException: Server returned HTTP response code: 401 for URL: http://cloud.ocrsdk.com/processImage?language=English&exportFormat=pdfSearchable
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.abbyy.ocrsdk.Client.processImage(Client.java:19)
    at com.abbyy.ocrsdk.AbbyyClient.main(AbbyyClient.java:10)

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

Thanks Sriniasan. C

Was this article helpful?

0 out of 0 found this helpful

Comments

4 comments

  • Avatar
    Nikolay_Kh

    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 cloudocrsdkbeta@abbyy.com Thanks!

    1
  • Avatar
    Nikolay_Kh

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

    0
  • Avatar
    Srinivasan Chokkalingam

    @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?

    0
  • Avatar
    Nikolay_Kh

    Basically, you need to loop a HTTP Get request of http(s)://cloud.ocrsdk.com/getTaskStatus?taskId=<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.

    0

Please sign in to leave a comment.