Developers API

This API is designed to receive products from the site and use them on third-party services or sites.

Data can be uploaded in the following formats: XML or JSON

Pre-requirenments for API

1) Category of products

Example to get category:

$curl = curl_init("http://swirlbyswirl.com/api/v1/categories");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

2) Designers of products

Example to get designers:

$curl = curl_init("http://swirlbyswirl.com/api/v1/designers");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

Description of API methods

1) Get all data - http://swirlbyswirl.com/api/v1/products

Example:

$curl = curl_init("http://swirlbyswirl.com/api/v1/products");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

You get 100 products, if you need to get the next 100, and so on, use the offset variable in the query.
For example: http://swirlbyswirl.com/api/v1/products?offset=100

2) Get data by category - http://swirlbyswirl.com/api/v1/categories/{categoryId}/products

Example:

$curl = curl_init("http://swirlbyswirl.com/api/v1/categories/[1...n]/products");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

You get 100 products sort by category, if you need to get the next 100, and so on, use the offset variable in the query.
For example: http://swirlbyswirl.com/api/v1/categories/[1...n]/products?offset=100

3) Get data by designers - http://swirlbyswirl.com/api/v1/products?designer={designer}

Example:

$curl = curl_init("http://swirlbyswirl.com/api/v1/products?designer=[Designer name]");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

You get 100 products sort by designers, if you need to get the next 100, and so on, use the offset variable in the query.
For example: http://swirlbyswirl.com/api/v1/products?designer=[Designer name]&offset=100

4) Get data by designers and category - http://swirlbyswirl.com/api/v1/categories/[1...n]/products?designer={designer}

Example:

$curl = curl_init("http://swirlbyswirl.com/api/v1/categories/[1...n]/products?designer=[Designer name]");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/[json || xml]'));
$response = curl_exec($curl);
curl_close($curl);

Your data in $response variable

You get 100 products sort by category and designers, if you need to get the next 100, and so on, use the offset variable in the query.
For example: http://swirlbyswirl.com/api/v1/categories/[1...n]/products?designer=[Designer name]&offset=100