1 Introduction
The MMM-API is a collection of endpoints and objects to support the execution of Process Actions performed by Processes (e.g. Users and Device) involving Items or other Processes.
The MMM-API can also be leveraged to provide Users with specific functionalities through Services. A list of Services used in Verification Use Cases, e.g., Registration or Rights.
2 Description
The APIs were designed to run Create, Read, Update and Delete (CRUD) operations on a MongoDB NoSQL database. The base path is: /api. The documentation of the API relies on the OpenAPI 3.0.1 specification. More specifically, the documentation is structured as follow:
Section | Description |
openapi | OpenAPI version used for the documentation |
info | Metadata about the API (title, version, description, contact info). |
paths | Endpoints and operations (GET, POST, PUT and DELETE). |
components | Reusable objects like schemas, responses and parameters. |
The comprehensive list including all the paths and components is available in the JSON format.
3 Components
Components were developed by following the definition of the MMM-TEC V2.0 Item.
4 Paths
Paths are structured to match the MMM’s Services.
4.1 Activity Service
Base Route: api/Activity
Description: The Activity Service exposes endpoints to manage Process Actions and User information.
Sample Endpoint
To memorize a Process Action, it is possible to send a POST to the api/Activity/process-action endpoint. The Process Action to be added is specified in the request body.
curl -X ‘POST’ \
‘https://localhost:7099/api/Activity/process-actions’ \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘ <ProcessAction> ‘
4.2 Authentication Service
Base Route: /api/authentication
Description: The Authentication Service provides endpoints for managing Authentication item. Endpoint are provided to create, retrieve, and delete Authentication item.
Sample Endpoint
To retrieve a list of all Authentication items it is possible to send a GET request.
curl -X ‘GET’ \
‘https://localhost:7099/api/Authentication/authentications’ \
-H ‘accept: text/plain’
4.3 Author Service
Base Route: /api/author
Description: This controller handles the creation, retrieval, and deletion of Item. It supports dynamic deserialization and conditional logic for polymorphic data insertion via query parameter format. Dedicated endpoints are available for specific items such as BasicObject, and MObject.
Sample Endpoint:
To create a new Item based on the provide format query parameter, a POST request can be sent to the endpoint api/Author/item?format=item’. Depending on the specified format, the web server automatically deserialize the raw JSON input provided in the request body.
curl -X ‘POST’ \
‘https://localhost:7099/api/Author/items?format=item’ \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘{
“itemType”: <Item_Data_type>,
“itemContent”: <Json_Item>
}’
4.4 Communication Service
Base Route: /api/communication
Description: The Communication Service manages Message Items used for communication within Processes.
Sample Endpoint: The GET request can be used to retrieve all the messages.
curl -X ‘GET’ \
‘https://localhost:7099/api/Communication/messages’ \
-H ‘accept: text/plain’
4.5 Conversion Service
Base Route: /api/conversion
Description: The Conversion service provides endpoints for converting Items by updating their definition
Sample Endpoint: To update an existing BasicObject Item by its ID, a PUT request can be sent to the endpoint /api/conversion/basic-objects/{basicObjectId}.
The basicObjectId is provided as a path parameter, and the updated BasicObject data is included in the request body.
url -X ‘PUT’ \
‘https://localhost:7099/api/Conversion/basic-objects/<Basic_object_ID>’ \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘{<Modified_basic_object>}
4.6 Discovery Service
Base Route: api/discovery
Description: This Service manages BasicDiscovery Item and provides access to discovery data.
Sample Endpoint: A GET request can be sent to retrieve a list of all available BasicDiscovery Items.
curl -X ‘GET’ \
‘https://localhost:7099/api/Discovery/basic-discoveries’ \
-H ‘accept: text/plain’
4.7 Location Service
Base Route: /api/location
Description: The Location Service provides endpoints for managing both BasicMLocations and MLocations
Sample Endpoint: To delete a MLocation using its Id, a DELETE request can be sent to the api/Location/mlocations/<MLocationID> endpoint. The MLocationID of the MLocation to be removed is provided as a path parameter.
curl -X ‘DELETE’ \
‘https://localhost:7099/api/Location/mlocations/<MLocationID>’ \
-H ‘accept: */*’
4.8 Marketplace Service
Base Route: /api/marketplace
Description: This Service manages marketplace assets.
Sample Endpoint:
A POST request can be sent to the api/Marketplace/asset endpoint. The new Asset Item is specified in the request body.
curl -X ‘POST’ \
‘https://localhost:7099/api/Marketplace/assets’ \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘{<Asset>}’
4.9 Registration Service
Base Route: api/Registration
Description: This Service provides endpoints for managing user registration, account details, profiles, and avatars (i.e., personae). It supports operations like retrieving, creating, and updating accounts, personal profiles, and users. Additionally, it supports fetching and serving avatar files in different formats (GLB, PNG, JSON).
Sample Endpoint: A POST request can be sent to the api/Registration/accounts endpoint. The new Account Item is specified in the request body.
curl -X ‘POST’ \
‘https://localhost:7099/api/Registration/accounts’ \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘{ <Account> }’
4.10 Rights Service
Base Route: /api/Rights
Description: The Right Service manages the rights associated with various Items such as Accounts, Basic Objects, MLocations, etc. It offers endpoints for CRUD operations on rights, as well as specific endpoints for associating rights with Processes, Items, and MLocations.
Sample Endpoint:
To retrieve all the rights associated with a User of a specific Account, it is possible to send a GET request to api/Right/accounts/<AccountId>/<UserId>/rights. The accountId and UserId are provided as path parameters.
curl -X ‘GET’ \
‘https://localhost:7099/api/Rights/accounts/<AccountId>/<UserId>/rights’ \
-H ‘accept: */*’
4.11 Transaction Service
Base Route: /api/Transaction
Description: The Transaction service handles the operations related to the Transaction and Wallet Items.
Sample Endpoint:
To update an existing Wallet item by its Id, a PUT request can be sent to the api/Transaction/wallets/<walletId> endpoint.
The walletId is provided as a path parameter, and the updated Wallet data is included in the request body.
curl -X ‘PUT’ \
‘https://localhost:7099/api/Transaction/wallets/<walletId> \
-H ‘accept: */*’ \
-H ‘Content-Type: application/json’ \
-d ‘{<Wallet>}’