• Resolved averydev

    (@averydev)


    Hi there!

    I’m working on an app that works with our customer’s WooCommerce stores via the Rest API. I’m hoping to avoid making sure they have their permalinks set to pretty because it’s a barrier to integrating, and I’d like to use the lowest common-denominator if possible.

    I noticed that I’m able to access the api: i.e.
    https://my-wc-store.com?rest_route=/wc/v1/
    with no problems, and when watching API access logs, all sub-routes are sent along to the correct place.

    However, authentication fails unless i use the /wp-json format urls. i.e. https://my-wc-store.com/wp-json/wc/v1/products

    I don’t see anything in the WC auth code that would prohibit the query param version from working, though the docs do say it’s unsupported… I’m not sure if there’s a simple way to achieve the goal.

    I’ve tried the approach of passing the keys / secret in as query params, as well as with the authorization token with no luck.

    The only endpoints we’re going to use are the endpoints are /products and /webhooks

    Thanks!

    • This topic was modified 7 years, 6 months ago by averydev.
Viewing 1 replies (of 1 total)
  • con

    (@conschneider)

    Engineer

    Hi there,

    I don’t see anything in the WC auth code that would prohibit the query param version from working, though the docs do say it’s unsupported… I’m not sure if there’s a simple way to achieve the goal.

    I am afraid not. If you really need the permalinks to stay as default then I would probably also explore other auth options, such as application passwords, oauth and jwt. I am not sure how their endpoints may be addressed, but I would definitely check that.

    I am marking this as resolved, but feel free to follow up or open a new thread anytime.

Viewing 1 replies (of 1 total)

The topic ‘API Authentication with “rest_route=” style urls’ is closed to new replies.