<img src="abc.png" />
    
call to replace anchor tags contains '/admin' in href

About APIs

The Storehippo API is organized around REST. Our API has predictable, resource-oriented URLs, and uses message key HTTP response to indicate API success or errors. We use built-in HTTP features, like HTTP authentication  which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses.

Authentication

StoreHippo REST API gives you access to the powerful StoreHippo platform from a programming language of your own choice. The authentication is done by passing the ACCESS key in the header of your the API url. Access Key can be generated from the Admin Panel (Settings > Advanced > Access Keys) of your store.

Versioning

The current version is version 1. When we will make backwards-incompatible changes to the API, we will release new, dated versions.

Error Handling

Our API libraries will return response in case of any error occurred. Error key will be present in Api response of failed API.
Failed API response will look like

{
  "error": {
    "key": "error_message_key"
  },
  "data": "Api response"
}

How to call APIs

Using NodeJS SDK

Anyone can access the Storehippo api using storehippo-nodejs-sdk in nodejs language. See the detail documentation about sdk here.

Example :

var storehippo = require('storehippo-nodejs-sdk')({
    storename: "< your - store - name >",
    access_key: "< your - access - key >",
    version: "< version >"
});
var request = {
    entity: "your-entity-name",
    recordId: "_id_of_record",
    command : 'get'
}
storehippo.call(request, function (err, response) {
    if (err) throw err;
    console.log(response);
})

Using Curl

Storehippo api can be accessed using CURL Command.
Example :

curl --header "access-key:access-key-value" http://storename.storehippo.com/api/1/entity/entity_name
 

Accessing APIs from Store Themes 

All Storehippo themes use angular framework. And there is app service in Storehippo theme to call the Storehippo Api. First inject the app service and call it methods.
Example :

// injecting app service
var $injector = angular.element("body").injector();
var app = $injector.get("app");

var request = {
    entity: "your-entity-name",
    recordId: "_id_of_record",
    command : 'get'
}
app.call(request, function (err, response) {
    if (err) throw err;
    console.log(response);
})

2018-05-28T09:59:34.655Z