WebApi Overview
Overview
Interactions between Fluentis and external applications will have to be done using WebApi (REST) controllers, which are the main tool offered by Fluentis to implement and expose server-side services that can be reached by different platforms. The API call uses the standard HTTP (or HTTPS) protocol and usually uses the HTTP POST method. The various parameters are sent in the request body using the JSON format.
Method types
Considering the functionality of the method, We have these kind of WebApi method types:
Method Type | Description |
---|---|
Import | Used to import data in Fluentis. Example: Import a FSItem object. |
Export | Used to export data from Fluentis. Example: Export a FSItem object. |
Service | Used to execute read only tasks in Fluentis. Example: Get the stock summary for a FSItem object |
Operation | Used to execute read write tasks in Fluentis. Example: Unload a Sales Delivery Note document. |
Authentication and Authorization
Fluentis uses Basic Authentication, and it expects a valid username and password combination in the Authorization HTTP header of the request (https://datatracker.ietf.org/doc/html/rfc7617). In few words, Fluentis expects a header field in the form of Authorization: Basic <credentials>
, where <credentials>
is the Base64 encoding of username and password joined by a single colon :
.
The username and password are validated against Arm Service Users, and in this way is identified also the Arm Connection where the WebApi call will be executed.
Fluentis must understand the Company and Department the call needs to be executed, in base of the company and department related parameters sent in the request body. Is mandatory to identify a single Company and Department combination for the current call. If present, the rights configured for the controller and controller method are verified for the current user, company and department.
Common Parameters
Name | Type | Required | Description |
---|---|---|---|
Company identification | |||
CompanyId | integer | No | Company Id (Id property of the Fluentis.FluentisErp.Core.FSCompany object). |
CompanyCode | string | No | Company Code (Code property of the Fluentis.FluentisErp.Core.FSCompany object). |
Department identification | |||
DepartmentId | integer | No | Department Id (Id property of the Fluentis.FluentisErp.Core.FSDepartment object). |
DepartmentCode | string | No | Department Code (Code property of the Fluentis.FluentisErp.Core.FSDepartment object). |
Company Identification
Is enough to specify CompanyId or CompanyCode parameter. If both are specified they need to correspond to the same company.
Department Identification
Is enough to specify DepartmentId or DepartmentCode parameter. If both are specified they need to correspond to the same department. The department is searched under the company identified previously.
The best practice is to include Company and Department information in each call. Anyway, if all 4 Company and Department related parameters are missing, Fluentis will compute the list of all the Company/Department combinations for the current user. If this list contains one and only one combination, Fluentis will use this Company and Department.