• Resolved cbs040

    (@cbs040)


    Hi everybody,

    unfortunately I cannot generate a REST API key on our site.

    My steps:

    • Go to ‘WooCommerce -> Settings’
    • Click on ‘Advanced’
    • Click on ‘Rest API’
    • Insert description, user and Read/Write
    • I expected generated keys to show up including the QR code, but instead nothing happens, just a reload of the page.

      I am sure I have the Rest API enabled.I am using the latest version of WooCommerce and WordPress.
      I have already done debugging by disabling all plugins and enabling only Woocommerce and WordPress. Unfortunately the problem still exists then.

      Only on the REST API Settings Page the Conosle reports the following errors in backbone.js: Screenshot

      Uncaught TypeError: Cannot read property ‘extend’ of undefined
      at backbone.min.js:1

      Uncaught ReferenceError: Backbone is not defined
      at api-keys.min.js:1

      Does anyone have an idea where the problem might be?

      Thanks for the help and greetings
      Chris

    • This topic was modified 4 years, 10 months ago by cbs040.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey Chris,

    Thanks for sending over the screenshot. Backbone.js looks to be missing which is troublesome since it is included in the WordPress core. If I view the source of the add an API key screen, it does load backbone.

    You could try viewing the source in your Add API Key screen and see if Backbone is loading. It should have an address like this:

    
    https://yoursite.com/wp-includes/js/backbone.min.js?ver=1.4.0
    

    If you see it listed, copy the URL and then try and open it in a browser window and see if it loads. Perhaps it didn’t get copied into the site correctly during installation/updating. You might need to reinstall the WordPress files if that’s the case.

    Let me know what you find out and we’ll go from there.

    Thread Starter cbs040

    (@cbs040)

    Hi Three Sons,

    Thank you very much for your answer.

    I have already tried this and backbone is loading perfectly.
    During debugging I forgot to disable our theme. With the pure Twentytwenty theme it works. So it’s the theme, what exactly is the problem there, I can’t say.
    My workaround was to write API keys directly into the mysql database. Is there anything wrong with that?

    Thanks for the help and greetings
    Chris

    Hey Chris,

    I’m glad you found the source of the trouble. I would suspect that adding the keys manually would work. By default, they start with ck_ and cs_ so you may want to stick with that for clarity.

    If you do run into trouble, let me know.

    Cheers!

    Thread Starter cbs040

    (@cbs040)

    Hi,

    the workaround, works.
    For those who have a similar problem:
    I generated an API key set in a local installation and wrote them into the database of the live site.

    Cheers
    Chris

    Hi cbs040 Im having the similar issue that my woocommerce couldn’t identify the res_api_key table, says it does dnot exist, but it actually exist,

    Would you mind explaining me how did you add those keys in mysql manually?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘REST API key is not generated’ is closed to new replies.