Sales Layer REST API Call Structure
All API calls are made via the following subdomain:
https://api.saleslayer.com
To increase security, all calls will be made using a secure SSL connection.
Sending request from the client
When making a data request to api.saleslayer.com, the client must include the necessary parameters for the query to be executed correctly. These parameters can be included either in the URL via GET or in the body of the call via POST.
Mandatory identification and security parameters
Code | Connector Relationship Code. |
Time | timestamp() (International UNIX date) |
Unique | mt_rand() or rand() (Random security number) |
Key256 | SHA2 code with the combination of 'code' + 'secret_key' + 'time' + 'unique' |
These three parameters are used to ensure that the client making the request to the API has the necessary regulatory authorization.
Other modelling parameters
last_update | Timestamp (UNIX date) of the last data update. If this parameter is not sent, it is assumed that the entire catalog data structure must be returned, since the client is requesting to install the data for the first time or refresh it completely. Note: Any modification of the connector will reset the last_update date. |
ver | API version to be used. If this parameter is omitted, version 1.17 is assumed. Currently, versions 1.17 and 1.18 are active. |
pagination | Parameter available only for version 1.18 and corresponds to the number of items per page. Note: this number is figurative, since our API works with number ranges. For example, if we select a pagination lower than 1000, 500 items will be exported. If we select a pagination between 1001 and 1500, 1000 items will be exported, etc. By default, if the pagination parameter is not sent, 1000 items will be exported. |
compression | Boolean to indicate whether the response is preferred compressed or not. Default: 1 (yes, as long as it is possible for the client). |
test | Indicates that only the connection and authentication need to be verified. |
group_category_id | Boolean: default 0. If set to 1, the API will return grouped multi-category products. If this parameter is left at 0, the API will return one product entry for each category associated with it, and it will also return the result of multiplying each of these products by their respective associated formats, creating an ID for the format resulting from combining the product ID and the format (it is recommended to always set this to 1). |
group_category_delimiter | Delimiter for grouped multi-category values. (Default: line break). |
parents_category_tree | Boolean: default 0. If set to 1, the API will return the data of the categories belonging to the upper tree, for all categories that have been modified, either directly, or indirectly due to a product associated with them being modified. |
same_parent_variants | Boolean: default 0. If set to 1, the API will return as modified the data of all formats that share the same parent product, when any of these formats has been modified. |
get_file_refereneces | Boolean: default 0. If set to 1, the API will return the names of the images/files as indexes instead of the hash code. |
The modeling parameters are only taken into account for requests to the data output API (export connectors). They will not be considered for data import.