All URIs are relative to https://api.facestore.pt/v1
Method | HTTP request | Description |
---|---|---|
addCategories | POST /categories | |
deleteCategoryById | DELETE /categories/{id}/ | |
getCategories | GET /categories | |
getCategoryById | GET /categories/{id}/ | |
updateCategoryById | PUT /categories/{id}/ | |
uploadImages | POST /categories/{id}/uploads/ | Upload de images for category |
\Swagger\Client\Model\InlineResponse2011 addCategories($category)
Creates a new category in the store.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$category = new \Swagger\Client\Model\Category(); // \Swagger\Client\Model\Category | Category to add to the store
try {
$result = $apiInstance->addCategories($category);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->addCategories: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
category | \Swagger\Client\Model\Category | Category to add to the store |
\Swagger\Client\Model\InlineResponse2011
- Content-Type: application/json, multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteCategoryById($id)
deletes a single category based on the ID supplied
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 789; // int | ID of category to delete
try {
$apiInstance->deleteCategoryById($id);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->deleteCategoryById: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of category to delete |
void (empty response body)
- Content-Type: application/json, multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\InlineResponse2001 getCategories($includes, $limit, $order_by)
Returns all categories from the system that the user has access to ### Includes You can give the following values on includes parameter: routes, products
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$includes = array("includes_example"); // string[] | Include associated objects within response
$limit = 56; // int | max records to return
$order_by = array("order_by_example"); // string[] | Specify the field to be sorted, examples: - `?order_by=id|desc` - `?order_by=updated_at|desc,position|asc`
try {
$result = $apiInstance->getCategories($includes, $limit, $order_by);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->getCategories: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
includes | string[] | Include associated objects within response | [optional] |
limit | int | max records to return | [optional] |
order_by | string[] | Specify the field to be sorted, examples: - `?order_by=id | desc` - `?order_by=updated_at |
\Swagger\Client\Model\InlineResponse2001
- Content-Type: application/json, multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\InlineResponse2011 getCategoryById($id, $includes, $limit)
Returns a category based on a single ID ### Includes You can give the following values on includes parameter: routes, products
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 789; // int | ID of category to fetch
$includes = array("includes_example"); // string[] | Include associated objects within response
$limit = 56; // int | max records to return
try {
$result = $apiInstance->getCategoryById($id, $includes, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->getCategoryById: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of category to fetch | |
includes | string[] | Include associated objects within response | [optional] |
limit | int | max records to return | [optional] |
\Swagger\Client\Model\InlineResponse2011
- Content-Type: application/json, multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateCategoryById($id, $category)
update a single category based on the ID supplied
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 789; // int | ID of category to update
$category = new \stdClass; // object | Category to update in store
try {
$apiInstance->updateCategoryById($id, $category);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->updateCategoryById: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of category to update | |
category | object | Category to update in store |
void (empty response body)
- Content-Type: application/json, multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
uploadImages($id, $image_small, $image_large)
Upload de images for category
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('APIToken', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIToken', 'Bearer');
$apiInstance = new Swagger\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 789; // int | ID of category to update
$image_small = "/path/to/file.txt"; // \SplFileObject | Small image for category
$image_large = "/path/to/file.txt"; // \SplFileObject | Large image for category
try {
$apiInstance->uploadImages($id, $image_small, $image_large);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->uploadImages: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of category to update | |
image_small | \SplFileObject | Small image for category | [optional] |
image_large | \SplFileObject | Large image for category | [optional] |
void (empty response body)
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]