E-Com Plus is a robust and flexible cloud commerce software, totally based on REST APIs, providing a large library of methods and specifications to deploy any digital commerce operation easly

Search API is our public REST interface to Elasticsearch, implemented as store search engine, for faster and flexible products and terms searches

Overview

All requests are proxy passed to Elasticsearch Search APIs with XGET method (read only)

You must follow Request Body Search specifications

Responses are the same as returned from Eslasticsearch REST API, so you can read their documentation to get more info and examples

Host

Should be accessed from https://apx-search.e-com.plus/api/{version}/

Current version: v1

https://apx-search.e-com.plus/api/v1/

Note that every request must be with https (SSL)

All endpoints will end with .json:

https://apx-search.e-com.plus/api/v1/example.json

Verbs

VerbCRUDDescription
GETReadView object
POSTReadView object

Status Codes

Based on HTTP/1.1 Status Code Definitions:

  • 2xx - Successful
  • 4xx - Client error, must check the request
  • 5xx - Server error, report us and try again later

Format

Both request and response body are formatted as JSON, always an object {}

Check this page of Elasticsearch documentation to examples of successful responses

Error Handling

ELS Errors

All 4xx (client error) and 5xx (server error) responses from Elasticsearch will have body following the model below:

  • (object)
    • error(object) - ELS error object
      • root_cause(array)
        • (object)
          • type(string)
          • reason(string)
          • resource.type(string)
          • resource.id(string)
          • index(string)
      • type(string)
      • reason(string)
      • resource.type(string)
      • resource.id(string)
      • index(string)
    • status(number) - HTTP status code

Example

{
  "error": {
    "root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index",
        "resource.type": "index_or_alias",
        "resource.id": "items",
        "index": "items"
      }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index",
    "resource.type": "index_or_alias",
    "resource.id": "items",
    "index": "items"
  },
  "status": 404
}

Web Server Errors

In some cases you can receive an error directly from NGINX web server, even in this case the response will be a JSON object

NGINX 404
{
  "status": 404,
  "error_code": -44,
  "message": "Page not found"
}

Incorrect URL paths, check API Host

NGINX 503
{
  "status": 503,
  "error_code": -53,
  "message": "Service unavailable (DDoS?), wait few seconds"
}

NGINX is blocking your requests for security reasons, please wait few seconds and try again

Server Limits

Responses are limited to 30 requests per IP per second

If the server is overloaded with too many pending connections, it will respond with 503 status code, so you need to create treatments for this case

We recommend to wait 400ms after a 503 response, then resend the request

See Also

Other REST APIs

  • Store: E-Com Plus Store API, with all store resources
  • Main: E-Com Plus Main API, with some public data about stores and channels
  • Graphs: Recommendations API using Neo4j to define related products by categories, brands and common orders

Getting Help

Feel free to get help or suggest alterations on GitHub repo or by e-mail [email protected]