Copy link to clipboard
Copied
we have created credentials (server to server authentication) as per te documentation and generated access token using rest api.
When trying to generate upload presigned URI using Java https://developer.adobe.com/document-services/apis/pdf-services/ using api key generated in credentials we are getting forbidden error http errocode 403 (error code: 403003) Clientid Id is invalid.
Copy link to clipboard
Copied
You posted to Using the Community, which is for questions about the forums. Your link goes to Adobe PDF Services API, so I've moved your post to the Acrobat Services API forum for you. Let us know if this is the right place for your question.
Jane
Copy link to clipboard
Copied
Can you show some of your code so I can see how you are making the call? The process should be - exchange client id + secret for an authorization token. That token is then used in your next call.
Copy link to clipboard
Copied
# Get access token (you may use your own method to obtain the token)
def get_access_token(client_id, client_secret):
auth_url = 'https://ims-na1.adobelogin.com/ims/token/v1'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {
'client_id': client_id,
'client_secret': client_secret,
'grant_type': 'client_credentials',
'scope':'openid AdobeID'
}
response = requests.post(auth_url, headers=headers, data=data)
return response.json().get('access_token', '')
# Combine PDFs using Adobe PDF Services API
def combine_pdfs(access_token, input_file1, input_file2, output_file):
api_url = 'https://pdf-services.adobe.io/operation/combinepdf'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
"inputs": [
{"url": f"file://{input_file1}"},
{"url": f"file://{input_file2}"}
],
"output": {"url": f"file://{output_file}"}
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
print(f"Combined PDF saved to: {output_file}")
else:
print(f"Error combining PDFs. Status code: {response.status_code}, Response: {response.text}")
# Get access token
token = get_access_token(client_id, client_secret)
# Combine PDFs
combine_pdfs(token, input_file1, input_file2, output_file)
Copy link to clipboard
Copied
You are missing the x-api-key header which should be your clientID value.
Also, files don't work that way for jobs. You need to upload them first and get the asset IDs, or use external files via the cloud storage systems we support.
Copy link to clipboard
Copied
Files are unable to Upload in Adobe Cloud, https://assets.adobe.com/cloud-documents
Copy link to clipboard
Copied
That isn't our API. You don't upload to Adobe Cloud per se, you upload to our internal storage system. When you properly use the Create Asset endpoint, you are given a URL to send your file to.