cancel
Showing results for 
Search instead for 
Did you mean: 

Internal API error - while rendering PDF using Rest APIs with templates from template store

Sharadha1
Active Contributor
0 Kudos
891

Hi,

Previously I was able to render PDFs in SAP Cloud Platforms Forms by Adobe using Rest APIs from a Java program (https://blogs.sap.com/2018/11/08/generate-pdfs-in-the-cloud-sap-forms-by-adobe/comment-page-1/#) . Now I am trying to render the PDF from a UI5 application while reading the template from the template store.

I have done the following steps without any issue..

1. Uploaded the template in Template Store

2. Generated OAuth

3. Created destination for /ads.restapi with the token service URL to use the oAuth credentials.

4. consume the destination and was able to upload and read forms/templates to the template store using Rest API (Get /forms. POST /forms).

Now, when I try to use the same destination to call the PDF rendering API (/adsRender/pdf) by passing the query parameter ?templateSource = storageName or ?templateSource = storageId and the xdpTemplate values as <formname>/<templatename>, I am getting the error as below

screenshot-2019-09-30-at-210134.png

For testing if the call is actually going through, I tried removing the query parameter (keeping the same value for xdpTemplate) and I got a validation error as expected. FWIW, the same destination works perfectly fine for all the Template Store APIs but does not seem to work for the PDF rendering API.

Any one facing this issue? Any pointers on the solution? Seems like a product issue to me.

-Sharadha

Accepted Solutions (1)

Accepted Solutions (1)

Sharadha1
Active Contributor
0 Kudos

Found the cause of this issue. The 'ADS' destination credentials was not set properly. 'ADS' destination under 'Rest API Roles and destinations' MUST return an error of 500.

If it returns a success message like below, then the destination is set up incorrectly. check the credentials again.

It is weird but this was the cause of the issue above.

Answers (4)

Answers (4)

Sharadha1
Active Contributor
0 Kudos

Glad I could help!

-Sharadha

Sharadha1
Active Contributor
0 Kudos

Then the url seems to be wrong. did you change the destination which gets created automatically? In my account, the url is 'https://adsformsprocessing-s0XXXXXtrial.hanatrial.ondemand.com/ads.web/AdobeDocumentServicesSec/Config'

Please try changing the destination.

-Sharadha

ankesh_jindal4
Participant
0 Kudos

Hi Sharadha Krishnamoorthy,

It's working, you are Awesome. I can see PDF generated.

Regards,

Ankesh

0 Kudos

Hi Sharadha Krishnamoorthy,

I am getting the below internal API error and I do see that the ADS destination response is coming as "200" OK. But I am not able to understand , what to do to get 500 error so that REST API call works. The URL in ADS destination is correct in my case as you mentioned above. I am trying to make a post call from POSTMAN client.

Error:

{ "message": "Internal API Error", "results": "ADS Authentication Error", "trace": "ADS refused to process your request. Destination credentials might be wrong.", "errorLevel": "D101" }

Do you have any pointer here?

I posted a question here with screenshots and more details on what I did.

Thanks,

Neha Goyal

ankesh_jindal4
Participant
0 Kudos

Hi Sharadha Krishnamoorthy,

I am also referring to same Destination which is at SAP Cloud platform cockpit -> services ->SAP Forms by Adobe -> Rest API Roles & Destination.

For this I am getting Status as Success (200)

Regards,

Ankesh Jindal

ankesh_jindal4
Participant
0 Kudos

Hi Sharadha Krishnamoorthy,

My destination shows 200 response but I am still getting same error

"Authentication Error: Could not redirect to ADS because could not get the RelayState value from the request. Destination credentials might be wrong."

Sharadha1
Active Contributor
0 Kudos

Hi Ankesh,

Please check the destination 'ADS' which is under SAP Cloud platform cockpit -> services ->SAP Forms by Adobe -> Rest API Roles & Destination. I am mentioning about that destination in my answer.

-Sharadha