BUG - Cannot connect to Embed API with API Key

Community Beginner ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

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.png

 

I don't get what's going wrong 🙂

 

The error:

 

image.png

 

Thanks a lot !

Gordon

Views

194

Likes

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

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

Likes

Translate

Translate
Adobe Community Professional ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

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

Likes

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

Copy link to clipboard

Copied

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 🙂 

Likes

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

Copy link to clipboard

Copied

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

Here is the good one. Sorry again

 

image.png

Likes

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

Copy link to clipboard

Copied

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

Likes

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

Copy link to clipboard

Copied

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

Gordon5F8E_0-1605806201484.png

 

Likes

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

Copy link to clipboard

Copied

It doesn't* look...

Likes

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

Copy link to clipboard

Copied

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?

Likes

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

Copy link to clipboard

Copied

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

Likes

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

Copy link to clipboard

Copied

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

Likes

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

Copy link to clipboard

Copied

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

Likes

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