Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

Generating forbidden error 403 invalid client id

Community Beginner ,
Jan 29, 2024 Jan 29, 2024

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.

Screenshot (755).png

TOPICS
Bug
1.3K
Translate
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
Community Expert ,
Jan 29, 2024 Jan 29, 2024

@irfan35097768aoc2 

 

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

Translate
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
Adobe Employee ,
Jan 29, 2024 Jan 29, 2024

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.

Translate
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
Community Beginner ,
Jan 30, 2024 Jan 30, 2024

# 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)

Translate
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
Adobe Employee ,
Jan 30, 2024 Jan 30, 2024

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.

Translate
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
Community Beginner ,
Feb 07, 2024 Feb 07, 2024

Files are unable to Upload in Adobe Cloud, https://assets.adobe.com/cloud-documents

Translate
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
Adobe Employee ,
Feb 07, 2024 Feb 07, 2024
LATEST

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. 

Translate
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