Postman Approach Working with PDF Extract API, Having Trouble With R approach

New Here ,
Jun 27, 2021 Jun 27, 2021

Copy link to clipboard

Copied

I am getting 403 errors when I attempt to access the PDF Extract API using R (specifically the httr package).

 

The API works fine in Postman, and I have successfully used the following R code to generate a "Bearer" token:

 

r = POST(
  url = "https://ims-na1.adobelogin.com/ims/exchange/jwt/",
  body = list(
    client_id = {{Placeholder for client_id}},
    client_secret = {{Placeholder for client_secret}},
    jwt_token = {{Placeholder for jwt_token}}
  ),
  encode = "form"
)

access_token = content(r)$access_token
Authorization = paste("Bearer", access_token)

 

The "Bearer" token that I have generated using R works fine when I copy and paste it into Postman for posting a PDF file and getting the extracted JSON data. So far, so good.

 

But I get a 403 error if I try to use the same "Bearer" token (and my client_id) to get the same extracted JSON data into R using the following R code:

httr::GET(
  url = "https://cpf-ue1.adobe.io/ops/id/{{Placeholder for x-request-id}}",
  config = list(
    add_headers(
      Authorization = {{Placeholder for Bearer token}},
      "x-api-key" = {{Placeholder for client_id}}
    )
  ),
  verbose()
)

 

Has anyone else solved this problem, or is there any documentation for R users I may have missed? Thanks!

TOPICS
PDF Extract API

Views

474

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
New Here ,
Oct 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

Have you managed to solve this? Have the exact same issue

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
New Here ,
Oct 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

I'm afraid I'm still stuck at this point. I fell back to using one of the R packages to extract text from a large corpus of PDF files stored locally. The R package did a reasonably good job at this task, but I imagine the PDF extract API would have performed significantly better with the heavily formatted PDFs.

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
New Here ,
Oct 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

LATEST

I figured it out. In Postman go to headers of your POST call response and there is your parameter there.

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
Resources