The Nigma API is a powerful tool to perform a variety of functions when developing an ecommerce site or application. To make interaction easy and the system platform independant, all of the API calls can be called remotely using XML. The API can be interacted with any programming language that can perform an HTTP POST and interact with XML. This document will help you get started.

To get started:

Basic Setup and Configuration
To get started, you must first have a valid Remote Access Hash (can be generated in the admin managment screen in the admin interface) and be on the allowe list of IP addresses. If you are developing an application that is running on the same IP address as the Nigma API, you are already on the allowed list of IP addresses. If you are developing an application that will be connecting remotely, you must add your IP address to the config file.

Remote Access Hash
The remote access hash is a unique string of numbers and letters that identify the who the user is that is contacting the API. It is recommended that you use a unique remote access hash for each of your applications. If an admin is logging into your system, you should be using the admins unique remote access hash.

My First Message
Messages sent to the API can be broken down into three completely seperate parts. The first part is the header which contains your remote access hash and the command you wish to run. The second part of the message contains the paramaters for the message. This is either the data you are inserting/updating or a search query. The final part of the message is navigation information to help aid in pagination and results format (ie. sort field and order). The below message is a simple example of how to format your calls. In this message, we are requesting to get product information for products containing the keyword 'computer' and return the first page given the page size of 10 results. We have also requested the API order the results by name in descending order.

  • <bbv2>
    • <header>
      • <remoteAccessHash>7djemaekd8d8ajdn4kapla</remoteAccessHash>
      • <command>GetProducts</command>
    • </header>
    • <params>
      • <products>
        • <product>
          • <productKeywords>computer</productKeywords>
        • </product>
      • </products>
    • </params>
    • <navigation>
      • <pageSize>10</pageSize>
      • <page>1</page>
      • <orderByField>name</orderByField>
      • <orderByDirection>desc</orderByField>
    • </navigation>
  • </bbv2>

This is a very simple example. We could pass in more than one product node to perform complex searches (similar to an OR statement). The only required fields in the above message are the remoteAccessHash and the command. The system will use default values for pagination and ordering.

Navigation
As your system grows you will collect more data than can be passed back in a single xml document. To manage this data, we have incorporated navigation commands to parse your way through large sets of data. This request information is stored in the navigation node. You can include the following fields:

  • pageSize - The number of results per page.
  • page - The page you wish to see (ie. page 2 with pageSize of 10 will return results 11-20)
  • orderByField - The field on which to order the information. Most all commands except id, name, and date. If an invalid field is passed, the system will use a default value.
  • orderByDirection - Which order to sort the information in. Possible values are desc or asc meaning descending or ascending sort order respectivly.

Returned result sets also contain a navigation node. This is to help you with displaying search results in your applications (ie. total records found, current page, etc). The data included in this returned node is as follows:

  • records - Total records found. This does not mean the quantity returned.
  • pages - Total pages that of records given the specified pageSize.
  • recordsStart - Starting location of the records.
  • recordsEnd - Ending location of the records.

This concludes the basic framework for interacting with the Nigma API. For a more detailed view of the API, see the respective API command page. A list of commands can be found here.