Viewing 5 replies - 1 through 5 (of 5 total)
  • Do any of the API endpoints work?
    I was having trouble at first with working with the API while on a local environment, but that was it.

    If you confirmed that the REST API and Credentials are correct, I would recommend doing some debugging in the API logic

    Thread Starter aaatex

    (@aaatex)

    I am not sure how to debug the API logic. Only need to get orders so do not have any code other than for orders.

    The code we have is .net on a workstation. This code still works with one client but not for this new one.

    I did copy and paste the credentials myself directly into the code. I am not sure how that could be incorrect.

    I have the feeling that it is something in the WP/WC config but we are not the ones who maintain WP/WC and only have WP Admin access. No host access.

    Can you explain in a little better detail how your setting this up?

    Is the WC site on a local machine or web server?

    I get unauthorized when I hit the API at a port (on local machine)
    https://wc.site:8000/api

    My issue was I was using the same server to hit the API, so it didn’t need the port – so since it made the request without the port, but the siteurl setting was set to include the port – the domains did not match and thus causing 401

    Thread Starter aaatex

    (@aaatex)

    Not really. The WP/WC is live on a web server. I did not set it up.

    I am running our VB.net test program from my workstation (Win 7 pro) just as we did successfully for another client. Just changed the URL and credentials. Copied and pasted from the WP/WC Admin screens. Using http.

    URL is

    https://domain.com/wp-json/wc/v1/orders?per_page=100&page=1&orderby=id&order=asc&oauth_signature_method=HMAC-SHA256&oauth_consumer_key=ck_…73&oauth_timestamp=1484852881&oauth_nonce=Rd…5J&oauth_signature=1p…%3D

    Well then I would say the best bet is to triple check the REST settings in WooCommerce.

    Verify the permissions for the credentials (for the user) you are sending over.

    Check .htaccess on web server

    Run through plugins that might disable the API

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Getting 401 Unauthorized on WP V1 API calls’ is closed to new replies.