Description:

Returns a list of Products.

This assumes that Products have first been uploaded via a POST request or via the web console otherwise no data will be returned and the value of the "totalRecordsFound"  variable in metadata will be 0.

GET responses can be filtered out based on the products parameters to narrow down the results. CompetitionLabs provides a fully queryable API.

Resource URL:

https://<apphost>.competitionlabs.com/api/<your-space-name>/products

Request headers

KeyValueRequired
X-API-KEY
Your unique API keyYes
Content-Type
application/jsonYes

Request URL parameters

Parameter
Type
Required
Description
space
StringYesThis is the space name which is linked to the account

Additional Query String Parameters

You can use the query parameters along with the generic parameters.

Query parameters

Parameter
Type
Constraint
Usage
name
String

The naming or label of a product/game. Case insensitive.

For lookup you would use "name.raw=search_word" because the field "name" is indexed to support more complex searches

?name.raw=search_word
?name=search_word
productType
String

A type of a product that the product can be categorised by, eg: Slots, Cards. Case sensitive.

?productType=search_word
description
String

A description of a product for your reference. Case insensitive.
Can only be searched by using searchFields and searchFor. See example for reference

?_searchFields=description&_searchFor=search_word
adjustmentFactor
DoubleA default adjustment factor of a product. Supports any type of decimal number
?adjustmentFactor=search_number
productRefId
StringA unique reference Id of a product. Case sensitive
?productRefId=search_word
actionAdjustmentFactors
Array [Object]A default adjustment factor of a pre created action. Complex search applies, allows full search on a complex object of ActionAdjustmentFactors
?actionAdjustmentFactors.ruleActionHelper.key=search_word
?actionAdjustmentFactors.adjustmentFactor=search_number
productGroups
Array [String]Used to tag products with taxonomy terms. Case sensitive
?productGroups=search_word
metadata
Array [Object]Complex search applies, allows full search on a complex object of Metadata
?metadata.key=search_word
?metadata.value=search_number
created
DateTimeWorks with simple dates or date and time, eg: created=2016-02-07, created=2018-08-23T14:23:09
?created=search_DateTime
id
StringA unique generated Id of a product. Case sensitive
?id=search_string

EXAMPLE

Request
curl
--header "X-API-KEY: <your-api-key>"
--request GET https://app.competitionlabs.com/api/<your-space-name>/products
Response
{
     
    "meta": {
        "totalRecordsFound": 5,
        "skip": 0,
        "limit": 20
    },
    "data": [
        {
            "jsonClass": "Product",
            "name": "The Fruits",
            "productType": "Slot",
            "accountId": "1M7owWQBVd51K6gPbaDW",
            "description": "Demo Fruits slot product",
            "adjustmentFactor": 4.12,
            "productRefId": "fruits",
            "actionAdjustmentFactors": [],
            "productGroups": [],
            "created": "2018-07-22T12:13:15.194+00:00",
            "id": "287owWQBVd51K6gPeKA6"
        },
        {
            "jsonClass": "Product",
            "name": "Test1",
            "productType": "TestType1",
            "accountId": "1M7owWQBVd51K6gPbaDW",
            "description": "TestDesc",
            "adjustmentFactor": 1,
            "productRefId": "test_prod_01",
            "actionAdjustmentFactors": [],
            "productGroups": [
                ""
            ],
            "metadata": [],
            "created": "2018-07-22T13:27:17.873+00:00",
            "id": "Dc4swmQBVd51K6gPQqFx"
        },
        ...
        ...
        ...
    ]
 
}
Request with Query string parameters
curl
--header "X-API-KEY: <your-api-key>"
--request GET https://app.competitionlabs.com/api/<your-space-name>/products?_limit=1&productType=product-Type-Slots
Response for Query string request
{
     
    "meta": {
        "totalRecordsFound": 1,
        "skip": 0,
        "limit": 1
    },
    "data": [
        {
            "jsonClass": "Product",
            "name": "product-Name-0",
            "productType": "product-Type-Slots",
            "accountId": "AVQZ2zwdvxp6FovVuxMQ",
            "adjustmentFactor": 1,
            "productRefId": "my-custom-product-ref-0",
            "created": "2016-07-11T10:24:54.768+00:00",
            "id": "AVXZfPvwHz_hNiERp3yC"
        }
    ]
 
}

ERROR CODES

CodeHTTP StatusDescriptionExample

404Modifying the Resource URL parameters that are mandatory
Error Response 404
{
    "status": 404
}

Attachments:

API.gif (image/gif)