Sizes API
General Information
You can access the list of all our sizes and their attributes using our Sizes JSON/REST API.
This is a useful service for example when integrating with e-commerce platforms that require to first import all options of size variants.
JSON/REST
The data is provided through one endpoint: size
This webservice is very similar to the Products and Product Images web service. Therefore:
-
Method to be used is POST
-
Encoding is UTF-8
-
Text delimiter is the double quote (")
-
Field delimiter is the semicolon (;)
-
The API must be called with the https prefix
In order to use this system, valid credentials are required. If you do not have one yet, please request an account.
If you wish to test your code, you can do so with a tool like Postman.
Integration
Endpoint Settings
Environment | Server | Database |
PROD | https://api.stanleystella.com | production_api |
Get JSON
Service | URL
|
Sizes | /webrequest/size/get_json |
JSON format as input
Submit this JSON message as input. There are no filters possible on this call.
{JSON format as output
"jsonrpc":"2.0",
"method":"call",
"params":{
"db_name":"production_api",
"password":"YOUR_PASSWORD",
"user":"YOUR_LOGIN"
},
"id":0
}
The following JSON is the output of the call.
{
"jsonrpc": "2.0",
"id": 0,
"result": "[
{
\"Code\": \"XXS\",
\"CodeNavision\": \"2S\",
\"Name\": \"XXS\",
\"SortOrder\": 10
},
{
\"Code\": \"XS\",
\"CodeNavision\": \"XS\",
\"Name\": \"XS\",
\"SortOrder\": 20
},
{
\"Code\": \"S\",
\"CodeNavision\": \"1S\",
\"Name\": \"S\",
\"SortOrder\": 30
},
{
\"Code\": \"M\",
\"CodeNavision\": \"1M\",
\"Name\": \"M\",
\"SortOrder\": 40
},
...
]"
}
PHP code example with curl
Here is an example of PHP code used to call the Colours JSON/REST service. This code is given as illustration.
$url = "https://api.stanleystella.com/webrequest/size/get_json";
$jsonData = array(
'jsonrpc' => '2.0',
'method' => 'call',
'params' => array(
'db_name' => "production_api",
'password' => "YOUR_PASSWORD",
'user' => "YOUR_LOGIN",
),
'id' => 0
);
$ch = curl_init($url);
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch);
$jsonDataDecoded = json_decode(json_decode($result)->result, true);
curl_close($ch);