Skip to main content
Inspiring
May 24, 2025
Answered

PDF Services API step-by-step

  • May 24, 2025
  • 1 reply
  • 388 views

Hi Adobe Community.

I can't make PDF Services API work. Here is what I do.

curl --location 'https://pdf-services.adobe.io/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'client_id={{Placeholder for Client ID}}' --data-urlencode 'client_secret={{Placeholder for Client Secret}}'

Response:

{"access_token":"{{access_token}}","token_type":"bearer","expires_in":86399}
curl -L -X POST 'https://pdf-services.adobe.io/assets' -H 'X-API-Key: cef2562e3499476c8d8543291a16f8f1' -H 'Authorization: Bearer {{Placeholder for access_token}}' -H 'Content-Type: application/json' -d '{"mediaType": "application/pdf"}'

Response:

{"uploadUri":"{{uploadUri}}?X-Amz-Security-Token={{Security-Token}}&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250524T071921Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=3600&X-Amz-Credential={{Credential}}&X-Amz-Signature={{Signature}}","assetID":"urn:aaid:AS:UE1:ad2257b2-5xxx-4f7b-xxxx-377xxxxxa08b"}
curl -L -g -X PUT '{{Placeholder for uploadUri}}' -H 'Content-Type: application/pdf' --data-binary '@{{Placeholder for PDF file path}}'

I don't receive a response from this last command.

When I access the uploadUri, the XML is:

<Error>
<Code>AuthorizationQueryParametersError</Code>
<Message>Query-string authentication version 4 requires the X-Amz-Algorithm, X-Amz-Credential, X-Amz-Signature, X-Amz-Date, X-Amz-SignedHeaders, and X-Amz-Expires parameters.</Message>
<RequestId>PMYTWEZEEFPKC93R</RequestId>
<HostId>52FkGL6t3tYRbVApF1Y0pOOi3n5jktZsCbPlN3ZmuJM3JSnbTFqq8hDKP9WtwJ1xkztawcP/1JE=</HostId>
</Error>

And in one ocasion I got:

<Error>
<Code>AuthorizationQueryParametersError</Code>
<Message>Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".</Message>
<RequestId>KWPHHSXKKFJDGXAS</RequestId>
<HostId>BwOSGUCPiRQt2bpAqc7oRPZCFWKlLlaBN7AnKarSPWxF0qKgzECc5+RkxI3VkKOnBmReiqlL1Pc=</HostId>
</Error>

Please help.

Correct answer vali_7981

what was the solution? please expand. thank you


Good question. Here is the solution:

https://medium.com/@valitabacaru/adobe-acrobat-services-pdf-services-api-bfe05bb6c0fb

 

1 reply

vali_7981Author
Inspiring
May 24, 2025

If I use double quotes

curl -L -g -X PUT "{{Placeholder for uploadUri}}" -H "Content-Type: application/pdf" --data-binary "@{{Placeholder for PDF file path}}"

I get this error when I access the uploadUri:

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<AWSAccessKeyId>ASIAWDXXXXPCFXXXXXG5</AWSAccessKeyId>
<StringToSign>AWS4-HMAC-SHA256 20250524T083024Z 20250524/us-east-1/s3/aws4_request 70d393daa8af5a4xxxxxx8aa19be8d87563xxxxxxe291fbdxxxxx206684xxxx5</StringToSign>
<SignatureProvided>21eda8dbb0xxxxxxxxxxfe10f6111xxxxxxxxe7144933e3xxxxxxxxx1fce46</SignatureProvided>
<StringToSignBytes>41 57 53 34 2d 
...
34 66 30 37 35 35</StringToSignBytes>
<CanonicalRequest>GET /cef2562e3499476c8d8543291a16f8f1_F0BC237F682DD4FC0A495E40%40techacct.adobe.com/44f44268-67f0-451f-b34e-41e816b3c69f X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAWD2N7EXXXXXXG5%2F20200000%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250524T083024Z&X-Amz-Expires=3600&X-Amz-Security-Token={{Security-Token}}&X-Amz-SignedHeaders=content-type%3Bhost content-type: host:dcplatformstorageservice-prod-us-east-1.s3-accelerate.amazonaws.com content-type;host UNSIGNED-PAYLOAD</CanonicalRequest>
<CanonicalRequestBytes>47 45 54 0a 2f 63 65 66 32 35 36 32 65 33 34 39 39 34 37 36 63 38 64 38 35 34 33 32 39 31 61 31 36 
...
4f 41 44</CanonicalRequestBytes>
<RequestId>WSTSVGX8QMXP9QQV</RequestId>
<HostId>9vG9E7iWsSDJG3TrdEC0EfACUyuCIvfBiwmcGtFfT/KGCMWm/Ny6izi9T6nZI8Svomj/6F455Ls=</HostId>
</Error>

 

 

vali_7981Author
Inspiring
May 31, 2025

Problem solved. Found the examples in the documentation. Thank you 

Participant
November 18, 2025

what was the solution? please expand. thank you