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

Generating forbidden error 403 invalid client id

Community Beginner ,
Jan 29, 2024 Jan 29, 2024

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.

Screenshot (755).png

TOPICS
Bug

Views

553

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
Community Expert ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

@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

Votes

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

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.

Votes

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

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)

Votes

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

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.

Votes

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

Copy link to clipboard

Copied

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

Votes

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

Copy link to clipboard

Copied

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. 

Votes

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