OverView
REST ( Representation State Transfer) , the World Wide Web (www) is distributed as a software architectural style for improved system.
JSON describes himself ( self-describing ) is a data exchange format.
LOGO Restful API
- Data stores files as JSON
- Thus, each processing performed in the product " JSON format through a URL " access makes it possible.
- This web and mobile applications, Restful API is just one of the features that make this so powerful.
Some of the advantages of the rest :
scalability of component interaction.
the generality of interfaces
It is an independent distribution of components.
REST also reducing the time delay, strengthen security and acts as a mediator between the application components, including legal systems.
REST API can be used in any language can make HTTP calls.
Design PrinciplesURLs :
A number of pragmatic Restful design principle is to keep everything simple. Base URL must be simple and intuitive.Base URL design API ( affordance ) is the most important factor for. Simple and intuitive design, a base URL makes it easier to use the API.
Affordances, the document is a design feature that can be used to express how anything without need.
Names
Release
URLs have driven (large, that for major version), you must make mandatory to choose the highest.
Base URL : https://<application uri>/rest/v{versiyon numarası}
An example URL: https://localhost:8080/logo/rest/v1.0/orders
Hierarchical Structure
URL to highlight the hierarchical nature of the structure ( aggregation or composition ) should strengthen .
Example: the lines in a desired order.
GET /orders/1234/transactions/1
Defining himself (self - descriptive ) :
Each resources, services and definitions to describe the REST service methods are applied.
a. Swagger UI had the support
b. The purpose of the service method, not only the design but also to explain the operations you can do on REST objects.
GET / services call, it will return all the REST methods and definitions of all the objects in the REST.
http://localhost:8080/logo/rest/services
c. The purpose of defining the method, the object is to describe the design of REST.
GET / orders / describe the call will return a draft of the order object.
An Example URL :http://localhost:8080/logo/rest/v1.0/orders/describe
For more information http://json-schema.org/
Security: OAuth2 & HTTPS
- OAuth2 can use to manage authorization. OAuth2,
- Typing requirements of the client and that they adapt to 99%.
- Each API / HTTPS can be used for OAuth2 request.
- If possible, avoid log
If do the authentication for each request, if necessary.
(Stateless)
The construction authorization according to the source content. not by URL.
Username / password rather than use the API key.
401 " Unauthorized " accuracy/authentication means have not been confirmed.
" You need valid credentials for me to respond to this request."403 " Forbidden " means that you have authority.
599 " logo Exchange Error" j- guar ' also made the error corresponds taken during the requested operation.
" Receipt date must be within the financial period. "
Source Access: ( List + CRUD)
Common Query Options
Name | Compulsory | Defaults | Value Type | Meaning |
Company | No | The user's default company | İnteger | Registration number of the company |
Language | No | The default language for the user | String | Language name |
Set | No | “” | String | Application variable "set" value |
Example URL: https://localhost:8080/logo/rest/v1.0/orders?firm=1&language=TRTR&set=DRF