Postman Approach Working with PDF Extract API, Having Trouble With R approach
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!
