Connect to WooCommerce using XOJO

Just because it took me some time to get this right, I wanted to post to help other users.
I was also tired of looking at all the plugins for sale when it is pretty easy to do with just core XOJO.

  1. Enable Webhooks in Wordpress
  2. Create REST API KEY SET
  3. This is basic auth over HTTPS. (WooCommerce requires SSL for basic auth, if you are non-ssl you have to use OAUTH)
  4. Legacy API is not required as this is using the newer API.

Dim secureSite As New HTTPSecureSocket
secureSite.Secure = True
secureSite.ConnectionType = SSLSocket.TLSv12
secureSite.SetRequestHeader(“Authorization:”, "Basic " + EncodeBase64( “APIKEY:APIPASS”, 0))
Dim data As String
data = secureSite.Get(“https://www.example.com/wp-json/wc/v2/products”, 30)

How that helps!

And if you would like to see this in detail, with basic Authorization and OAUTH, plus receive a sample project, plus receive a coupon code to attend a Udemy course on the subject for free, plus see how to upload pictures using the Rest api, then come to the MBS XOJO CON in Munich in September!

And you have the special opportunity to meet with XOJO CEO Geoff Perlman and get latest news.

https://www.monkeybreadsoftware.de/xojo/events/munich-2018-event.shtml.en

Hi Oliver,

I will not be able to come to the conference, but I would like to buy the course (udemy or other, if possible with subtitles, as youtube can do automatically).

[quote=398090:@olivier vidal]Hi Oliver,

I will not be able to come to the conference, but I would like to buy the course (udemy or other, if possible with subtitles, as youtube can do automatically).[/quote]

I‘ll see what I can do, but you‘ll have to wait until after the conference.

Currently I have a German only course on Udemy, which shows how to make use of the REST api of a database plugin on Wordpress. There will be more in English, but after the MBS XOJO Conference only.

Great, thanks.

Correct me if I am wrong.

Would your examples require the MBS plugin? If so, is it free? If not do you know how much?

My point was to use Basic Auth for WooCommerce using core XOJO. Open Source if you will.

[quote=398885:@jose hernandez]Correct me if I am wrong.

Would your examples require the MBS plugin? If so, is it free? If not do you know how much?

My point was to use Basic Auth for WooCommerce using core XOJO. Open Source if you will.[/quote]

I‘m using Xojo code, no plugins for this.

In general, I am regularly making use of MBS plugins, they are very useful to me.

Thanks @jose hernandez … exactly what I have been looking for!

Excellent presentation, Oliver has put a lot into this. Well done.