i am planning to develop a native mobile Android App for WooCommerce shops.
I had a look at their REST API documentation here: http://docs.woocommercev2.apiary.io/ I already started to test it but when i do different calls
GET /orders
let's say it returns all the orders of the shop.
Does anyone have any idea how can i develop a enduser app using their API.
for example:
GET /products
PUT /order
(create a order for the logged in User)
GET /order
(get orders of the logged in User)
Any idea is appreciated :)
Thanks in advance.
For
http
(and not ssl protocol such ashttps
) request, you must use from OAthu 1.0a authenticate framework. There are many libraries for oauth 1.0a in java, i'm use from scribeJavaSo, do the following steps:
In
app/build.gradle
in dependency scop add this:compile 'org.scribe:scribe:1.3.5'
New class as WoocommerceApi for provider of OAuth service. important. You must use a
public
class in DefaultApi10a for implementing oauth providerAnd you Must make request in
Thread
orAsyncTask
I would suggest this steps
First thing you can Enable Api for woocommerce from the backend – http://docs.woothemes.com/document/woocommerce-rest-api/
https://www.npmjs.com/package/woocommerce use this link, which has all the methods to interacting with woocommerce. Otherwise using lightweight middleware, it help to connect woocommerce server & return JSON data to your app.
Write a service using ionic framework and talk to your thin middleware client. Do not forget to cache the data (using local storage), so that you don’t hit the server all the time. - Contus M Comm
According to the documentation the expected data format is JSON only (in contrast with the previous XML or Json) but there is unfortunately no further explanation on which data structure is expected for each endpoint.
Here's the only example of a POST request format from the current documentation for creating a coupon:
REST request URI
Java code (pasted from the documentation)
Json response
http://docs.woocommercev2.apiary.io/#reference/coupons/coupons-collection/create-a-coupon
Considering the API is claimed to be accepting POST requests for all relevant endpoints this should be possible with a shopping order.