FowApps Standarts
FowApps is designed in accordance with OAS3 guidelines. The response scheme is predefined.
This API returns a standardized response objects for all situations. None of endpoint returns directly main object of result. All of responses are placed into ApiResult object.
Successful and unsuccessful requests are as follows.
WARNING: This scheme is used at
v1.0
or higher Api Versions.
Parameters of ApiResult
Name | Type | Required | Description |
---|---|---|---|
Success | boolean | ✅ | Information about if proccess resulted successfully or not. |
Key | string | ✅ | Type of response. Also each error has their own key. It's more like error code. |
Data | object / Generic<T> | ❕ | Contains main data of response. Data can be null with some unsuccessful requests. |
Meta | object | ❌ | Metadata about response, like pagination page counts or depricated elements etc. |
Message | string | ❕ | Message about request. Mostly unseuccessful requests have message about it. |
IsUserFriendlyMessage | boolean | ❌ | Indicates if Message comes from resources and readable by directly users or not. |
Examples
- A Successful listing result:
{
"success": true,
"key": "OK",
"message": "Completed operation successfully.",
"data": [
{
"id": "1234",
"title": "Hello World!"
},
{
"id": "1235",
"title": "Hello World 2!"
}
],
"meta": {
"total": 2,
"page": 1,
"perPage": 10,
"totalPages": 1
}
}
- A badrequest result:
{
"message": "EntityNotFound System.Object[]",
"isUserFriendlyMessage": true,
"key": "EntityNotFound",
"errorCode": 1000,
"instance": "469492af-2982-49ce-9d85-88b0b0a60182"
}
- An internal server error result:
{
"message": "Unhandled Exception",
"isUserFriendlyMessage": false,
"key": "InternelServerError",
"errorCode": 5000
}
Requests
Our API requests use JSON format. To make JSON formatted request, make sure you provide Content-Type: application/json in HTTP request headers. Our API supports UTF-8 for character encoding.
Method | Description |
---|---|
GET | Used for get or filter data |
POST | Used for create data |
PUT | Used for replace data |
PATCH | Used for modify data |
DELETE | Used for delete data |
Url Naming
All our endpoints contain a common naming convention.
Names are used to name URIs
Generally, URIs are named with nouns that indicate the content of the resource, rather than adding a verb for the function being performed. For example, https://api.example.com/users is used instead of https://api.example.com/getUsers.
Intuitive, clear, unabridged names
Endpoints are intuitive and clear URL names are used. Abbreviations are not used in endpoints.
Slashes to denote URI hierarchy
Endpoints are typically structured in a hierarchy.
Going from left to right ("/") each progresses from the general to the specific.
For example, https://api.example.com/users/123/first-name will retrieve the first name of the user with ID number 123.
Separate words with hyphens
When a REST API endpoint contains multiple words (e.g. https://api.example.com/users/123/first-name), we separated the words using hyphens.
Lowercase Letters
Whenever possible, used lowercase letters in we API URLs. This is mainly because the RFC 3986 specification for URI standards denotes that URIs are case-sensitive (except for the scheme and host components of the URL). Lowercase letters for URIs are in widespread use, and also help avoid confusion about inconsistent capitalization.
Avoid special characters
Special characters are not only unnecessary, they can also be confusing for users and technically complex. Because URLs can only be sent and received using the ASCII character set, all of we API URLs contain only ASCII characters.
In addition, try to avoid the use of "unsafe" ASCII characters, which are typically encoded in order to prevent confusion and security issues (e.g. "%20" for the space character). "Unsafe" ASCII characters for URLs include the space character (" "), as well as brackets ("[]"), angle brackets ("<>"), braces ("{}"), and pipes ("|").
Http Status Codes
Code | Constant | Reason Phrase |
---|---|---|
100 | CONTINUE | Continue |
101 | SWITCHING_PROTOCOLS | Switching Protocols |
102 | PROCESSING | Processing |
200 | OK | OK |
201 | CREATED | Created |
202 | ACCEPTED | Accepted |
203 | NON_AUTHORITATIVE_INFORMATION | Non Authoritative Information |
204 | NO_CONTENT | No Content |
205 | RESET_CONTENT | Reset Content |
206 | PARTIAL_CONTENT | Partial Content |
207 | MULTI_STATUS | Multi-Status |
300 | MULTIPLE_CHOICES | Multiple Choices |
301 | MOVED_PERMANENTLY | Moved Permanently |
302 | MOVED_TEMPORARILY | Moved Temporarily |
303 | SEE_OTHER | See Other |
304 | NOT_MODIFIED | Not Modified |
305 | USE_PROXY | Use Proxy |
307 | TEMPORARY_REDIRECT | Temporary Redirect |
308 | PERMANENT_REDIRECT | Permanent Redirect |
400 | BAD_REQUEST | Bad Request |
401 | UNAUTHORIZED | Unauthorized |
402 | PAYMENT_REQUIRED | Payment Required |
403 | FORBIDDEN | Forbidden |
404 | NOT_FOUND | Not Found |
405 | METHOD_NOT_ALLOWED | Method Not Allowed |
406 | NOT_ACCEPTABLE | Not Acceptable |
407 | PROXY_AUTHENTICATION_REQUIRED | Proxy Authentication Required |
408 | REQUEST_TIMEOUT | Request Timeout |
409 | CONFLICT | Conflict |
410 | GONE | Gone |
411 | LENGTH_REQUIRED | Length Required |
412 | PRECONDITION_FAILED | Precondition Failed |
413 | REQUEST_TOO_LONG | Request Entity Too Large |
414 | REQUEST_URI_TOO_LONG | Request-URI Too Long |
415 | UNSUPPORTED_MEDIA_TYPE | Unsupported Media Type |
416 | REQUESTED_RANGE_NOT_SATISFIABLE | Requested Range Not Satisfiable |
417 | EXPECTATION_FAILED | Expectation Failed |
418 | IM_A_TEAPOT | I'm a teapot |
419 | INSUFFICIENT_SPACE_ON_RESOURCE | Insufficient Space on Resource |
420 | METHOD_FAILURE | Method Failure |
421 | MISDIRECTED_REQUEST | Misdirected Request |
422 | UNPROCESSABLE_ENTITY | Unprocessable Entity |
423 | LOCKED | Locked |
424 | FAILED_DEPENDENCY | Failed Dependency |
428 | PRECONDITION_REQUIRED | Precondition Required |
429 | TOO_MANY_REQUESTS | Too Many Requests |
431 | REQUEST_HEADER_FIELDS_TOO_LARGE | Request Header Fields Too Large |
451 | UNAVAILABLE_FOR_LEGAL_REASONS | Unavailable For Legal Reasons |
500 | INTERNAL_SERVER_ERROR | Internal Server Error |
501 | NOT_IMPLEMENTED | Not Implemented |
502 | BAD_GATEWAY | Bad Gateway |
503 | SERVICE_UNAVAILABLE | Service Unavailable |
504 | GATEWAY_TIMEOUT | Gateway Timeout |
505 | HTTP_VERSION_NOT_SUPPORTED | HTTP Version Not Supported |
507 | INSUFFICIENT_STORAGE | Insufficient Storage |
511 | NETWORK_AUTHENTICATION_REQUIRED | Network Authentication Required |