Document Generation API Problem

Community Beginner ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

I have tried a multitude of different ways to connect to Postman API. I am finally connecting without a problem on POSTMAN however I am having issues connecting and saving the edited document on my webpage.  

 

On my POSTMAN it shows the GET request as status 200 Completed 'true'. On my webpage it shows GET request as status 202 completed "false". What am I doing wrong? Do I need to use entirety of path to show where input document is located? 

 

I will update if I solve the issue on my own by changing some variables around and seeing responses.

 

I posted my code to stackoverflow and removed private information (api key, bearer token, etc).  Here is link

https://stackoverflow.com/questions/67575093/how-to-return-pdf-file-from-php-curl-request-to-adobe-a...

If you ain't First, you're Last - Ricky Bobby
TOPICS
PDF Embed API, PDF Extract API, PDF Services API

Views

87

Likes

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

Adobe Employee , May 17, 2021 May 17, 2021
Hi @defaultrj2mvr5co7mk , You actually aren't doing anything wrong. If you are getting the status of completed = "false", then you will need to make a request to get the generated document from the poll URL. To get that, look in the response header for a location parameter. Copy that URL in the location. Run a separate call to that URL, passing your auth and x-api-key that you have for your generation request. You will then get a multipart response.

Likes

Translate

Translate
Adobe Employee ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

Hi @defaultrj2mvr5co7mk ,

 

You actually aren't doing anything wrong. If you are getting the status of completed = "false", then you will need to make a request to get the generated document from the poll URL.

  1. To get that, look in the response header for a location parameter.
  2. Copy that URL in the location.
  3. Run a separate call to that URL, passing your auth and x-api-key that you have for your generation request.
  4. You will then get a multipart response.

 

 

Likes

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 ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

LATEST

Thank you for the quick response. I watched your video the other day on adobe document integration and it was extremely helpful for a novice like me to get off the ground with your API. Unfortunetly since I use CPANEL using one of the SDK's was next to impossible for me, so I decided to set up the API connection myself. I have not handled pdf's before via API, so I was a bit confused in transfering the octet stream data format into pdf format. But now I understand completely after tinkering with it for a while. I will post my complete code in stack overflow here shortly just in case someone else has an issue like this in the future.

 

Oh and the status of 202 instead of 200 was just because I was making the CURL request one after the other and didnt give the API enough time to parse through the document. After waiting a few additional seconds I resent the POLL request and it came back with status 200 and the octet stream of pdf document.

Thanks again,

If you ain't First, you're Last - Ricky Bobby

Likes

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