Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deploy
Refer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "io.swagger:swagger-java-client:1.0.0"
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/swagger-java-client-1.0.0.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.BrandsApi;
import java.io.File;
import java.util.*;
public class BrandsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: APIKeyHeader
ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
APIKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.setApiKeyPrefix("Token");
BrandsApi apiInstance = new BrandsApi();
Brand brand = new Brand(); // Brand | Brand to add to the store
try {
InlineResponse201 result = apiInstance.addBrands(brand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BrandsApi#addBrands");
e.printStackTrace();
}
}
}
All URIs are relative to https://api.facestore.local/v1
Class | Method | HTTP request | Description |
---|---|---|---|
BrandsApi | addBrands | POST /brands | |
BrandsApi | deleteBrandById | DELETE /brands/{id}/ | |
BrandsApi | getBrandById | GET /brands/{id}/ | |
BrandsApi | getBrands | GET /brands | |
BrandsApi | updateCategoryById | PUT /brands/{id}/ | |
BrandsApi | updateCategoryById_0 | PATCH /brands/{id}/ | |
CategoriesApi | addCategories | POST /categories | |
CategoriesApi | deleteCategoryById | DELETE /categories/{id}/ | |
CategoriesApi | getCategories | GET /categories | |
CategoriesApi | getCategoryById | GET /categories/{id}/ | |
CategoriesApi | updateCategoryById | PUT /categories/{id}/ | |
CustomersApi | getCustomerById | GET /customers/{id}/ | |
CustomersApi | getCustomers | GET /customers | |
OrdersApi | getOrderById | GET /orders/{id}/ | |
OrdersApi | getOrders | GET /orders | |
PaymentsApi | getPaymentById | GET /payments/{id}/ | |
PaymentsApi | getPayments | GET /payments | |
ProductsApi | addProduct | POST /products | |
ProductsApi | deleteProductById | DELETE /products/{id}/ | |
ProductsApi | getProductById | GET /products/{id}/ | |
ProductsApi | getProducts | GET /products | |
ProductsApi | updateProductById | PUT /products/{id}/ | |
ProductsApi | updateProductById_0 | PATCH /products/{id}/ | |
ProductsAttributesApi | addProductsAttributes | POST /attributes | |
ProductsAttributesApi | deleteProductAttributeById | DELETE /attributes/{id}/ | |
ProductsAttributesApi | getProductAttributeById | GET /attributes/{id}/ | |
ProductsAttributesApi | getProductsAttributes | GET /attributes | |
ProductsAttributesApi | updateProductAttributeById | PUT /attributes/{id}/ | |
ShippingsApi | addShipping | POST /shippings | |
ShippingsApi | deleteShippingById | DELETE /shippings/{id}/ | |
ShippingsApi | getShippingById | GET /shippings/{id}/ | |
ShippingsApi | getShippings | GET /shippings | |
ShippingsApi | updateShippingById | PUT /shippings/{id}/ | |
ShippingsApi | updateShippingById_0 | PATCH /shippings/{id}/ | |
TaxesApi | addTaxes | POST /taxes | |
TaxesApi | deleteTaxById | DELETE /taxes/{id}/ | |
TaxesApi | getTaxById | GET /taxes/{id}/ | |
TaxesApi | getTaxes | GET /taxes | |
TaxesApi | updateTaxById | PUT /taxes/{id}/ | |
TaxesApi | updateTaxById_0 | PATCH /taxes/{id}/ |
- Attribute
- AttributeOptions
- Brand
- Category
- Customer
- DefaultResponse
- I18n
- I18nProduct
- I18nProductSeo
- InlineResponse200
- InlineResponse2001
- InlineResponse2001Meta
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse201
- InlineResponse2011
- InlineResponse2012
- InlineResponse2013
- InlineResponse2014
- MetaPartialResponse
- NotFoundResponse
- Options
- Order
- Payment
- Product
- Shipping
- Tax
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: APIToken
- Location: HTTP header
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.