FleetManager API REFERENCE
FleetManager API REFERENCE
com Page | 1
Rest API Reference Manual
Index
Index ........................................................................................................................................................ 2
Introduction .............................................................................................................................................. 3
Endpoints ..................................................................................................................................................... 3
Request types .............................................................................................................................................. 3
GET ................................................................................................................................................................. 3
POST ............................................................................................................................................................... 3
Authentication .......................................................................................................................................... 4
Obtaining API key ......................................................................................................................................... 4
Using api key ................................................................................................................................................ 4
GET ................................................................................................................................................................. 4
POST ............................................................................................................................................................... 4
HTTP status codes .................................................................................................................................. 5
Error handling .......................................................................................................................................... 5
Operations ............................................................................................................................................... 5
Node ............................................................................................................................................................ 6
Get nodes by group ........................................................................................................................................ 6
Get nodes by token ........................................................................................................................................ 6
Get nodes by uid ............................................................................................................................................ 7
Move node ..................................................................................................................................................... 7
Delete node .................................................................................................................................................... 7
Deactivate node ............................................................................................................................................. 7
Activate node ................................................................................................................................................. 8
Group ........................................................................................................................................................... 8
Get children .................................................................................................................................................... 8
Get groups by workspace ............................................................................................................................... 8
Workspace ................................................................................................................................................... 8
Get workspaces .............................................................................................................................................. 9
Get tokens ...................................................................................................................................................... 9
Appendix A: internal errors .................................................................................................................... 10
401 – Unauthorized .................................................................................................................................... 10
403 – Forbidden ......................................................................................................................................... 10
500 – Internal Server Error ......................................................................................................................... 10
400 – Bad Request ..................................................................................................................................... 10
Introduction
Fleet Manager API is organized around REST. All endpoints return JSON-encoded responses and
use standard HTTP response codes.
The examples of this manual will be made using postman, also a postman collection will be provided
containing all API endpoints (operations).
Endpoints
All API operations endpoints have a common URL: <FM-SERVER-URL>/api followed by the specific
operation endpoint, for example:
https://myfleet.n3uron.com/api/workspace/getWorkspaces
Request types
There are two request types (or methods) GET and POST. Both of them always return a JSON-formatted
document.
GET
GET methods are those that do not modify data, only retrieve it. The parameters on these requests are
passed as query parameters, for example:
https://myfleet.n3uron.com/api/workspace/getWorkspaces?apiKey=abcdedfefs
POST
POST methods are those that modify data (create, update or delete). The data is a JSON document on
the request body; the response follows the same pattern as GET methods.
The "apiKey" can be found in the security section of the user settings.
POST
For POST method the API key must be included in the JSON-formatted body as "apiKey" parameter:
HTTP status codes
The API returns the following http codes depending on the result of the request:
• 200 – OK: The operation was executed correctly.
• 400 – Bad Request: The operation requested returned an error.
• 401 – Unauthorized: Authentication error.
• 403 – Forbidden: The API key permissions are not enough to perform the request.
• 404 – Not Found: The requested operation doesn’t exist.
• 500 – Internal Server Error: Error in Fleet Manager side.
Error handling
Errors on Fleet Manager API returns an http code different from 200 – OK. Additionally, the error
responses include a description and a code of the error. Error codes description can be found on
Appendix A.
Authorization error returning a 401 – Unauthorized http status code and an internal error with code 114
Operations
Operations are divided in different services, for example, “node” is related to the operations related to
the remote nodes.
Autodiscover request (api/autodiscover) returns all the operations available through the API and
the following information for each request:
• Method: Shows operation method GET/POST.
• Accepted parameters: JSON-formatted accepted parameters showing the type of every
Node
Remote node related operations.
Move node
Moves a node to a new group inside the same workspace.
• Endpoint: node/move
• Method: POST
• Accepted parameters
o groupId: destination group id.
o Id: node to move id(uid).
• Required parameters: id, groupId.
• Response parameters: empty or error.
Delete node
Deletes a node from Fleet Manager server. In order to add it again, just restart Fleet Manager Client
module on the remote node.
• Endpoint: node/delete
• Method: POST
• Accepted parameters
o Id: node to delete id(uid).
• Required parameters: id.
• Response parameters: empty or error.
Deactivate node
Deactivates a node. While a node is deactivated in the Fleet Manager server it is not possible to monitor
its status or launch the remote access:
• Endpoint: node/deactivate
• Method: POST
• Accepted parameters
o Id: node to deactivate id(uid).
• Required parameters: id.
Activate node
Activates a node, the node will return to the active status in the Fleet Manager server. When a remote
node is active it is possible to monitor its status and launch remote connections from the Fleet Manager
server. Please note activating/deactivating a node is just related to Fleet Manager server, it doesn't have
any influence in the functionality of the remote node.
• Endpoint: node/activate
• Method: POST
• Accepted parameters
o Id: node to deactivate id(uid).
• Required parameters: id.
• Response parameters: empty or error.
Group
Operations related to Groups.
Get children
Provides the subgroups contained in a group.
• Endpoint: group/getChildren
• Method: GET
• Accepted parameters
o Id: group id.
• Required parameters: id.
• Response parameters: Array of groups.
o id: Child group id.
o name: group name.
o flags: reserved system flags for root group and Unassigned group.
o children: Boolean that tells if the group has subgroups.
Workspace
Workspace related operations
Get workspaces
Provides the workspaces related to the user:
• Endpoint: workspace/getWorkspaces
• Method: GET
• Accepted parameters: None.
• Required parameters: None.
• Response parameters: Array of workspaces.
o id: Workspace id.
o name: Workspace name.
o creator: Indicates if the user is the creator of the workspace.
o accepted: Indicates if the user has accepted the invitation to the workspace.
Get tokens
Provides the tokens generated in the workspace:
• Endpoint: workspace/getWorkspaces
• Method: GET
• Accepted parameters:
o workspaceId: Workspace id.
• Required parameters: workspaceId.
• Response parameters: Array of tokens.
o name: Token name.
o token: Token.
o created: Creation date.
o active: True if token is active.
401 – Unauthorized
• 114: Api key is missing or incorrect.
403 – Forbidden
• 108: Invalid permissions to execute the operation.
• 110: Group not available in the selected workspace.
• 109: Group not editable in the selected workspace.