API
This document introduces the Web API for eLegere.
The eLegere Web API enables the web clients to request data from eLegere's applications. The returned data depends on the level of authorized access from the user's session: if the user hasn't a specific authorization, the API won't return some data.
Note
The API returns all the responses as either JSON objects or content stream.
Every time your third-party integration requests data through the API, the returned JSON objects encodes the different data types according to specific formats. Check the eLegere Data Types reference to learn about the eLegere data types' format.
Hint
If a method requires any ID to work (e.g. ApplicationId, WorkspaceId): you can recover the necessary Id by checking the eLegere's meta-data database.
Info
Check the Conventions and HTTP Status Codes to learn about terms conventions and HTTP Status Codes responses.
Attention
In the Header description, SessionToken stands for the access_token
in the Request.
Authentication¶
Authentication
The method enables the user to authenticate to the eLegere's environment. The service returns a Session Token with everything required for the access.
Request¶
Method | POST |
URL | {base_url}/identityprovider/connect/token |
Protocols | HTTPS |
ContentType | application/x-www-form-urlencoded |
Headers | no headers required |
Return | JSON Object |
Body:¶
1 |
|
Examples¶
Create a WEB request to authorize a user's access and obtain a Session Token for them. The JSON contains the Session Token, the expiration time in milliseconds, the type, and the scope.
Raw Request:
1 2 3 |
|
Raw Response:
1 2 3 4 5 6 7 |
|
Get Items¶
Data
The method queries an application through the WorkspaceId, ApplicationId, and Session Token to obtain an application's data.
Request¶
Method | POST |
URL | {base_url}/SmartExplorerApi/api/items |
Protocols | HTTPS |
ContentType | application/json |
Headers | ApplicationId, SessionToken, WorkspaceId |
Return | Array of JSON Objects |
Body:¶
1 |
|
Examples¶
The request provides the Session Token for the access, the response file's format, the workspace Id (i.e the Domain) and application's Id for the the API to retrive the data. The body contains the string with the query. The query provides the parameters for the top, exceptions, and the order and field for the sorting.
Raw Request:
1 2 3 4 5 6 7 8 |
|
Raw Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Get Items Count¶
Data
The method queries an application through the WorkspaceId, ApplicationId, and Session Token to count the exact number of items in the application satisfying the criteria.
Request¶
Method | POST |
URL | {base_url}/SmartExplorerApi/api/items |
Protocols | HTTPS |
ContentType | application/json |
Headers | ApplicationId, SessionToken, WorkspaceId |
Return | JSON Object |
Body:¶
1 |
|
Examples¶
The request provides the Session Token for the access, the response file's format, the workspace Id (i.e the Domain) and application's Id for the the API to retrive the info. The response reports the number of items according to the criteria specified in the body.
Raw Request:
1 2 3 4 5 6 7 8 |
|
Raw Response:
1 2 3 4 5 6 7 8 9 10 11 |
|
Get Attachments List¶
Data
The method retrieves the attachments list of a row in an application starting from the row's Id and attachments' folder Id.
Note
You can obtain a row's Id through the Get Items method. Replace it in the URL to identify the row's attachments list.
Info
The last part of the URL and FolderId eq FOLDERID
is optional. You need the FOLDERID
only to retrive the attachment list if in a folder within the row's attachments folders' tree.
Request¶
Method | GET |
URL | {base_url}/SmartExplorerApi/api/attachments?$filter=ParentId eq ROWID and FolderId eq FOLDERID |
Protocols | HTTPS |
ContentType | application/json |
Headers | ApplicationId, SessionToken, WorkspaceId |
Return | Array of JSON Objects |
Examples¶
The method retrieves the row's attachments list starting from the row's Id. The array object contains an object for each row's attachment. Each object details the individual attachment's information.
Raw Request:
1 2 3 4 5 |
|
Raw Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Get Attachment¶
Data
The method accesses through a Session Token and retrieves the desired attachment through its Id on the database.
Note
You can download both individual attachments and folders. If the request points a folder, the API returns a .zip archive with all the folder's attachments.
Note
In the request, the rk
is the parent key of the Master-Detail relation. rk
is optional in the request. You must specify rk
in the request if and only if you download an attachment from a Detail's row. Otherwise, the request refers to a row on the Master table.
Request¶
Method | GET |
URL | {base_url}/SmartExplorerApi/api/attachment/download |
Protocols | HTTPS |
ContentType | application/json |
Headers | ApplicationId, SessionToken, WorkspaceId |
Return | File Stream |
Examples¶
The method retrieves an attachment starting from the row's Id. In the example below, the method retrieves an attached XML file from a row.
Raw Request:
1 2 3 4 5 6 7 8 9 |
|
Raw Response:
1 2 3 4 5 |
|
Run Action¶
Data
The method launches one of the Custom Actions designed for the chosen application. The method identifies the Custom Action to launch through the action's actionId
.
Request¶
Method | POST |
URL | {base_url}/SmartExplorerApi/api/attachment/file?id=1 |
Protocols | HTTPS |
ContentType | application/json |
Headers | ApplicationId, SessionToken, WorkspaceId |
Return | JSON Object |
Body:¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Examples¶
The method executes the specified Custom Actions and returns the object reporting the operation's result. If the key IsSuccessful
in the object has value true
, the Custom Action has run successfully.
Raw Request:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Raw Response:
1 2 3 4 5 6 7 8 9 10 |
|
Send Email¶
Utility
The method queries the service to send an email containing the specified recipients, subject, body, and the providerId (optional) in the request. The providerId is a GUID identifying the eLegere installation's email provider's settings. If the request doesn't contain any providerId, the Send Email API uses the default eLegere providerId configured during the installation.
Request¶
Method | POST |
URL | {base_url}/ewebaggregator/api/v1/email/queue |
Protocols | HTTPS |
ContentType | application/json |
Headers | Authorization, WorkspaceId |
Return | No Object Returned |
Body:¶
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Examples¶
The service receives the request with the recipients, subject, and the body information. The request doesn't contain a providerId: it will use the default eLegere installation's provider.
Raw Request:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Raw Response:
1 |
|