• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting the following error when converting pdf to word ServiceApiException 'Access Forbidden

Community Beginner ,
Jun 19, 2023 Jun 19, 2023

Copy link to clipboard

Copied

com adobe pdfservices operation exception ServiceApiException: description ='Access Forbidden; transactionId=xxxxxxxxx'; requestTrackingId='xxxxxxxu'; statusCode=403; errorCode=FORBIDDEN

 

What is the exact error for this message? 

TOPICS
Authentication , Java SDK , PDF Services API

Views

359

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 24, 2023 Jun 24, 2023

Hi solved this problem you need to update the SDK to the latest version.

Votes

Translate

Translate
New Here ,
Jun 23, 2023 Jun 23, 2023

Copy link to clipboard

Copied

I am facing the exact same issue. It's working in other application but that same code and adobe credentials does not work with the other application. I created free adobe account and used that one for converting docx to pdf but that account also not working.

 

To find out the exact error, I implemented the Adobe.PDFServiceSDK classes to my app. So, here is the code:

public static HttpBaseResponse<T> CPFStatusApi<T>(InternalExecutionContext context, string location, string targetFormatExtension)
        {
            HttpBaseRequest baseRequestFromRequestContext = context.GetBaseRequestFromRequestContext(RequestKey.STATUS);
            baseRequestFromRequestContext.SetUriTemplate(location);
            baseRequestFromRequestContext.SetTargetFormatExtension(targetFormatExtension);
            HttpClient instance = HttpClient.GetInstance(); 
            try
            {
                HttpBaseResponse<T> httpBaseResponse = instance.Execute<T>(baseRequestFromRequestContext);

                int millisecond = DateTime.Now.Millisecond;
                while (httpBaseResponse.ResponseCode == HttpStatusCode.Accepted)
                {
                    if ((long)(DateTime.Now.Millisecond - millisecond) > 600000L)
                    {
                        throw new ServiceApiException("Operation execution has timed out!", StringUtil.GetRequestIdFromLocation(location), 0);
                    }

                    try
                    {
                        Thread.Sleep(1000);
                    }
                    catch (ThreadInterruptedException inner)
                    {
                        throw new SDKException("Thread interrupted while waiting for operation execution status!!", inner);
                    }

                    httpBaseResponse = instance.Execute<T>(baseRequestFromRequestContext);
                }

                return httpBaseResponse;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return null;
        }

 statusResponseContent of the instance object is:

{"cpf:inputs":{"documentIn":{"dc:format":"application/pdf","cpf:location":"file1"},"params":{"cpf:inline":{"targetFormat":"docx"}}},"cpf:engine":{"repo:assetId":"urn:aaid:cpf:Service-26c7fda2890b44ad9a82714682e35888"},"cpf:status":{"completed":true,"type":"","title":"Access Forbidden; transactionId=gVET6L2RYFLjE0uKnntIUUaG3xOFJ29J","status":403,"report":"{\"error_code\":\"FORBIDDEN\"}"}}

 and then instance.Execute also retuns the "Access Forbidden" with 403 status code.

This is frustrating and nightmare for me. Any help is highly appreciated.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 24, 2023 Jun 24, 2023

Copy link to clipboard

Copied

LATEST

Hi solved this problem you need to update the SDK to the latest version.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources