All API responses are wrapped with a response object. An actual response looks like.
{
"success": true,
"result": {
...
},
"error": null,
"targetUrl": null,
"unAuthorizedRequest": false,
"__abp": true
}
Here’s an overview of the fields:
success A boolean value that indicates the status of the operation.result The actual return value. It’s valid if the request was successfully and the server sends a return value.error In the case of a failed request an object that contains a message and details field with the error description.targetUrl This provides a way for the server to redirect the client to another URL if needed.unAuthorizedRequest This provides a method for the server to inform the client that this operation is not authorized or the user is not authenticated.__abp A special signature that is returned. You don’t use this yourself.InsuranceManager returns the following HTTP status codes when exceptions occurs:
details field contains more information why the request was invalid.As described above, success will be false in the case of an error. A response of a failed request will look like this:
{
"targetUrl": null,
"result": null,
"success": false,
"error": {
"message": "An internal error occurred during your request!",
"details": "..."
},
"unAuthorizedRequest": false,
"__abp": true
}
As you can see, success is false and result is null.
You can select the language in which InsuranceManager will return messages. Currently we support the following languages:
To select the language for your request, you can switch between different methods.
.AspNetCore.Culture or Accept-Language value in the header of the request. Example value: “c=fr|uic=fr”.AspNetCore.Culture cookie value. Example value: “c=fr|uic=fr”There is a rate limit active on the Web-API. If you execute to many request against the Web-API you will be blocked for a certain time.
In this case, you will receive a HTTP 429 status indicating that you have exceeded your limits.
Since all tenant users use the same application, we should have a way of distinguishing the tenant of the current request. The default session implementation uses different approaches to find the tenant related to the current request in this given order:
Abp.TenantId value in the header of the request.Abp.TenantId cookie value.The available tenants are:
You can authenticate a user by an authenticate api call, where you provide a login and password.
After succesfully authentication, a bearer token is send and you need to pass this token to each request. Some requests are not accessible for each login and you get an unauthorized error message.
The most list requests have general request parameters.
There are 2 parameters to provide by querystring.
To sort a result set, you can provide by querystring a Sorting parameter.
You should include the sorting field(s) and optionnally a direction (ASC or DESC).
It can contain more than one field separated by comma.
To filter a result set, you can provide by querystring a Filter parameter.
The filter is in C# syntax.
Before executing a request, the incomming data will be validated. The validation process is organized in two steps.
The following is a list of messages in the supported langues that you can receive if there are binding problems:
The following is a list of messages in the supported langues that you can receive if there are data validation problems: