Skip to content
ardeearam edited this page Oct 29, 2014 · 20 revisions

What is GCore?

GCore is a cloud-based retail platform developed by Galore Labs. The goal is to provide a retail back-end platform where any technology, be it a store front, an inventory system, analytic system, payment gateway, or whatnot can connect and integrate with by following simple specifications.

Technological Overview

The GCORE API is a sessionless RESTful API that acccepts JSON-encoded string input, and outputs a JSON-encoded string.

How to Get Started Immediately

Step 1: Obtain Authorization string

First and foremost, you must obtain either one of the following through your friendly neighborhood GCore administrators:

  • username & password combination
  • API Key & API secret combination

If you are not very familiar interfacing with a RESTful API, the Postman Rest Client Google Chrome App is a good tool to play around and experiment with.

If you want to use the username & password combination, issue the HTTP message below:

Request

POST /session HTTP/1.1
Host: api.gcore.galoretv.com
Accept: application/json
Content-Type: application/json
{"username":"[email protected]", "password":"supplier"}

The GCORE API will then respond with the following HTTP response:

Response

HTTP/1.1 200 OK
x-GCore-Version: 0.99
{
    "message": "Log-in successful",
    "model": {
        "user": {
            "_id": {
                "$oid": "53b38af3b51fa98276550281"
            },
            "avatar_url": "http://m.c.lnkd.licdn.com/mpr/pub/image-xqmDSoicVGPdA7hAY_Wl7-iAAuGWDXSS9IglouycyPQTeunsxqmloauY5P8hD4Ke_Gf/ardee-aram.jpg",
            "created_at": "0000-00-00 00:00:00",
            "display_name": "Supplier",
            "email": "[email protected]",
            "last_reset_date": "2013-11-10 02:36:13",
            "secret_token": "f1a3984988722844ea9f2881fa5186eecec02d57",
            "id": "53b38af3b51fa98276550281"
        }
    }
}
  • If you are using the username & password combination, your Authorization string is id:secret_token that you obtained from logging in. So from the log in above, the Authorization string is 53b38af3b51fa98276550281:f1a3984988722844ea9f2881fa5186eecec02d57. Note that the secret_token changes every login.
  • If you are using the API Key & API secret combination, then your Authorization string is simply api_key:api_secret, and need not go through the log-in process.

Step 2: Do your thing

The sample API call below demonstrates the need to add the Authorization string as an HTTP header in subsequent GCore API calls.

Request

GET /stores/bakeshop/catalog_products HTTP/1.1
Host: api.gcore.galoretv.com
Accept: application/json
Authorization: 53b38af3b51fa98276550281:f1a3984988722844ea9f2881fa5186eecec02d57

Response

HTTP/1.1 200 OK
x-GCore-Version: 0.99
[
    {
        "_id": {
            "$oid": "5440eabc6c616e982d7b23c6"
        },
        "apparent_quantity": null,
        "attribute_set_id": null,
        "description": "The 2007 Semillon from El Burro Vineyards coalesces slippery turpentine undertones with a conventional mango-fandango bouquet.",
        "enable_googlecheckout": null,
        "entity_id": null,
        "fabric": null,
        "group_name": null,
        "images": [
            "http://bakeshop.galoretv.com/file/2014/10/17/CAKE001_1.jpg"
        ],
        "location": null,
        "msrp_display_actual_price_type": null,
        "msrp_enabled": null,
        "name": "Cake #1",
        "options_container": null,
        "pp_color": null,
        "pp_size": null,
        "price": "898.0",
        "quantity": null,
        "resource_type": null,
        "sku": "CAKE001",
        "status": null,
        "store_id": "bakeshop",
        "tax_class_id": null,
        "tenant": null,
        "type_id": "catalog",
        "url_key": "cake-1",
        "visibility": null,
        "weight": null
    }
]

If you fail to provide any Authorization string, or if you provided the wrong Authorization string, this is what you will see:

Response

HTTP/1.1 401 Unauthorized
x-GCore-Version: 0.99
{
    "message": "You must log-in to access this feature."
}

Next: Input and Output Specifications