Skip to main content
Inspiring
November 19, 2020
Answered

BUG - Cannot connect to Embed API with API Key

  • November 19, 2020
  • 1 reply
  • 1758 views

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:

 

 

I don't get what's going wrong 🙂

 

The error:

 

 

Thanks a lot !

Gordon

    This topic has been closed for replies.
    Correct answer Gordon5F8E

    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?


    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

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    November 19, 2020

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

    Inspiring
    November 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 🙂 

    Inspiring
    November 19, 2020

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

    Here is the good one. Sorry again