WP REST API Plugin - How to actually use it?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
JustinW42
Posts: 52
Joined: Sun Nov 30, 2014 7:22 am
Location: Upland, CA
Contact:

WP REST API Plugin - How to actually use it?

Post by JustinW42 » Thu Apr 05, 2018 8:49 am

Not sure if this is the best place for this, but here goes:

I downloaded the .livecode files from GitHub, concerning the Wordpress REST API wrapper that was made available.... I tried to open it as a stack to view the code, but it doesn't open in Livecode 9 (haven't tried in older versions). There is no error - it simply doesn't open, and nothing appears in the Project Browser.

I also tried copying the files into the Livecode Plugins directory, but that had no effect.

Am I missing a critical step?
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com

JustinW42
Posts: 52
Joined: Sun Nov 30, 2014 7:22 am
Location: Upland, CA
Contact:

Re: WP REST API Plugin - How to actually use it?

Post by JustinW42 » Fri Apr 06, 2018 7:44 am

UPDATE: The first time around, I had downloaded each of the files, individually. I didn't download a few of the files, such as the ReadMe file, etc. The second time around, I downloaded the entire directory as a ZIP file. After extracting the ZIP file, I was able to easily open the stacks - now its time to dive in and see what kind of damage I can do! :D
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com

MadManSoft
Posts: 36
Joined: Fri Apr 12, 2013 9:15 pm

Re: WP REST API Plugin - How to actually use it?

Post by MadManSoft » Wed Jun 20, 2018 8:24 pm

Any luck with this?

I'm stuck on getting the Authentication to work.. Where is do I find the Client ID and Secret?

Is this oAuth or plain text or token?

WP 4.9

denzio
Posts: 6
Joined: Sat Oct 05, 2013 9:02 am

Re: WP REST API Plugin - How to actually use it?

Post by denzio » Mon Jul 29, 2019 10:44 am

Hi,

Does anyone care to share a working sample using this WP REST API Plugin.

Please help.

Thank you so much.

Regards,
Dennis

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: WP REST API Plugin - How to actually use it?

Post by ghettocottage » Tue Jul 30, 2019 4:21 pm

I had a quick look and noticed that this has not been updated since 2016. Wordpress went through some pretty major updates last year. I would be hesitant to invest much time or effort into anything that has not kept pace with those changes.

Was there something specific you were trying to do? There are other ways around Wordpress if you wanted to create an app..

denzio
Posts: 6
Joined: Sat Oct 05, 2013 9:02 am

Re: WP REST API Plugin - How to actually use it?

Post by denzio » Wed Jul 31, 2019 7:14 am

Hi,
Thank you so much for the prompt responds.
I would like to know how to implement wordpress api and page elements to livecode apps.
specially the woocommerce for shopping cart/payment gateway and visual composer for the page layout to be apply to the apps.

if there are some sample that would be great help.

once again thank you so much.

Regards,
Dennis

cchatmon
Posts: 3
Joined: Sat Mar 14, 2020 4:08 pm

Re: WP REST API Plugin - How to actually use it?

Post by cchatmon » Sun May 24, 2020 7:39 pm

I’m actually working to revise the dead code. Seems they’ve been trying to delete the knowledge of it offline. Video was removed along with post.

The main issue I see from the digitalpomegrant code is it incorrectly handles the JSON responses.

sid
Posts: 15
Joined: Thu Dec 05, 2019 8:27 pm

Re: WP REST API Plugin - How to actually use it?

Post by sid » Tue Jul 14, 2020 11:01 am

Hi cchatmon

Did you come right with this? is it working.

I have also tried and failed. Have no idea how to fix the wonky Json stuff.

Will be grateful for a sample stack that works. Ill even paypal you $50 :-)

Sid

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: WP REST API Plugin - How to actually use it?

Post by FourthWorld » Tue Jul 14, 2020 3:32 pm

cchatmon wrote:
Sun May 24, 2020 7:39 pm
I’m actually working to revise the dead code.
This is exciting. Please keep up posted if we can help with that.
Seems they’ve been trying to delete the knowledge of it offline. Video was removed along with post.
Have they indicated why?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: WP REST API Plugin - How to actually use it?

Post by jiml » Wed Jul 15, 2020 8:07 pm

Ah, if only Livecode Connect were real!
Get Access To This Major New Feature…
We are rapidly approaching the first release of LiveCode Connect. This major new feature will allow you to add all kinds of Web API’s easily to your app. LiveCode Connect takes the hard-work out of accessing web APIs by using industry standard OpenAPI specifications to generate LiveCode Script commands which you can then use in your own scripts. LiveCode Connect will be available in Indy for $99 per year but included free with your Business Loyalty upgrade. This will be delivered to you as soon as it is released.
JimL

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: WP REST API Plugin - How to actually use it?

Post by FourthWorld » Wed Jul 15, 2020 11:03 pm

What is "LiveCode Connect"?

And when did HTTP become prohibitively difficult?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: WP REST API Plugin - How to actually use it?

Post by jiml » Thu Jul 16, 2020 8:15 pm

Hi Richard,

LiveCode Connect was the 'soon to be released' feature promised in the quote I posted.

It ingested Swagger (OpenAPI) API descriptions and converted them to LC scripts.

