Jump to content

Recommended Posts

Posted
#include "WinHttp.au3"
#include <Array.au3>
#include <string.au3>
#include <MsgBoxConstants.au3>

$sDomain = "https://xxxxx.xx/wp-json/wc/v3/products"
$sLoginName = "xxxxxxx"
$sPassword = "xxxxxxx"

$objHTTP = ObjCreate("Msxml2.XMLHTTP.6.0")
$objHTTP.open ("GET", $sDomain, False,$sLoginName:$sPassword)

$objHTTP.send()
$data = $objHTTP.responseText
ConsoleWrite($data & @CRLF)

And this is error code i get

{"code":"woocommerce_rest_cannot_view","message":"Sorry, But you cant view data.","data":{"status":401}}

I know its auth error. Can you help me fix how to send auth data right?

Posted
19 hours ago, Danp2 said:

I know that woocommerce uses Oauth1, I can connect fine with google spreadsheet apis and some others.
I just cant figure about how to make successful connection with autoit. Since all api services is with subscription, i need to get one my own. 
I have some api projects that work in aoutit, just cant get that woocommerce to work

Posted
20 hours ago, Zedna said:

Try to encode name:pwd by Base64 encoding


$sLoginName & ":" & $sPassword

 

https://en.wikipedia.org/wiki/Basic_access_authentication

 

I dont understand that part x.x

20 hours ago, Zedna said:

Instead of


ObjCreate("Msxml2.XMLHTTP.6.0")

Try


ObjCreate("Msxml2.XMLHTTP")

or


ObjCreate("Microsoft.XMLHTTP")

or


ObjCreate("WinHttp.WinHttpRequest.5.1")

i had ("WinHttp.WinHttpRequest.5.1") before, i tested them all, same result.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...