Try it out!

API console

The API console offers a simple way to try the API directly. It is available on https://admin.abicart.se/backend/jsonrpc/v1/console/.

The console accepts API method calls using the same syntax as in this documentation.

Input the unique identifier of your webshop in the appropriate place in the context parameters and then try the following.

API Console
Admin.login("you@example.com", "x79x0skjod")

Unless an error occurred, you should be logged in. Now, try listing some articles in your shop.

API Console
Article.list(true, {"limit": 5})

Using API calls in an existing Abicart Webshop

A JavaScript console offers a simple way to try the API directly within your shop. JavaScript console is available in, e.g., Chromium (using F12) or with Firebug for Firefox.

Go to any page in your shop, start the console and try the following example.

Javascript
tws.api.call('Article.list', [["uid","articleNumber","articlegroup"], {"limit": 5}], tws.debug);

This will produce something like

Response
[
  {
    "articleNumber": "4220",
    "articlegroup": 1347891,
    "uid": 12565483
  },
  {
    "articleNumber": "4227",
    "articlegroup": 1347891,
    "uid": 12565484
  },
  {
    "articleNumber": "4232",
    "articlegroup": 1347891,
    "uid": 12565485
  },
  {
    "articleNumber": "4233",
    "articlegroup": 1347897,
    "uid": 12565502
  },
  {
    "articleNumber": "4235",
    "articlegroup": 1347897,
    "uid": 12565503
  }
]

This will normally show only things that available to a visitor of your shop. However, if you are logged in as a shop administrator and preview your shop, then you will have the authentication as a webshop administrator, available through an encrypted cookie, and could do something like this:

Javascript
tws.api.call('Order.getSchema', [30259825], tws.debug);

(Use the unique identifier of an order from your own shop.) This will return an object with the order's schema.

With tws.api you can call any API method. The second argument in the parameters to the call and the third is the callback. tws.debug is a callback that will just display the gotten data in the console. For more information on this, see [tws.api].