Accessing api2pdf api via app connect

I posted about accessing and saving an file using a pdf api from server connect, but since I cannot get that right, I am trying to do this on app connect by send data needed in json object.

Problem is… I do not know what the heck I’m doing. No experience with API’s. Hope someone can give some guidance and help on how to set up the call on app connect. I have added the api action with url like this:

<dmx-api-action id="api1" noload="true" url="https://v2018.api2pdf.com/chrome/url" data-type="json"></dmx-api-action>

I need to autherise using header request. Not getting it right:

And then I want to send this and also not clue. Tried a couple of times, but getting error that api key and url not included in the call:

{
  "url": "https://www.github.com",
  "inlinePdf": true,
  "fileName": "test.pdf",
  "options": {
    "landscape": "true",
    "printBackground": false
  }
}

Please help :slight_smile:

I know you already have it working in Server Connect, but here how to set the authorisation header and data in App Connect

5 Likes

Thanks @patrick!

@Patrick - how can I use the above API action to generate a PDF of a page that is protected by a username/password? I noticed that the above works for a page that is not protected.

I don’t know how the api internally works, but you can try enabling basic authentication in the security provider and then pass the username and password in the url like https://username:password@domain.com/path.