It was stillborn. Or rather aborted. :(

Jim Lambert

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: WP REST API Plugin - How to actually use it?

Post by mwieder » Fri Jul 17, 2020 1:02 am

Jim-

Where did that quote come from? I've never heard of that.

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: WP REST API Plugin - How to actually use it?

Post by jiml » Fri Sep 04, 2020 5:51 pm

Mark wrote:
Where did that quote come from? I've never heard of that.
Sorry Mark, I just saw your question.
That quote was from a LC promotion. It referenced a feature which Mark Waddingham introduced on day 3 of LiveCode Global 2017
INTRODUCING LIVECODE CONNECT: RESTFUL API’S THE IDLE WAY
If you have access you can watch Mark's talk about it.
LiveCode Connect seemed like an excellent project. Too bad it died.

Here are the contents of some of Mark's slides:
Introducing LiveCode Connect
Overview
So we now have some idea how REST calls work, some idea how to wrap them and we've even found an existing way to describe entire REST APIs in a human and machine readable form.

The next step, of course, is having a tool which takes such a description and generates the wrappers for you so you can easily access REST APIs from LiveCode.

Well, that tool is LiveCode Connect.
LiveCode Connect Deliverables
Overview
Currently LiveCode Connect is what I would call a useful prototype. It can generate (very large, in some cases) script libraries having good coverage of the Swagger/OpenAPI V2 specification.

It works successfully on a number of specs I found online, including XKCD, New York Times Top Stories and Microsoft Text Translation service.

It can generate libraries which work with either libUrl or tsNet.

The libUrl version is limited to GET, POST, DELETE, PUT methods, and produces only blocking commands.

The tsNet version can do all the methods and produces both blocking and non-blocking commands.

It is currently available (or will be available within a day or so of this session - if you are watching this live!) as a standalone tool which you run on a JSON encoded specification to produce a LiveCode Script library - which you can then use in your projects.

The stacks for the XKCDViewer and MSTranslateTextViewer examples are also available as standalone stacks (they have the generated libraries embedded in them, and are used as behaviors on the stack).
Limitations
Being a prototype, it does have a number of limitations:
Not all parameter types are implemented yet - in particular, binary data and file related ones
No checking is done on the structure of objects or arrays which are passed as parameters or returned as results
XML transport for the body of requests and responses are only supported as text - no translation to LiveCode arrays is currently done.
Multipart forms are not currently supported.
Only Basic and ApiKey authentication is supported - OAuth (which can be specified in OpenAPI) is not
Probably many others which I've not yet noticed...

Also, like most emerging specifications, OpenAPI is not currently that tight - I've already encountered a handful of variations of input (which are not explicitly stated in the spec) so getting it to run on all currently available OpenAPI specified REST APIs is going to be a case of try, patch to cope for variations, and try again.
Evolution
The next task is to take the current prototype and start turning it into a production-quality product.

It will be a commercial script library in the IDE which generates the libraries from an OpenAPI specification on the fly and then allow you to navigate the docs present in the OpenAPI specification in the dictionary.

When you build a standalone, you will be able to choose what specifications to 'bake' into it - meaning that no code generation will be needed in your standalones.

After that we'll turn our attention to cleaning off the rough edges and ensuring the full scope of the OpenAPI V2 Specification is supported. This will include adding the missing OAuth security method, ensuring all types and formats of data can be supported and validated, and ensuring it operates on as wide a range of currently available OpenAPI specifications as possible.

We are also looking at OpenAPI V3 support - although, for that, we really need some real world examples - I couldn't find any significant ones as of yet.

We also have plans to allow 'tailoring' of supported OpenAPI specifications - this will mean being able to pass both an original OpenAPI spec and a tailoring spec to LC-Connect, which allows LC-Connect to produce a more natural output for use from LiveCode. For example, being able to add better 'operation names' and allowing better mapping of parameters and their names.

In the future, we can look at auto-generating server side stubs - so writing a REST API becomes as easy as using one!
How Can I Help?
One of the purposes of LiveCode Connect is to try to make it 'easier' to access REST APIs from LiveCode. This is somewhat subjective, but basically it comes down to making the specification-driven generation of the script libraries as natural as possible.

So, we will be setting up a forum for LiveCode Connect, which will be accessible to anyone who has bought a subscription to LiveCode Connect.

This forum will be the place to discuss using LC-Connect:
telling us which specifications you have found don't work
helping us work out how to make the libraries generated as natural as possible
getting help and helping us to start writing OpenAPI specifications for services don't currently have them
getting help to start writing OpenAPI specifications for your own REST APIs

Finally, I'm also considering setting up a public GitHub repository which holds OpenAPI specifications along with any 'tailoring' files needed to make then naturally accessible from LiveCode - hopefully by working together we can make LiveCode talk to all the main REST APIs that exist today.

williamjamieson
Posts: 10
Joined: Fri Apr 23, 2021 6:01 am

Re: WP REST API Plugin - How to actually use it?

Post by williamjamieson » Fri Apr 23, 2021 6:30 am

Hello,

just seeing if anyone has any updates to this GIT file. I see there is only one branch in the GIT.

If so, please share :)

Thanks!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”