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

BUG - Cannot connect to Embed API with API Key

Community Beginner ,
Nov 19, 2020 Nov 19, 2020

Hello,

 

I activated the Embed API and, I think, I followed the instructions but it still not working.

 

When trying to access to the API with the key, I receive this:

 

This application domain (https://staging-ilha.herokuapp.com) is not authorized to use the provided PDF Embed API Client ID.

 

However, here is my setup:

 

image.pngexpand image

 

I don't get what's going wrong 🙂

 

The error:

 

image.pngexpand image

 

Thanks a lot !

Gordon

1.5K
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

correct answers 1 Correct answer

Community Beginner , Nov 19, 2020 Nov 19, 2020

The problem is fixed.

It was indeed a problem with the API KEY.
I did enabled another API in the same project, so the API was requesting me to send a JWT.
A created a separate project for this API and now it's working 🙂

Thx for the help

Translate
Community Expert ,
Nov 19, 2020 Nov 19, 2020

Can you supply the full JavaScript and HTML you are using?

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 ,
Nov 19, 2020 Nov 19, 2020

Yes sure, 

 

I'm using the React sample.

previewFile(divId, viewerConfig, fileUrl, meta) {
        const config = {
            /* Pass your registered client id */
            clientId: process.env.REACT_APP_ADOBE_KEY,
        };

 

Where my .env is returning the API_KEY

 

And for the HTML I added 2 scripts in the doc where the React APP is rendered.

 

  <head>
    <meta charset="utf-8" />
    <link rel="icon" type="image/png" href="%PUBLIC_URL%/favicon-196x196.png" sizes="196x196" />
    <link rel="icon" type="image/png" href="%PUBLIC_URL%/favicon-128.png" sizes="128x128" />
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="%PUBLIC_URL%/apple-touch-icon-152x152.png" />
    <script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
    <script src="https://documentcloud.adobe.com/view-sdk/2.10.3_1.10.0-1e3411b/ViewSDKInterface.js"></script>

    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="ILHA is an online musical school made by passionate artists.
      We're a community that loves music and connecting people."
    />

 

It locally woarks on local host when using the API_KEY provided with the REACT sample.

 

Thanks 🙂 

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 ,
Nov 19, 2020 Nov 19, 2020

Sorry, just realized that the error screenshot wasn't correct.

Here is the good one. Sorry again

 

image.pngexpand image

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 ,
Nov 19, 2020 Nov 19, 2020

Does it work if you use a string literal for the clientId?

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 ,
Nov 19, 2020 Nov 19, 2020

I didn't try, and I will, but it does look like the string is not received

Gordon5F8E_0-1605806201484.pngexpand image

 

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 ,
Nov 19, 2020 Nov 19, 2020

It doesn't* look...

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 ,
Nov 19, 2020 Nov 19, 2020

I haven't used React. Can you try the clientId with vanilla JS just to determine if it's the React code or a bad id?

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 ,
Nov 19, 2020 Nov 19, 2020

The problem is fixed.

It was indeed a problem with the API KEY.
I did enabled another API in the same project, so the API was requesting me to send a JWT.
A created a separate project for this API and now it's working 🙂

Thx for the help

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 ,
Nov 19, 2020 Nov 19, 2020

Good to hear. When you get the project completed, I'd love to see your use case if it's at a public URL. 

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 ,
Nov 19, 2020 Nov 19, 2020
LATEST

With pleasure.

We use it for music teachers, so they can share music sheets and put annotations on it to show to their students.

You can see it like an empowered zoom for music 🙂
I'll be more than happy to share. Adobe.io save my life on this

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