# LinkedIn Clone Version : 1.1.43 This project's structure and ideas are the same as he real linkedIn webiste ## How to Use Project Documents The `Linkedin` project has been designed and generated using **Mindbricks**, a powerful microservice-based backend generation platform. All documentation is automatically produced by the **Mindbricks Genesis Engine**, based on the high-level architectural patterns defined by the user or inferred by AI. This documentation set is intended for both **AI agents** and **human developers**—including frontend and backend engineers—who need precise and structured information about how to interact with the backend services of this project. Each document reflects the live architecture of the system, providing a reliable reference for API consumption, data models, authentication flows, and business logic. By following this documentation, developers can seamlessly integrate with the backend, while AI agents can use it to reason about the service structure, make accurate decisions, or even generate compatible client-side code. ## Accessing Project Services Each service generated by Mindbricks is exposed via a **dedicated REST API** endpoint. Every service documentation set includes the **base URL** of that service along with the **specific API paths** for each available route. Before consuming any API, developers or agents must understand the service URL structure and environment-specific endpoints. ### Service Endpoint Structure | Environment | URL Pattern Example | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/auth-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/auth-api` | | **Production** | `https://linkedin.mindbricks.co/auth-api` | Replace `auth` with the actual service name as lower case (e.g., `order-api`, `bff-service`, customermanagement-api etc.). ### Environment Usage Notes * **Preview APIs** become accessible after a project is previewed inside the Mindbricks platform. These are ideal for development and testing. * **Staging** and **Production** APIs are only accessible after the project is deployed to cloud environments provisioned via Mindbricks. * In some cases, the project owner may choose to deploy services on their **own infrastructure**. In such scenarios, the service base URLs will be **custom** and should be communicated manually by the project owner to developers or AI agents. > **Frontend applications** should be designed to **easily switch between environments**, allowing dynamic endpoint targeting for Preview, Staging, and Production. ## Getting Started: Use the Auth Service First Before interacting with other services in the `Linkedin` project, **AI agents and developers should begin by integrating with the Auth Service**. Mindbricks automatically generates a dedicated authentication microservice based on the project’s authentication definitions provided by the architect. This service provides the essential user and access management foundation for the project. Agents should first utilize the Auth Service to: * Register and authenticate users (login) * Manage users, roles, and permissions * Handle user groups (if defined) * Support multi-tenancy logic (if configured) * Perform Policy-Based Access Control (PBAC), if activated by the architect ### Auth Service Documentation Use the following resources to understand and integrate the Auth Service: * **REST API Guide** – ideal for frontend and direct HTTP usage * **Event Guide** – helpful for event-driven or cross-service integrations * **Service Design Document** – overall structure, patterns, and logic > **Note:** For most frontend use cases, the **REST API Guide** will be the primary source. The **Event Guide** and **Service Design** documents are especially useful when integrating with other backend microservices or building systems that interact with the auth service indirectly. ## Using the BFF (Backend-for-Frontend) Service In Mindbricks, all backend services are designed with an advanced **CQRS (Command Query Responsibility Segregation)** architecture. Within this architecture, **business services** are responsible for managing their respective domains and ensuring the accuracy and freshness of domain data. The **BFF service** complements these business services by providing a **read-only** aggregation and query layer tailored specifically for frontend and client-side applications. ### Key Principles of the BFF Service * **Elasticsearch Replicas for Fast Queries:** Each data object managed by a business service is automatically replicated as an **Elasticsearch index**, making it accessible for fast, frontend-oriented queries through the BFF. * **Cross-Service Data Aggregation:** The BFF offers an **aggregation layer** capable of combining data across multiple services, enabling complex filters, searches, and unified views of related data. * **Read-Only by Design:** The BFF service is **strictly read-only**. All create, update, or delete operations must be performed through the relevant business services, or via event-driven sagas if designed. ### BFF Service Documentation * **REST API Guide** – querying aggregated and indexed data * **Event Guide** – syncing strategies across replicas * **Service Design** – aggregation patterns and index structures > **Tip:** Use the BFF service as the **main entry point for all frontend data queries**. It simplifies access, reduces round-trips, and ensures that data is shaped appropriately for the UI layer. ## Business Services Overview The `LinkedIn Clone` project consists of multiple **business services**, each responsible for managing a specific domain within the system. These services expose their own REST APIs and documentation sets, and are accessible based on the environment (Preview, Staging, Production). ### Usage Guidance Business services are primarily designed to: * Handle the **state and operations of domain data** * Offer **Create, Update, Delete** operations over owned entities * Serve **direct data queries** (`get`, `list`) for their own objects when needed For advanced query needs across multiple services or aggregated views, prefer using the [BFF service](#using-the-bff-backend-for-frontend-service). ### Available Business Services ### jobApplication Service **Description:** Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/jobApplication-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/jobApplication-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/jobApplication-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/jobapplication-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/jobapplication-api` | | **Production** | `https://linkedin.mindbricks.co/jobapplication-api` | ### networking Service **Description:** Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/networking-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/networking-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/networking-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/networking-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/networking-api` | | **Production** | `https://linkedin.mindbricks.co/networking-api` | ### company Service **Description:** Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/company-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/company-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/company-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/company-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/company-api` | | **Production** | `https://linkedin.mindbricks.co/company-api` | ### content Service **Description:** Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/content-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/content-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/content-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/content-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/content-api` | | **Production** | `https://linkedin.mindbricks.co/content-api` | ### messaging Service **Description:** Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/messaging-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/messaging-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/messaging-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/messaging-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/messaging-api` | | **Production** | `https://linkedin.mindbricks.co/messaging-api` | ### profile Service **Description:** Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. **Documentation:** * [REST API Guide](https://linkedin.prw.mindbricks.com/document/profile-service/rest-api-guide) * [Event Guide](https://linkedin.prw.mindbricks.com/document/profile-service/event-guide) * [Service Design](https://linkedin.prw.mindbricks.com/document/profile-service/service-design) **Base URL Examples:** | Environment | URL | |-------------|---------------------| | **Preview** | `https://linkedin.prw.mindbricks.com/profile-api` | | **Staging** | `https://linkedin-stage.mindbricks.co/profile-api` | | **Production** | `https://linkedin.mindbricks.co/profile-api` | ## Conclusion This documentation set provides a comprehensive guide for understanding and consuming the `LinkedIn Clone` backend, generated by the Mindbricks platform. It is structured to support both AI agents and human developers in navigating authentication, data access, service responsibilities, and system architecture. To summarize: * Start with the **Auth Service** to manage users, roles, sessions, and permissions. * Use the **BFF Service** for optimized, read-only data queries and cross-service aggregation. * Refer to the **Business Services** when you need to manage domain-specific data or perform direct CRUD operations. Each service offers a complete set of documentation—REST API guides, event interface definitions, and design insights—to help you integrate efficiently and confidently. Whether you are building a frontend application, configuring an automation agent, or simply exploring the architecture, this documentation is your primary reference for working with the backend of this project. > For environment-specific access, ensure you're using the correct base URLs (Preview, Staging, Production), and coordinate with the project owner for any custom deployments. # EVENT GUIDE ## linkedin-auth-service Authentication service for the project ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Auth` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Auth` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Auth` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Auth` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Auth` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent user-created **Event topic**: `linkedin-auth-service-dbevent-user-created` This event is triggered upon the creation of a `user` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent user-updated **Event topic**: `linkedin-auth-service-dbevent-user-updated` Activation of this event follows the update of a `user` data object. The payload contains the updated information under the `user` attribute, along with the original data prior to update, labeled as `old_user` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_user:{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, user:{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent user-deleted **Event topic**: `linkedin-auth-service-dbevent-user-deleted` This event announces the deletion of a `user` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Auth` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event user-created **Event topic**: `elastic-index-linkedin_user-created` **Event payload**: ```json {"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event user-updated **Event topic**: `elastic-index-linkedin_user-created` **Event payload**: ```json {"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event user-deleted **Event topic**: `elastic-index-linkedin_user-deleted` **Event payload**: ```json {"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event user-extended **Event topic**: `elastic-index-linkedin_user-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event user-retrived **Event topic** : `linkedin-auth-service-user-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"GET","action":"get","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event user-updated **Event topic** : `linkedin-auth-service-user-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-updated **Event topic** : `linkedin-auth-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event user-created **Event topic** : `linkedin-auth-service-user-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"POST","action":"create","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event user-deleted **Event topic** : `linkedin-auth-service-user-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-archived **Event topic** : `linkedin-auth-service-profile-archived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event users-listed **Event topic** : `linkedin-auth-service-users-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `users` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`users`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"users","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","users":[{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event users-searched **Event topic** : `linkedin-auth-service-users-searched` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `users` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`users`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"users","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","users":[{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event userrole-updated **Event topic** : `linkedin-auth-service-userrole-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event userpassword-updated **Event topic** : `linkedin-auth-service-userpassword-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event userpasswordbyadmin-updated **Event topic** : `linkedin-auth-service-userpasswordbyadmin-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event briefuser-retrived **Event topic** : `linkedin-auth-service-briefuser-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"GET","action":"get","appVersion":"Version","rowCount":1,"user":{"fullname":"String","avatar":"String","isActive":true}} ``` ## Route Event user-registered **Event topic** : `linkedin-auth-service-user-registered` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `user` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`user`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"POST","action":"create","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-auth-service Authentication service for the project ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Auth Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Auth Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Auth Service via HTTP requests for purposes such as creating, updating, deleting and querying Auth objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Auth Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Auth service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Auth service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Auth service. This service is configured to listen for HTTP requests on port `3011`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Auth service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Auth` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Auth` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Auth` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Auth service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### User resource *Resource Definition* : A data object that stores the user information and handles login settings. *User Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **email** | String | | | * A string value to represent the user's email.* | | **password** | String | | | * A string value to represent the user's password. It will be stored as hashed.* | | **fullname** | String | | | *A string value to represent the fullname of the user* | | **avatar** | String | | | *The avatar url of the user. A random avatar will be generated if not provided* | | **roleId** | String | | | *A string value to represent the roleId of the user.* | | **emailVerified** | Boolean | | | *A boolean value to represent the email verification status of the user.* | ## Business Api ### Get User API *API Definition* : This api is used by admin roles or the users themselves to get the user profile information. *API Crud Type* : get *Default access route* : *GET* `/v1/users/:userId` #### Parameters The getUser api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"GET","action":"get","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get User](businessApi/getUser). ### Update User API *API Definition* : This route is used by admins to update user profiles. *API Crud Type* : update *Default access route* : *PATCH* `/v1/users/:userId` #### Parameters The updateUser api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update User](businessApi/updateUser). ### Update Profile API *API Definition* : This route is used by users to update their profiles. *API Crud Type* : update *Default access route* : *PATCH* `/v1/profile/:userId` #### Parameters The updateProfile api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Profile](businessApi/updateProfile). ### Create User API *API Definition* : This api is used by admin roles to create a new user manually from admin panels *API Crud Type* : create *Default access route* : *POST* `/v1/users` #### Parameters The createUser api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"POST","action":"create","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create User](businessApi/createUser). ### Delete User API *API Definition* : This api is used by admins to delete user profiles. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/users/:userId` #### Parameters The deleteUser api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete User](businessApi/deleteUser). ### Archive Profile API *API Definition* : This api is used by users to archive their profiles. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/archiveprofile/:userId` #### Parameters The archiveProfile api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Archive Profile](businessApi/archiveProfile). ### List Users API *API Definition* : The list of users is filtered by the tenantId. *API Crud Type* : list *Default access route* : *GET* `/v1/users` The listUsers api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`users`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"users","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","users":[{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Users](businessApi/listUsers). ### Search Users API *API Definition* : The list of users is filtered by the tenantId. *API Crud Type* : list *Default access route* : *GET* `/v1/searchusers` #### Parameters The searchUsers api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`users`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"users","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","users":[{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Search Users](businessApi/searchUsers). ### Update Userrole API *API Definition* : This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin *API Crud Type* : update *Default access route* : *PATCH* `/v1/userrole/:userId` #### Parameters The updateUserRole api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Userrole](businessApi/updateUserRole). ### Update Userpassword API *API Definition* : This route is used to update the password of users in the profile page by users themselves *API Crud Type* : update *Default access route* : *PATCH* `/v1/userpassword/:userId` #### Parameters The updateUserPassword api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Userpassword](businessApi/updateUserPassword). ### Update Userpasswordbyadmin API *API Definition* : This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords *API Crud Type* : update *Default access route* : *PATCH* `/v1/userpasswordbyadmin/:userId` #### Parameters The updateUserPasswordByAdmin api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Userpasswordbyadmin](businessApi/updateUserPasswordByAdmin). ### Get Briefuser API *API Definition* : This route is used by public to get simple user profile information. *API Crud Type* : get *Default access route* : *GET* `/v1/briefuser/:userId` #### Parameters The getBriefUser api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"GET","action":"get","appVersion":"Version","rowCount":1,"user":{"fullname":"String","avatar":"String","isActive":true}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Briefuser](businessApi/getBriefUser). ### Register User API *API Definition* : This api is used by public users to register themselves *API Crud Type* : create *Default access route* : *POST* `/v1/registeruser` #### Parameters The registerUser api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"user","method":"POST","action":"create","appVersion":"Version","rowCount":1,"user":{"id":"ID","email":"String","password":"String","fullname":"String","avatar":"String","roleId":"String","emailVerified":"Boolean","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Register User](businessApi/registerUser). ### Authentication Specific Routes ### Route: login *Route Definition*: Handles the login process by verifying user credentials and generating an authenticated session. *Route Type*: login *Access Routes*: - `GET /login`: Returns the HTML login page (not a frontend module, typically used in browser-based contexts for test purpose to make sending POST /login easier). - `POST /login`: Accepts credentials, verifies the user, creates a session, and returns a JWT access token. #### Parameters | Parameter | Type | Required | Population | |-------------|----------|----------|-----------------------------| | username | String | Yes | `request.body.username` | | password | String | Yes | `request.body.password` | #### Notes - This route accepts login credentials and creates an authenticated session if credentials are valid. - On success, the response will: - Set a cookie named `projectname-access-token[-tenantCodename]` with the JWT token. - Include the token in the response headers under the same name. - Return the full `session` object in the JSON body. - Note that `username` parameter should have the email of the user as value. You can also send an `email` parameter instead of `username` parameter. If both sent only `username` parameter will be read. ```js // Sample POST /login call axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` **Success Response** Returns the authenticated session object with a status code `200 OK`. A secure HTTP-only cookie and an access token header are included in the response. ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", ... } ``` **Error Responses** * **401 Unauthorized:** Invalid username or password. * **403 Forbidden:** Login attempt rejected due to pending email/mobile verification or 2FA requirements. * **400 Bad Request:** Missing credentials in the request. ### Route: logout *Route Definition*: Logs the user out by terminating the current session and clearing the access token. *Route Type*: logout *Access Route*: `POST /logout` #### Parameters This route does not require any parameters in the body or query. #### Behavior - Invalidates the current session on the server (if stored). - Clears the access token cookie (`projectname-access-token[-tenantCodename]`) from the client. - Responds with a 200 status and a simple confirmation object. ```js // Sample POST /logout call axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Notes** * This route is public, meaning it can be called without a session or token. * If the session is active, the server will clear associated session state and cookies. * The logout behavior may vary slightly depending on whether you're using cookie-based or header-based token management. **Error Responses** 00200 OK:** Always returned, regardless of whether a session existed. Logout is treated as idempotent. ### Route: publickey *Route Definition*: Returns the public RSA key used to verify JWT access tokens issued by the auth service. *Route Type*: publicKeyFetch *Access Route*: `GET /publickey` #### Parameters | Parameter | Type | Required | Population | |-----------|--------|----------|--------------------| | keyId | String | No | `request.query.keyId` | - `keyId` is optional. If provided, retrieves the public key corresponding to the specific `keyId`. If omitted, retrieves the current active public key (`global.currentKeyId`). #### Behavior - Reads the requested RSA public key file from the server filesystem. - If the key exists, returns it along with its `keyId`. - If the key does not exist, returns a 404 error. ```js // Sample GET /publickey call axios.get("/publickey", { params: { keyId: "currentKeyIdOptional" } }); ``` **Success Response** Returns the active public key and its associated keyId. ```json { "keyId": "a1b2c3d4", "keyData": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhki...\n-----END PUBLIC KEY-----" } ```` **Error Responses** **404 Not Found:** Public key file could not be found on the server. ### Token Key Management Mindbricks uses RSA key pairs to sign and verify JWT access tokens securely. While the auth service signs each token with a private key, other services within the system — or external clients — need the corresponding **public key** to verify the authenticity and integrity of received tokens. The `/publickey` endpoint allows services and clients to dynamically fetch the currently active public key, ensuring that token verification remains secure even if key rotation is performed. > **Note**: > The `/publickey` route is not intended for direct frontend (browser) consumption. > Instead, it is primarily used by trusted backend services, APIs, or middleware systems that need to independently verify access tokens issued by the auth service — without making verification-dependent API calls to the auth service itself. Accessing the public key is crucial for validating user sessions efficiently and maintaining a decentralized trust model across your platform. ### Route: relogin *Route Definition*: Performs a silent login by verifying the current access token, refreshing the session, and returning a new access token along with updated user information. *Route Type*: sessionRefresh *Access Route*: `GET /relogin` #### Parameters This route does **not** require any request parameters. #### Behavior - Validates the access token associated with the request. - If the token is valid: - Re-authenticates the user using the session's user ID. - Fetches the most up-to-date user information from the database. - Generates a new session object with a **new session ID** and **new access token**. - If the token is invalid or missing, returns a 401 Unauthorized error. ```js // Example call to refresh session axios.get("/relogin", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns a new session object, refreshed from database data. ```json { "sessionId": "new-session-uuid", "userId": "user-uuid", "email": "user@example.com", "roleId": "admin", "accessToken": "new-jwt-token", ... } ``` **Error Responses** * **401 Unauthorized**: Token is missing, invalid, or session cannot be re-established. ```json { "status": "ERR", "message": "Cannot relogin" } ``` **Notes** - The `/relogin` route is commonly used for **silent login flows**, especially after page reloads or token-based auto-login mechanisms. - It triggers internal logic (`req.userAuthUpdate = true`) to signal that the session should be re-initialized and repopulated. - It is not a simple session lookup — it performs a fresh authentication pass using the session's user context. - The refreshed session ensures any updates to user profile, roles, or permissions are immediately reflected. > **Tip:** > This route is ideal when you want to **rebuild a user's session** in the frontend without requiring them to manually log in again. ## Verification Services — Email Verification Email verification is a two-step flow that ensures a user's email address is verified and trusted by the system. All verification services, including email verification, are located under the `/verification-services` base path. ### When is Email Verification Triggered? - After user registration, if `emailVerificationRequiredForLogin` is active. - During a separate user action to verify or update email addresses. - When login fails with `EmailVerificationNeeded` and frontend initiates verification. ### Email Verification Flow 1. **Frontend calls `/verification-services/email-verification/start`** with the user's email address. - Mindbricks checks if the email is already verified. - A secret code is generated and stored in the cache linked to the user. - The code is sent to the user's email or returned in the response (only in development environments for easier testing). 2. **User receives the code and enters it into the frontend application.** 3. **Frontend calls `/verification-services/email-verification/complete`** with the `email` and the received `secretCode`. - Mindbricks checks that the code is valid, not expired, and matches. - If valid, the user’s `emailVerified` flag is set to `true`, and a success response is returned. --- ## API Endpoints ### POST `/verification-services/email-verification/start` **Purpose** Starts the email verification process by generating and sending a secret verification code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-----------------------------| | email | String | Yes | The email address to verify | ```json { "email": "user@example.com" } ``` #### Success Response Secret code details (in development environment). Confirms that the verification step has been started. ```json { "userId": "user-uuid", "email": "user@example.com", "secretCode": "123456", "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z" } ``` > ⚠️ In production, the secret code is only sent via email, not exposed in the API response. #### Error Responses - `400 Bad Request`: Email already verified. - `403 Forbidden`: Sending a code too frequently (anti-spam). --- ### POST `/verification-services/email-verification/complete` **Purpose** Completes the email verification by validating the secret code. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|-------------------------------------| | email | String | Yes | The user email being verified | | secretCode | String | Yes | The secret code received via email | ```json { "email": "user@example.com", "secretCode": "123456" } ``` #### Success Response Returns confirmation that the email has been verified. ```json { "userId": "user-uuid", "email": "user@example.com", "isVerified": true } ``` #### Error Responses - `403 Forbidden`: - Secret code mismatch - Secret code expired - No ongoing verification found --- ## Important Behavioral Notes ### Resend Throttling You can only request a new verification code after a cooldown period (`resendTimeWindow`, e.g., 60 seconds). ### Expiration Handling Verification codes expire after a configured period (`expireTimeWindow`, e.g., 1 day). ### One Code Per Session Only one active verification session per user is allowed at a time. > 💡 Mindbricks automatically manages spam prevention, session caching, expiration, and event broadcasting (start/complete events) for all verification steps. ## Verification Services — Mobile Verification Mobile verification is a two-step flow that ensures a user's mobile number is verified and trusted by the system. All verification services, including mobile verification, are located under the `/verification-services` base path. ### When is Mobile Verification Triggered? - After user registration, if `mobileVerificationRequiredForLogin` is active. - During a separate user action to verify or update mobile numbers. - When login fails with `MobileVerificationNeeded` and frontend initiates verification. ### Mobile Verification Flow 1. **Frontend calls `/verification-services/mobile-verification/start`** with the user's email address (used to locate the user). - Mindbricks checks if the mobile number is already verified. - A secret code is generated and stored in the cache linked to the user. - The code is sent to the user's mobile via SMS or returned in the response (only in development environments for easier testing). 2. **User receives the code and enters it into the frontend application.** 3. **Frontend calls `/verification-services/mobile-verification/complete`** with the `email` and the received `secretCode`. - Mindbricks checks that the code is valid, not expired, and matches. - If valid, the user’s `mobileVerified` flag is set to `true`, and a success response is returned. --- ## API Endpoints ### POST `/verification-services/mobile-verification/start` **Purpose**: Starts the mobile verification process by generating and sending a secret verification code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-------------------------------------| | email | String | Yes | The email address associated with the mobile number to verify | ```json { "email": "user@example.com" } ``` **Success Response** Secret code details (in development environment). Confirms that the verification step has been started. ```json { "userId": "user-uuid", "mobile": "+15551234567", "secretCode": "123456", "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z" } ``` ⚠️ In production, the secret code is only sent via SMS, not exposed in the API response. **Error Responses** - 400 Bad Request: Mobile already verified. - 403 Forbidden: Sending a code too frequently (anti-spam). --- ### POST `/verification-services/mobile-verification/complete` **Purpose**: Completes the mobile verification by validating the secret code. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|------------------------------------| | email | String | Yes | The user's email being verified | | secretCode | String | Yes | The secret code received via SMS | ```json { "email": "user@example.com", "secretCode": "123456" } ``` **Success Response** Returns confirmation that the mobile number has been verified. ```json { "userId": "user-uuid", "mobile": "+15551234567", "isVerified": true } ``` **Error Responses** 403 Forbidden: - Secret code mismatch - Secret code expired - No ongoing verification found --- ## Important Behavioral Notes **Resend Throttling**: You can only request a new verification code after a cooldown period (`resendTimeWindow`, e.g., 60 seconds). **Expiration Handling**: Verification codes expire after a configured period (`expireTimeWindow`, e.g., 1 day). **One Code Per Session**: Only one active verification session per user is allowed at a time. 💡 Mindbricks automatically manages spam prevention, session caching, expiration, and event broadcasting (start/complete events) for all verification steps. ## Verification Services — Email 2FA Verification Email 2FA (Two-Factor Authentication) provides an additional layer of security by requiring users to confirm their identity using a secret code sent to their email address. This process is used in login flows or sensitive actions that need extra verification. All verification services, including 2FA, are located under the `/verification-services` base path. ### When is Email 2FA Triggered? - During login flows where `sessionNeedsEmail2FA` is `true` - When the backend enforces two-factor authentication for a sensitive operation ### Email 2FA Flow 1. **Frontend calls `/verification-services/email-2factor-verification/start`** with the user's id, session id, client info, and reason. - Mindbricks identifies the user and checks if a cooldown period applies. - A new secret code is generated and stored, linked to the current session ID. - The code is sent via email or returned in development environments. 2. **User receives the code and enters it into the frontend application.** 3. **Frontend calls `/verification-services/email-2factor-verification/complete`** with the `userId`, `sessionId`, and the `secretCode`. - Mindbricks verifies the code, validates the session, and updates the session to remove the 2FA requirement. --- ## API Endpoints ### POST `/verification-services/email-2factor-verification/start` **Purpose**: Starts the email-based 2FA process by generating and sending a verification code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-----------------------------------------------| | userId | String | Yes | The user’s ID | | sessionId | String | Yes | The current session ID | | client | String | No | Optional client tag or context | | reason | String | No | Optional reason for triggering 2FA | ```json { "userId": "user-uuid", "sessionId": "session-uuid", "client": "login-page", "reason": "Login requires email 2FA" } ``` #### Success Response ```json { "sessionId": "session-uuid", "userId": "user-uuid", "email": "user@example.com", "secretCode": "123456", "expireTime": 300, "date": "2024-04-29T10:00:00.000Z" } ``` ⚠️ In production, the `secretCode` is only sent via email, not exposed in the API response. #### Error Responses - **403 Forbidden**: Sending a code too frequently (anti-spam) - **401 Unauthorized**: User session not found --- ### POST `/verification-services/email-2factor-verification/complete` **Purpose**: Completes the email 2FA process by validating the secret code and session. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|--------------------------------------------------| | userId | String | Yes | The user’s ID | | sessionId | String | Yes | The session ID the code is tied to | | secretCode | String | Yes | The secret code received via email | ```json { "userId": "user-uuid", "sessionId": "session-uuid", "secretCode": "123456" } ``` #### Success Response Returns an updated session with 2FA disabled: ```json { "sessionId": "session-uuid", "userId": "user-uuid", "sessionNeedsEmail2FA": false, ... } ``` #### Error Responses - **403 Forbidden**: - Secret code mismatch - Secret code expired - Verification step not found --- ### Important Behavioral Notes - **One Code Per Session**: Only one active code can be issued per session. - **Resend Throttling**: Code requests are throttled based on `resendTimeWindow` (e.g., 60 seconds). - **Expiration**: Codes expire after `expireTimeWindow` (e.g., 5 minutes). - 💡 Mindbricks manages session cache, spam control, expiration tracking, and event notifications for all 2FA steps. ## Verification Services — Mobile 2FA Verification Mobile 2FA (Two-Factor Authentication) is a security mechanism that adds an extra layer of authentication using a user's verified mobile number. All verification services, including mobile 2FA, are accessible under the `/verification-services` base path. ### When is Mobile 2FA Triggered? - During login or critical actions requiring step-up authentication. - When the session has a flag `sessionNeedsMobile2FA = true`. - When login or session verification fails with `MobileVerificationNeeded`, indicating 2FA is required. ### Mobile 2FA Verification Flow 1. **Frontend calls `/verification-services/mobile-2factor-verification/start`** with the user's id, session id, client info, and reason. - Mindbricks finds the user by id. - Verifies that the user has a verified mobile number. - A secret code is generated and cached against the session. - The code is sent to the user's verified mobile number or returned in the response (only in development environments). 2. **User receives the code and enters it in the frontend app.** 3. **Frontend calls `/verification-services/mobile-2factor-verification/complete`** with the `userId`, `sessionId`, and `secretCode`. - Mindbricks validates the code for expiration and correctness. - If valid, the session flag `sessionNeedsMobile2FA` is cleared. - A refreshed session object is returned. --- ## API Endpoints ### POST `/verification-services/mobile-2factor-verification/start` **Purpose**: Initiates mobile-based 2FA by generating and sending a secret code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-----------------------------------------------| | userId | String | Yes | The user’s ID | | sessionId | String | Yes | The current session ID | | client | String | No | Optional client tag or context | | reason | String | No | Optional reason for triggering 2FA | ```json { "userId": "user-uuid", "sessionId": "session-uuid", "client": "login-page", "reason": "Login requires mobile 2FA" } ``` **Success Response** Returns the generated code (only in development), expiration info, and metadata. ```json { "userId": "user-uuid", "sessionId": "session-uuid", "mobile": "+15551234567", "secretCode": "654321", "expireTime": 300, "date": "2024-04-29T11:00:00.000Z" } ``` ⚠️ In production environments, the secret code is not included in the response and is instead delivered via SMS. **Error Responses** - 403 Forbidden: Mobile number not verified. - 403 Forbidden: Code resend attempted before cooldown period (`resendTimeWindow`). - 401 Unauthorized: Email not recognized or session invalid. --- ### POST `/verification-services/mobile-2factor-verification/complete` **Purpose**: Completes mobile 2FA verification by validating the secret code and updating the session. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|-------------------------------------| | userId | String | Yes | ID of the user | | sessionId | String | Yes | ID of the session | | secretCode | String | Yes | The 6-digit code received via SMS | ```json { "userId": "user-uuid", "sessionId": "session-uuid", "secretCode": "654321" } ``` **Success Response** Returns the updated session with `sessionNeedsMobile2FA: false`. ```json { "sessionId": "session-uuid", "userId": "user-uuid", "sessionNeedsMobile2FA": false, "accessToken": "jwt-token", "expiresIn": 86400 } ``` **Error Responses** - 403 Forbidden: Code mismatch or expired. - 403 Forbidden: No ongoing verification found. - 401 Unauthorized: Session does not exist or is invalid. --- ### Behavioral Notes - **Rate Limiting**: A user can only request a new mobile 2FA code after the cooldown period (`resendTimeWindow`, e.g., 60 seconds). - **Expiration**: Mobile 2FA codes expire after the configured time (`expireTimeWindow`, e.g., 5 minutes). - **Session Integrity**: Verification status is tied to the session; incorrect sessionId will invalidate the attempt. 💡 Mindbricks handles session integrity, rate limiting, and secure code delivery to ensure a robust mobile 2FA process. ## Verification Services — Password Reset by Email Password Reset by Email enables a user to securely reset their password using a secret code sent to their registered email address. All verification services, including password reset by email, are located under the `/verification-services` base path. ### When is Password Reset by Email Triggered? - When a user requests to reset their password by providing their email address. - This service is typically exposed on a “Forgot Password?” flow in the frontend. ### Password Reset Flow 1. **Frontend calls `/verification-services/password-reset-by-email/start`** with the user's email. - Mindbricks checks if the user exists and if the email is registered. - A secret code is generated and stored in the cache linked to the user. - The code is sent to the user's email, or returned in the response (in development environments only for testing). 2. **User receives the code and enters it into the frontend along with the new password.** 3. **Frontend calls `/verification-services/password-reset-by-email/complete`** with the `email`, the `secretCode`, and the new `password`. - Mindbricks checks that the code is valid, not expired, and matches. - If valid, the user’s password is reset, their `emailVerified` flag is set to `true`, and a success response is returned. --- ## API Endpoints ### POST `/verification-services/password-reset-by-email/start` **Purpose**: Starts the password reset process by generating and sending a secret verification code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-------------------------------------| | email | String | Yes | The email address of the user | ```json { "email": "user@example.com" } ``` **Success Response** Returns secret code details (only in development environment) and confirmation that the verification step has been started. ```json { "userId": "user-uuid", "email": "user@example.com", "secretCode": "123456", "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z" } ``` ⚠️ In production, the secret code is only sent via email and not exposed in the API response. **Error Responses** - `401 NotAuthenticated`: Email address not found or not associated with a user. - `403 Forbidden`: Sending a code too frequently (spam prevention). --- ### POST `/verification-services/password-reset-by-email/complete` **Purpose**: Completes the password reset process by validating the secret code and updating the user's password. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|----------------------------------------------| | email | String | Yes | The email address of the user | | secretCode | String | Yes | The code received via email | | password | String | Yes | The new password the user wants to set | ```json { "email": "user@example.com", "secretCode": "123456", "password": "newSecurePassword123" } ``` **Success Response** ```json { "userId": "user-uuid", "email": "user@example.com", "isVerified": true } ``` **Error Responses** - `403 Forbidden`: - Secret code mismatch - Secret code expired - No ongoing verification found --- ## Important Behavioral Notes ### Resend Throttling: A new verification code can only be requested after a cooldown period (configured via `resendTimeWindow`, e.g., 60 seconds). ### Expiration Handling: Verification codes automatically expire after a predefined period (`expireTimeWindow`, e.g., 1 day). ### Session & Event Handling: Mindbricks manages: - Spam prevention - Code caching per user - Expiration logic - Verification start/complete events ## Verification Services — Password Reset by Mobile Password reset by mobile provides users with a secure mechanism to reset their password using a verification code sent via SMS to their registered mobile number. All verification services, including password reset by mobile, are located under the `/verification-services` base path. ### When is Password Reset by Mobile Triggered? - When a user forgets their password and selects the mobile reset option. - When a user explicitly initiates password recovery via mobile on the login or help screen. ### Password Reset by Mobile Flow 1. **Frontend calls `/verification-services/password-reset-by-mobile/start`** with the user's mobile number or associated identifier. - Mindbricks checks if a user with the given mobile exists. - A secret code is generated and stored in the cache for that user. - The code is sent to the user's mobile (or returned in development environments for testing). 2. **User receives the code via SMS and enters it into the frontend app.** 3. **Frontend calls `/verification-services/password-reset-by-mobile/complete`** with the user's `email`, the `secretCode`, and the new `password`. - Mindbricks validates the secret code and its expiration. - If valid, it updates the user's password and returns a success response. --- ## API Endpoints ### POST `/verification-services/password-reset-by-mobile/start` **Purpose**: Initiates the mobile-based password reset by sending a verification code to the user's mobile. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|------------------------------| | mobile | String | Yes | The mobile number to verify | ```json { "mobile": "+905551234567" } ``` ### Success Response Returns the verification context (code returned only in development): ```json { "userId": "user-uuid", "mobile": "+905551234567", "secretCode": "123456", "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z" } ``` ⚠️ In production, the `secretCode` is not included in the response and is only sent via SMS. ### Error Responses - **400 Bad Request**: Mobile already verified - **403 Forbidden**: Rate-limited (code already sent recently) - **404 Not Found**: User with provided mobile not found --- ### POST `/verification-services/password-reset-by-mobile/complete` **Purpose**: Finalizes the password reset process by validating the received verification code and updating the user’s password. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|-------------------------------------------------| | email | String | Yes | The email address of the user | | secretCode | String | Yes | The code received via SMS | | password | String | Yes | The new password to assign | ```json { "email": "user@example.com", "secretCode": "123456", "password": "NewSecurePassword123!" } ``` ### Success Response ```json { "userId": "user-uuid", "mobile": "+905551234567", "isVerified": true } ``` --- ### Important Behavioral Notes - **Throttling**: Codes can only be resent after a delay defined by `resendTimeWindow` (e.g., 60 seconds). - **Expiration**: Codes expire after the `expireTimeWindow` (e.g., 1 day). - **One Active Session**: Only one active password reset session is allowed per user at a time. - **Session-less**: This flow does not require an active session — it works for unauthenticated users. 💡 Mindbricks handles spam protection, session caching, and event-based logging (for both start and complete operations) as part of the verification service base class. ## Verification Method Types ### 🧾 For byCode Verifications This verification type requires the user to manually enter a 6-digit code. **Frontend Action**: Display a secure input page where the user can enter the code they received via email or SMS. After collecting the code and any required metadata (such as `userId` or `sessionId`), make a `POST` request to the corresponding `/complete` endpoint. --- ### 🔗 For byLink Verifications This verification type uses a clickable link embedded in an email (or SMS message). **Frontend Action**: The link points to a `GET` page in your frontend that parses `userId` and `code` from the query string and sends them to the backend via a `POST` request to the corresponding `/complete` endpoint. This enables one-click verification without requiring the user to type in a code. ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **Athentication documentation** -Version:**`1.0.5`** ## Scope This document provides a structured architectural overview of the `authentication` module of the project.The `authentication` module of the project is used to generate authentication and authorization specific code for all services but a more specific purpose of the module is also to store all required configuration to generate an automatic user service for the project which is named 'linkedin-auth-service'. So in this document you will find - The detailed configuration of the authetication module. - The effect of the authetication configuration on the auth (user) service and the detailed structures of the auto-generated user service. - The effect of the authetication configuration on the resource services and the detailed authentication and authorization structures of a resource server. This document has been automatically generated based on the authetication module definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ## Authentication Essentials Mindbricks provides a comprehensive authentication module that serves as the foundation for user management and security across all services. This module is designed to be flexible, allowing for the generation of authentication and authorization code tailored to project's specific needs. Mindbricks supports multiple authentication strategies, for the first validation of the user, the auth service supports the following authentication strategies: - **Password-based authentication**: Users can log in using a username and password. - **Social login**: Users can authenticate using third-party providers like Google, Facebook, or GitHub. - **Single Sign-On (SSO)**: Users can log in using an SSO provider, allowing for seamless access across multiple applications. - **API Key**: Services can authenticate using API keys for secure communication. Once the user is validated through one of the above strategies, the user is granted a JWT token that can be used to access the protected resources of the service. JWT tokens are generated by the auth service and can be used to access protected resources of the service. The JWT token is open and contains the user's identity and any additional claims required for authorization. The token is signed using a private RSA key, ensuring its integrity and authenticity. Once the JWT token is generated, it can be used to access protected resources of the service. The JWT token is structured as follows: ```json { "keyId": "716a8738ec3d499f84d58bda6ee772ce", "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "sub": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", loginDate: "2023-10-01T12:00:00Z" } ``` Key id for a token represents the private-public key pair used to sign the token. To validate the signature of the token, the public key is used. Any service which will use the JWT token can request a publick ket from the auth service using the following endpoint: ```http GET /publickey?keyId=[keyIdInToken] ``` Mindbricks generated services manages the key rotation automatically, so the public key is always up to date and valid for the JWT tokens generated by the auth service. If you add any manual service to the project which should validate the JWT token, you can use the public key endpoint to get the public key and validate the JWT token signature. The JWT token life cycle is configured in the authentication module of the project. This project uses the following configuration for the JWT token: The token is valid for days after it is issued. And the private key used to sign the token is rotated every days. Note that when a new key is generated to sign the JWT tokens, the old key is still valid for the period of days. So it is recommended to cache the old public keys for the period of days to validate the JWT tokens issued with the old keys. ## The Login Definition The login definition is a crucial part of the authentication module, as it defines how user and tenant model is defined. In this section it is specified how users, user groups, and tenants are defined in the project's data model. These definitions allow Mindbricks to dynamically extract identity and authorization data from project-specific data objects. ### User Settings **Super Admin User Email**: `admin@admin.com`** The login email of the super admin user. This user has full permissions across the project and is not tenant-scoped. If not defined, the project owner's email is used. This email must be unique and valid to support email-based features like verification and password reset. Super admin user is created automatically when the project is initialized with a roleId of `superAdmin` and a userId of `f7103b85-fcda-4dec-92c6-c336f71fd3a2`. **Super Admin User Password**: Super admin user password is defined in this module as well, but masked in this document. To edit it you can use the **User Settings** section of **Login Definition** chapter of the Mindbricks **Authentication Module**. **Username Type**: The type of the username which is stored in the database and written to the session object for information purposes.: -`asFullName`: The username is stored in one property, `fullname`, and represents the full name of the user, which is a combination of first name and last name. -`asNamePair`: The username is stored in two properties, `name` and `surname`, which are combined to form the full name of the user. This project uses the `asFullName` type, so the user name is stored in one property, `fullname`, and represents the full name of the user, which is a combination of first name and last name. **User Groups**: The project does not support user groups, so the auth service will not create any user group related data objects. **Public User Registration**: The project allows public user registration, meaning that users can register themselves without the need for an admin to create an account for them. This is useful for projects that require user self-registration, such as social networks, forums, or any application where users need to create their own accounts. The user registration process is handled by the auth service, which will create a new user data object in the database. The user registration process will create a new user with the `userId` and `roleId` set to `user`, and the user will be able to log in using the username and password they provided during registration. The reigstered user's roleId will be updated later to any other roleId by the super admin or admin users. If any social login is enabled for the project, the user can also sign up using the social login providers. Note that when users register themselves using socila logi, first all the data that can be provided by the social login provider will written to Redis cache with a key called socialCode, and this code will be returned to the api consumer, which can be used to complete the registration process. **Email Verification Required For Login**: The project requires email verification for user login, meaning that users must verify their email address before they can log in. This is useful for projects that require email verification to ensure that users have provided a valid email address, such as social networks, forums, or any application where email verification is required. The email verification process is handled by the auth service, which will send a verification email to the user's email address after they register or change their email address. You can check the email verification details in the REST API documentation of the auth service. **Email 2FA Is Not Required For Login**: The project does not require email-based two-factor authentication (2FA) for user login, meaning that users can log in using only their username and password without providing a second factor of authentication. This is useful for projects that do not require an additional layer of security for user login, such as enterprise applications, internal tools, or any application where email-based 2FA is not required. While the email 2FA is not required, the auth service will still support email 2FA if it is configured in the verification services. You can prefer email 2FA at any time before any action or make it optional which means that users can provide a second factor of authentication if they want to, but it is not required for login. You can check the email 2FA details in the REST API documentation of the auth service. **User Mobile Is Not Active**: The authetication module is not configured to support mobile numbers for users. **User Auto Avatar Script**: Mindbricks stores an avatar property inthe user data model automatically. This project supports also automatic avatar generation for users with the following script configuretion. The auth service will generate an avatar for each user when it is not specified in the registration process. The script is defined in the authentication module and can be edited in the **User Settings** section of **Login Definition** chapter of the Mindbricks **Authentication Module**. The script is executed when a new user is created, and it generates an avatar based on user properties. ```js `https://gravatar.com/avatar/${LIB.common.md5(this.email ?? 'nullValue')}?s=200&d=identicon` ``` ### Tenant Settings This project is not configured to support multi-tenancy, meaning that users and other data are not scoped to a specific tenant. This allows for a single-tenant data management, where all users and other data are shared across the project. ## Verification Services The project supports various verification services that enhance security and user experience. These services are designed to verify user identity through different channels, such as email and mobile, and can be configured to suit the project's needs. Please check the auth service API documentation for more details on how to use these services through the REST API. A verification service is configured with the following settings: -`verificationType`: The type of verification handling, which can be one of the following: -- `byCode`: The verification is handled by entering a code in the frontend. -- `byLink`: The verification is handled by clicking a link in the frontend, which will automatically verify the user through the auth service. -`resendTimeWindow`: The time window in seconds during which the user can request a new verification code or link. -`expireTimeWindow`: The time window in seconds after which the verification code or link will expire and become invalid. ### Password Reset By Email The project supports password reset by email, allowing users to reset their passwords securely through a verification code sent to their registered email address. This service is useful for projects that require users to reset their passwords securely, such as social networks, forums, or any application where password reset is required. The password reset by email process is handled by the auth service, which will send a verification code to the user's email address after they request a password reset. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 86400 } ``` ### Password Reset By Mobile The project supports password reset by mobile, allowing users to reset their passwords securely through a verification code sent to their registered mobile number. This service is useful for projects that require users to reset their passwords securely, such as social networks, forums, or any application where password reset is required. The password reset by mobile process is handled by the auth service, which will send a verification code to the user's mobile number after they request a password reset. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 300 } ``` ### Email Verification The project supports email verification, allowing users to verify their email addresses securely through a verification code sent to their registered email address. This service is useful for projects that require users to verify their email addresses securely, such as social networks, forums, or any application where email verification is required. The email verification process is handled by the auth service, which will send a verification code to the user's email address after they register or change their email address. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 86400 } ``` ### Mobile Verification The project supports mobile verification, allowing users to verify their mobile numbers securely through a verification code sent to their registered mobile number. This service is useful for projects that require users to verify their mobile numbers securely, such as social networks, forums, or any application where mobile verification is required. The mobile verification process is handled by the auth service, which will send a verification code to the user's mobile number after they register or change their mobile number. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 300 } ``` ### Email 2FA The project supports email-based two-factor authentication (2FA), allowing users to enhance their login security by providing a second factor of authentication, such as a verification code sent to their registered email address. This service is useful for projects that require an additional layer of security for user login, such as social networks, forums, or any application where email-based 2FA is required. The email 2FA process is handled by the auth service, which will send a verification code to the user's email address after they log in. The user must provide the verification code to complete the login process. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 86400 } ``` ### Mobile 2FA The project supports mobile-based two-factor authentication (2FA), allowing users to enhance their login security by providing a second factor of authentication, such as a verification code sent to their registered mobile number. This service is useful for projects that require an additional layer of security for user login, such as social networks, forums, or any application where mobile-based 2FA is required. The mobile 2FA process is handled by the auth service, which will send a verification code to the user's mobile number after they log in. The user must provide the verification code to complete the login process. ```json { verificationType: "byCode", resendTimeWindow: 60, expireTimeWindow: 300 } ``` ## Access Control (Not Configured) The project does not support any access control mechanisms, meaning that users can access all resources without any restrictions. If you want to add access control mechanisms, you can do so in the **Access Control** chapter of Mindbricks **Authentication Module**. ## Social Logins (Not Configured) The project does not support any social logins, meaning that users cannot log in using their social media accounts. If you want to add social logins, you can do so in the **Social Logins** chapter of Mindbricks **Authentication Module**. ## User Properties (Not Configured) The project does not support any user properties, meaning that users can only have the default properties defined in the user data object. If you want to add user properties, you can do so in the **User Properties** chapter of Mindbricks **Authentication Module**. To see a detailed configuration of the user properties, please check the **User Data Object** docmentation below. ## Auth Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-auth-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `user` | A data object that stores the user information and handles login settings. | accessPrivate | ## user Data Object ### Object Overview **Description:** A data object that stores the user information and handles login settings. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Redis Entity Caching This data object is configured for Redis entity caching, which improves data retrieval performance by storing frequently accessed data in Redis. Each time a new instance is created, updated or deleted, the cache is updated accordingly. Any get requests by id will first check the cache before querying the database. If you want to use the cache by other select criteria, you can configure any data property as a Redis cluster. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `email` | String | Yes | A string value to represent the user's email. | | `password` | String | Yes | A string value to represent the user's password. It will be stored as hashed. | | `fullname` | String | Yes | A string value to represent the fullname of the user | | `avatar` | String | No | The avatar url of the user. A random avatar will be generated if not provided | | `roleId` | String | Yes | A string value to represent the roleId of the user. | | `emailVerified` | Boolean | Yes | A boolean value to represent the email verification status of the user. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **email**: 'default' - **password**: 'default' - **fullname**: 'default' - **roleId**: user ### Always Create with Default Values Some of the default values are set to be always used when creating a new object, even if the property value is provided in the request body. It ensures that the property is always initialized with a default value when the object is created. - **roleId**: Will be created with value `user` - **emailVerified**: Will be created with value `false` ### Constant Properties `email` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `fullname` `avatar` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Hashed Properties `password` Hashed properties are stored in the database as a hash value, providing an additional layer of security for sensitive data. ### Elastic Search Indexing `email` `fullname` `roleId` `emailVerified` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `email` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `email` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Cache Select Properties `email` Cache select properties are used to collect data from Redis entity cache with a different key than the data object id. This allows you to cache data that is not directly related to the data object id, but a frequently used filter. ### Secondary Key Properties `email` Secondary key properties are used to create an additional indexed identifiers for the data object, allowing for alternative access patterns. Different than normal indexed properties, secondary keys will act as primary keys and Mindbricks will provide automatic secondary key db utility functions to access the data object by the secondary key. ### Filter Properties `email` `password` `fullname` `avatar` `roleId` `emailVerified` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **email**: String has a filter named `email` - **password**: String has a filter named `password` - **fullname**: String has a filter named `fullname` - **avatar**: String has a filter named `avatar` - **roleId**: String has a filter named `roleId` - **emailVerified**: Boolean has a filter named `emailVerified` # EVENT API GUIDE ## BFF SERVICE The BFF service is a microservice that acts as a bridge between the client and backend services. It provides a unified API for the client to interact with multiple backend services, simplifying the communication process and improving performance. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to. For inquiries, feedback, or further information regarding the architecture, please direct your communication to: **Email**: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the BFF Service Event Listeners. This guide details the Kafka-based event listeners responsible for reacting to ElasticSearch index events. It describes listener responsibilities, the topics they subscribe to, and expected payloads. **Intended Audience** This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the BFF Service. It assumes familiarity with microservices architecture, the Kafka messaging system, and ElasticSearch. **Overview** Each ElasticSearch index operation (create, update, delete) emits a corresponding event to Kafka. These events are consumed by listeners responsible for executing aggregate functions to ensure index- and system-level consistency. ## Kafka Event Listeners # REST API GUIDE ## BFF SERVICE BFF service is a microservice that acts as a bridge between the client and the backend services. It provides a unified API for the client to interact with multiple backend services, simplifying the communication process and improving performance. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to. For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the BFF Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our BFF Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the BFF Service via HTTP requests for purposes such as listing, filtering, and searching data. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. **Beyond REST** It's important to note that the BFF Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. --- ## Resources ### Elastic Index Resource _Resource Definition_: A virtual resource representing dynamic search data from a specified index. --- ## Route: List Records _Route Definition_: Returns a paginated list from the elastic index. _Route Type_: list _Default access route_: _POST_ `/:indexName/list` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-----------------| | indexName | String | Yes | path.param | | page | Number | No | query.page | | limit | Number | No | query.limit | | sortBy | String | No | query.sortBy | | sortOrder | String | No | query.sortOrder | | q | String | No | query.q | | filters | Object | Yes | body | ```js axios({ method: "POST", url: `/${indexName}/list`, data: { filters: "Object" }, params: { page: "Number", limit: "Number", sortBy: "String", sortOrder: "String", q: "String" } }); ```

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property.

--- _Default access route_: _GET_ `/:indexName/list` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-----------------| | indexName | String | Yes | path.param | | page | Number | No | query.page | | limit | Number | No | query.limit | | sortBy | String | No | query.sortBy | | sortOrder | String | No | query.sortOrder | | q | String | No | query.q | ```js axios({ method: "GET", url: `/${indexName}/list`, data:{}, params: { page: "Number", limit: "Number", sortBy: "String", sortOrder: "String", q: "String" } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ## Route: Count Records _Route Definition_: Counts matching documents in the elastic index. _Route Type_: count _Default access route_: _POST_ `/:indexName/count` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | q | String | No | query.q | | filters | Object | Yes | body | ```js axios({ method: "POST", url: `/${indexName}/count`, data: { filters: "Object" }, params: { q: "String" } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. --- _Default access route_: _GET_ `/:indexName/count` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | q | String | No | query.q | ```js axios({ method: "GET", url: `/${indexName}/count`, data:{}, params: { q: "String" } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ## Route: Get Index Schema _Route Definition_: Returns the schema for the elastic index. _Route Type_: get _Default access route_: _GET_ `/:indexName/schema` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | ```js axios({ method: "GET", url: `/${indexName}/schema`, data:{}, params: {} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ## Route: Filters ### GET /:indexName/filters _Route Type_: get ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | page | Number | No | query.page | | limit | Number | No | query.limit | ```js axios({ method: "GET", url: `/${indexName}/filters`, data:{}, params: { page: "Number", limit: "Number" } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ### POST /:indexName/filters _Route Type_: create ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | filters | Object | Yes | body | ```js axios({ method: "POST", url: `/${indexName}/filters`, data: { filterName: "String", conditions: "Object" }, params: {} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ### DELETE /:indexName/filters/:filterId _Route Type_: delete ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | filterId | String | Yes | path.param | ```js axios({ method: "DELETE", url: `/${indexName}/filters/${filterId}`, data:{}, params: {} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. ## Route: Get One Record _Route Type_: get _Default access route_: _GET_ `/:indexName/:id` ### Parameters | Parameter | Type | Required | Population | |-------------|--------|----------|-------------| | indexName | String | Yes | path.param | | id | ID | Yes | path.param | ```js axios({ method: "GET", url: `/${indexName}/${id}`, data:{}, params: {} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. --- # Service Design Specification **BFF Service Documentation** **Version:** `1.0` --- ## Scope This document provides a comprehensive architectural overview of the **BFF Service**, a Backend-for-Frontend layer designed to unify access to backend ElasticSearch indices and event-driven aggregation logic. The service offers a full REST API suite and listens to Kafka topics to synchronize enriched views. This document is intended for: * **Architects** ensuring integration patterns and event consistency. * **Developers** building on top of or consuming the BFF service. * **DevOps Engineers** responsible for deployment and environment setup. > For endpoint-level specifications, refer to the REST API Guide. > For listener-level behavior, refer to the Event API Guide. --- ## Service Settings * **Port**: Configurable via `HTTP_PORT`, default: `3000` * **ElasticSearch**: Primary storage and query engine * **Kafka Broker**: `KAFKA_BROKER` for aggregation sync * **Mindbricks Injected Interface**: Configured with `api-face` * **Dynamic REST Routes**: Powered via codegen with `/` structure --- ## API Routes Overview The BFF service exposes a dynamic REST API interface that provides full access to ElasticSearch indices. These include list, count, filter, and schema-based interactions for both stored and virtual views. For full documentation of REST routes, including supported methods and examples, refer to the **REST API Guide**. --- ## Kafka Event Listeners The BFF service listens to ElasticSearch-related Kafka topics to maintain enriched and denormalized indices. These listeners trigger view aggregation functions upon receiving `create`, `update`, or `delete` events for primary and related entities. For detailed behavior, payloads, and listener-to-function mappings, refer to the **Event Guide**. --- ## Aggregation Strategy Each view is either: * **Stored View**: materialized into a separate ElasticSearch index * **Virtual View**: dynamically aggregated on request For each stored view: * `viewNameAggregateData(id)` handles source rehydration * Aggregates are executed via `aggregateNameAggregateDataFromIndex()` * Lookups via `lookupNameLookupDataFromIndex()` * Stats via `statNameStatDataFromIndex()` Final document is saved to: `_` --- ## Middleware ### Error Handling * `ApiError` extends native error * `errorConverter` ensures consistent error format * `errorHandler` outputs error JSON with stack trace in development ### Request Validation * `validate()` uses Joi + custom schema per route * Filters and pagination are schema-validated * Filter operators supported: `eq`, `noteq`, `range`, `wildcard`, `match`, etc. ### Async Wrapper * `catchAsync(fn)` auto-handles exceptions in async route handlers --- ## Elasticsearch Utilities * **Index Management**: create, check, delete * **Document Operations**: get, create, update, delete * **Query Builders**: * `queryBuilder()` for filters * `searchBuilder()` for full-text queries * `aggBuilder()` for terms aggregations * **Multi-index search support** with `multiSearchBuilder()` * **Dynamic Schema Extraction** via `fieldBuilder()` --- ## Cron Repair Logic Runs periodically to ensure data integrity: * `runAllRepair()` triggers each `viewNameRepair()` * For each view: * Reads base index with `match_all` * Re-runs aggregation pipeline * Indexes final result into enriched view index --- ## Environment Variables | Variable | Description | | -------------------- | ---------------------------------- | | `HTTP_PORT` | Service port | | `KAFKA_BROKER` | Kafka broker host | | `ELASTIC_URL` | Elasticsearch base URL | | `CORS_ORIGIN` | Allowed frontend origin (optional) | | `NODE_ENV` | Environment (dev, prod) | | `SERVICE_URL` | Used for injected API face config | | `SERVICE_SHORT_NAME` | Used in injected auth URL | --- ## App Lifecycle 1. Loads env: `.env`, `.prod.env`, etc. 2. Bootstraps Express app with: * CORS setup * JSON + cookie parsers * Dynamic routes * Swagger and API Face 3. Starts: * Kafka listeners * Cron repair jobs * Full enrichment pipelines 4. Handles SIGINT to close server cleanly --- ## Testing Strategy ### Unit Tests * Aggregation methods per view * Joi schemas * Custom middleware (errors, async, pick) ### Integration Tests * REST APIs (mock Elastic) * Kafka event triggers → view enrichment ### Load Tests (Optional) * GET `/index/list` with filters * Event storm on Kafka topics * Cron job load verification --- # EVENT GUIDE ## linkedin-company-service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Company` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Company` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Company` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Company` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Company` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent companyFollower-created **Event topic**: `linkedin-company-service-dbevent-companyfollower-created` This event is triggered upon the creation of a `companyFollower` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent companyFollower-updated **Event topic**: `linkedin-company-service-dbevent-companyfollower-updated` Activation of this event follows the update of a `companyFollower` data object. The payload contains the updated information under the `companyFollower` attribute, along with the original data prior to update, labeled as `old_companyFollower` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_companyFollower:{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, companyFollower:{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent companyFollower-deleted **Event topic**: `linkedin-company-service-dbevent-companyfollower-deleted` This event announces the deletion of a `companyFollower` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent companyUpdate-created **Event topic**: `linkedin-company-service-dbevent-companyupdate-created` This event is triggered upon the creation of a `companyUpdate` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent companyUpdate-updated **Event topic**: `linkedin-company-service-dbevent-companyupdate-updated` Activation of this event follows the update of a `companyUpdate` data object. The payload contains the updated information under the `companyUpdate` attribute, along with the original data prior to update, labeled as `old_companyUpdate` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_companyUpdate:{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, companyUpdate:{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent companyUpdate-deleted **Event topic**: `linkedin-company-service-dbevent-companyupdate-deleted` This event announces the deletion of a `companyUpdate` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent company-created **Event topic**: `linkedin-company-service-dbevent-company-created` This event is triggered upon the creation of a `company` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent company-updated **Event topic**: `linkedin-company-service-dbevent-company-updated` Activation of this event follows the update of a `company` data object. The payload contains the updated information under the `company` attribute, along with the original data prior to update, labeled as `old_company` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_company:{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, company:{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent company-deleted **Event topic**: `linkedin-company-service-dbevent-company-deleted` This event announces the deletion of a `company` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent companyAdmin-created **Event topic**: `linkedin-company-service-dbevent-companyadmin-created` This event is triggered upon the creation of a `companyAdmin` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent companyAdmin-updated **Event topic**: `linkedin-company-service-dbevent-companyadmin-updated` Activation of this event follows the update of a `companyAdmin` data object. The payload contains the updated information under the `companyAdmin` attribute, along with the original data prior to update, labeled as `old_companyAdmin` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_companyAdmin:{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, companyAdmin:{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent companyAdmin-deleted **Event topic**: `linkedin-company-service-dbevent-companyadmin-deleted` This event announces the deletion of a `companyAdmin` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Company` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event companyfollower-created **Event topic**: `elastic-index-linkedin_companyfollower-created` **Event payload**: ```json {"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyfollower-updated **Event topic**: `elastic-index-linkedin_companyfollower-created` **Event payload**: ```json {"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyfollower-deleted **Event topic**: `elastic-index-linkedin_companyfollower-deleted` **Event payload**: ```json {"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyfollower-extended **Event topic**: `elastic-index-linkedin_companyfollower-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event companyadmin-retrived **Event topic** : `linkedin-company-service-companyadmin-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-followed **Event topic** : `linkedin-company-service-company-followed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-removed **Event topic** : `linkedin-company-service-companyadmin-removed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-created **Event topic** : `linkedin-company-service-company-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"POST","action":"create","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-retrived **Event topic** : `linkedin-company-service-company-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"GET","action":"get","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companies-listed **Event topic** : `linkedin-company-service-companies-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companies` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companies`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companies","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companies":[{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event company-updated **Event topic** : `linkedin-company-service-company-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-deleted **Event topic** : `linkedin-company-service-company-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-assigned **Event topic** : `linkedin-company-service-companyadmin-assigned` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmins-listed **Event topic** : `linkedin-company-service-companyadmins-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmins` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmins`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmins","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyAdmins":[{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-retrived **Event topic** : `linkedin-company-service-companyupdate-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-unfollowed **Event topic** : `linkedin-company-service-company-unfollowed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollowers-listed **Event topic** : `linkedin-company-service-companyfollowers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollowers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollowers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollowers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyFollowers":[{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-created **Event topic** : `linkedin-company-service-companyupdate-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-updated **Event topic** : `linkedin-company-service-companyupdate-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollower-retrived **Event topic** : `linkedin-company-service-companyfollower-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-deleted **Event topic** : `linkedin-company-service-companyupdate-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdates-listed **Event topic** : `linkedin-company-service-companyupdates-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdates` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdates`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdates","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyUpdates":[{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event companyupdate-created **Event topic**: `elastic-index-linkedin_companyupdate-created` **Event payload**: ```json {"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyupdate-updated **Event topic**: `elastic-index-linkedin_companyupdate-created` **Event payload**: ```json {"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyupdate-deleted **Event topic**: `elastic-index-linkedin_companyupdate-deleted` **Event payload**: ```json {"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyupdate-extended **Event topic**: `elastic-index-linkedin_companyupdate-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event companyadmin-retrived **Event topic** : `linkedin-company-service-companyadmin-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-followed **Event topic** : `linkedin-company-service-company-followed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-removed **Event topic** : `linkedin-company-service-companyadmin-removed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-created **Event topic** : `linkedin-company-service-company-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"POST","action":"create","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-retrived **Event topic** : `linkedin-company-service-company-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"GET","action":"get","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companies-listed **Event topic** : `linkedin-company-service-companies-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companies` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companies`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companies","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companies":[{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event company-updated **Event topic** : `linkedin-company-service-company-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-deleted **Event topic** : `linkedin-company-service-company-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-assigned **Event topic** : `linkedin-company-service-companyadmin-assigned` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmins-listed **Event topic** : `linkedin-company-service-companyadmins-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmins` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmins`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmins","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyAdmins":[{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-retrived **Event topic** : `linkedin-company-service-companyupdate-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-unfollowed **Event topic** : `linkedin-company-service-company-unfollowed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollowers-listed **Event topic** : `linkedin-company-service-companyfollowers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollowers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollowers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollowers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyFollowers":[{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-created **Event topic** : `linkedin-company-service-companyupdate-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-updated **Event topic** : `linkedin-company-service-companyupdate-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollower-retrived **Event topic** : `linkedin-company-service-companyfollower-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-deleted **Event topic** : `linkedin-company-service-companyupdate-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdates-listed **Event topic** : `linkedin-company-service-companyupdates-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdates` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdates`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdates","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyUpdates":[{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event company-created **Event topic**: `elastic-index-linkedin_company-created` **Event payload**: ```json {"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event company-updated **Event topic**: `elastic-index-linkedin_company-created` **Event payload**: ```json {"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event company-deleted **Event topic**: `elastic-index-linkedin_company-deleted` **Event payload**: ```json {"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event company-extended **Event topic**: `elastic-index-linkedin_company-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event companyadmin-retrived **Event topic** : `linkedin-company-service-companyadmin-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-followed **Event topic** : `linkedin-company-service-company-followed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-removed **Event topic** : `linkedin-company-service-companyadmin-removed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-created **Event topic** : `linkedin-company-service-company-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"POST","action":"create","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-retrived **Event topic** : `linkedin-company-service-company-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"GET","action":"get","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companies-listed **Event topic** : `linkedin-company-service-companies-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companies` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companies`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companies","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companies":[{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event company-updated **Event topic** : `linkedin-company-service-company-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-deleted **Event topic** : `linkedin-company-service-company-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-assigned **Event topic** : `linkedin-company-service-companyadmin-assigned` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmins-listed **Event topic** : `linkedin-company-service-companyadmins-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmins` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmins`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmins","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyAdmins":[{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-retrived **Event topic** : `linkedin-company-service-companyupdate-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-unfollowed **Event topic** : `linkedin-company-service-company-unfollowed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollowers-listed **Event topic** : `linkedin-company-service-companyfollowers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollowers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollowers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollowers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyFollowers":[{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-created **Event topic** : `linkedin-company-service-companyupdate-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-updated **Event topic** : `linkedin-company-service-companyupdate-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollower-retrived **Event topic** : `linkedin-company-service-companyfollower-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-deleted **Event topic** : `linkedin-company-service-companyupdate-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdates-listed **Event topic** : `linkedin-company-service-companyupdates-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdates` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdates`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdates","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyUpdates":[{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event companyadmin-created **Event topic**: `elastic-index-linkedin_companyadmin-created` **Event payload**: ```json {"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyadmin-updated **Event topic**: `elastic-index-linkedin_companyadmin-created` **Event payload**: ```json {"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyadmin-deleted **Event topic**: `elastic-index-linkedin_companyadmin-deleted` **Event payload**: ```json {"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event companyadmin-extended **Event topic**: `elastic-index-linkedin_companyadmin-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event companyadmin-retrived **Event topic** : `linkedin-company-service-companyadmin-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-followed **Event topic** : `linkedin-company-service-company-followed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-removed **Event topic** : `linkedin-company-service-companyadmin-removed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-created **Event topic** : `linkedin-company-service-company-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"POST","action":"create","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-retrived **Event topic** : `linkedin-company-service-company-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"GET","action":"get","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companies-listed **Event topic** : `linkedin-company-service-companies-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companies` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companies`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companies","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companies":[{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event company-updated **Event topic** : `linkedin-company-service-company-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-deleted **Event topic** : `linkedin-company-service-company-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `company` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`company`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmin-assigned **Event topic** : `linkedin-company-service-companyadmin-assigned` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmin` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmin`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyadmins-listed **Event topic** : `linkedin-company-service-companyadmins-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyAdmins` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyAdmins`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmins","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyAdmins":[{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-retrived **Event topic** : `linkedin-company-service-companyupdate-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event company-unfollowed **Event topic** : `linkedin-company-service-company-unfollowed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollowers-listed **Event topic** : `linkedin-company-service-companyfollowers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollowers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollowers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollowers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyFollowers":[{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event companyupdate-created **Event topic** : `linkedin-company-service-companyupdate-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-updated **Event topic** : `linkedin-company-service-companyupdate-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyfollower-retrived **Event topic** : `linkedin-company-service-companyfollower-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyFollower` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyFollower`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdate-deleted **Event topic** : `linkedin-company-service-companyupdate-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdate` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdate`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event companyupdates-listed **Event topic** : `linkedin-company-service-companyupdates-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `companyUpdates` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`companyUpdates`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdates","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyUpdates":[{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-company-service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Company Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Company Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Company Service via HTTP requests for purposes such as creating, updating, deleting and querying Company objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Company Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Company service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Company service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Company service. This service is configured to listen for HTTP requests on port `3002`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Company service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Company` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Company` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Company` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Company service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### CompanyFollower resource *Resource Definition* : Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. *CompanyFollower Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **userId** | ID | | | *FK to auth:user who follows the company.* | | **companyId** | ID | | | *FK to company:company being followed.* | | **followedAt** | Date | | | *Timestamp when user followed company.* | ### CompanyUpdate resource *Resource Definition* : A post/news update created by company admin and visible to followers depending on visibility. *CompanyUpdate Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **companyId** | ID | | | *FK to company whose update this is.* | | **content** | Text | | | *Body/content of the update/news item.* | | **authorUserId** | ID | | | *FK to auth:user who authored the update (must be active admin at time of post).* | | **attachmentUrls** | String | | | *Array of URLs for update attachments (files, images, links).* | | **visibility** | Enum | | | *Update visibility: public (all) or private (followers only).* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### visibility Enum Property *Property Definition* : Update visibility: public (all) or private (followers only).*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **public** | `"public""` | 0 | | **private** | `"private""` | 1 | ### Company resource *Resource Definition* : Represents a company profile and brand presence/pages on the network. *Company Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **name** | String | | | *Company brand name. Displayed and searchable. Unique per company.* | | **website** | String | | | *Official company website link.* | | **location** | String | | | *Company HQ/main location string (e.g. city, country).* | | **logoUrl** | String | | | *Uploaded image URL for company logo/branding.* | | **pageVisibility** | Enum | | | *Visibility of the company page (public/private).* | | **createdByUserId** | ID | | | ** | | **description** | Text | | | *Company description / about section.* | | **industry** | String | | | *Industry sector or market.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### pageVisibility Enum Property *Property Definition* : Visibility of the company page (public/private).*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **public** | `"public""` | 0 | | **private** | `"private""` | 1 | ### CompanyAdmin resource *Resource Definition* : Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. *CompanyAdmin Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **assignedAt** | Date | | | *Timestamp when admin assigned.* | | **userId** | ID | | | *FK to auth:user who is admin of this company.* | | **companyId** | ID | | | *FK to company.* | | **assignedBy** | ID | | | *User who assigned this admin (for audit).* | ## Business Api ### Get Companyadmin API *API Definition* : Get company admin record by ID. Only admins can query of their company. *API Crud Type* : get *Default access route* : *GET* `/v1/companyadmins/:companyAdminId` #### Parameters The getCompanyAdmin api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Companyadmin](businessApi/getCompanyAdmin). ### Follow Company API *API Definition* : Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. *API Crud Type* : create *Default access route* : *POST* `/v1/followcompany` #### Parameters The followCompany api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Follow Company](businessApi/followCompany). ### Remove Companyadmin API *API Definition* : Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? *API Crud Type* : delete *Default access route* : *DELETE* `/v1/removecompanyadmin/:companyAdminId` #### Parameters The removeCompanyAdmin api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Remove Companyadmin](businessApi/removeCompanyAdmin). ### Create Company API *API Definition* : Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). *API Crud Type* : create *Default access route* : *POST* `/v1/companies` #### Parameters The createCompany api has got 8 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"POST","action":"create","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Company](businessApi/createCompany). ### Get Company API *API Definition* : Get a company page by ID. If public, anyone can view. If private, only admin/followers. *API Crud Type* : get *Default access route* : *GET* `/v1/companies/:companyId` #### Parameters The getCompany api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"GET","action":"get","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Company](businessApi/getCompany). ### List Companies API *API Definition* : List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. *API Crud Type* : list *Default access route* : *GET* `/v1/companies` The listCompanies api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companies`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companies","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companies":[{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Companies](businessApi/listCompanies). ### Update Company API *API Definition* : Updates fields of a company page/profile. Only current company admin can update. *API Crud Type* : update *Default access route* : *PATCH* `/v1/companies/:companyId` #### Parameters The updateCompany api has got 9 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Company](businessApi/updateCompany). ### Delete Company API *API Definition* : Deletes (soft-delete) a company page. Only current admin may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/companies/:companyId` #### Parameters The deleteCompany api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"company","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"company":{"id":"ID","name":"String","website":"String","location":"String","logoUrl":"String","pageVisibility":"Enum","pageVisibility_idx":"Integer","createdByUserId":"ID","description":"Text","industry":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Company](businessApi/deleteCompany). ### Assign Companyadmin API *API Definition* : Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. *API Crud Type* : create *Default access route* : *POST* `/v1/assigncompanyadmin` #### Parameters The assignCompanyAdmin api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmin","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyAdmin":{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Assign Companyadmin](businessApi/assignCompanyAdmin). ### List Companyadmins API *API Definition* : List all current admins for a given company. Only admins can query their company admin list. *API Crud Type* : list *Default access route* : *GET* `/v1/companyadmins` The listCompanyAdmins api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmins`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyAdmins","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyAdmins":[{"id":"ID","assignedAt":"Date","userId":"ID","companyId":"ID","assignedBy":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Companyadmins](businessApi/listCompanyAdmins). ### Get Companyupdate API *API Definition* : Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. *API Crud Type* : get *Default access route* : *GET* `/v1/companyupdates/:companyUpdateId` #### Parameters The getCompanyUpdate api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Companyupdate](businessApi/getCompanyUpdate). ### Unfollow Company API *API Definition* : Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/unfollowcompany/:companyFollowerId` #### Parameters The unfollowCompany api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Unfollow Company](businessApi/unfollowCompany). ### List Companyfollowers API *API Definition* : List all followers of a company. Only company admin can see list of all followers. *API Crud Type* : list *Default access route* : *GET* `/v1/companyfollowers` The listCompanyFollowers api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollowers`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollowers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyFollowers":[{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Companyfollowers](businessApi/listCompanyFollowers). ### Create Companyupdate API *API Definition* : Posts a company update/news. Only active admin of company may post on that company's behalf. *API Crud Type* : create *Default access route* : *POST* `/v1/companyupdates` #### Parameters The createCompanyUpdate api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"POST","action":"create","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Companyupdate](businessApi/createCompanyUpdate). ### Update Companyupdate API *API Definition* : Update company update post/news. Only author or company admins may update. *API Crud Type* : update *Default access route* : *PATCH* `/v1/companyupdates/:companyUpdateId` #### Parameters The updateCompanyUpdate api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Companyupdate](businessApi/updateCompanyUpdate). ### Get Companyfollower API *API Definition* : Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. *API Crud Type* : get *Default access route* : *GET* `/v1/companyfollowers/:companyFollowerId` #### Parameters The getCompanyFollower api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyFollower","method":"GET","action":"get","appVersion":"Version","rowCount":1,"companyFollower":{"id":"ID","userId":"ID","companyId":"ID","followedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Companyfollower](businessApi/getCompanyFollower). ### Delete Companyupdate API *API Definition* : Delete (soft delete) a company update/news. Only author or current admin may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/companyupdates/:companyUpdateId` #### Parameters The deleteCompanyUpdate api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdate","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"companyUpdate":{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Companyupdate](businessApi/deleteCompanyUpdate). ### List Companyupdates API *API Definition* : List company updates/news for a company. Public updates are visible to all, private to followers/admins. *API Crud Type* : list *Default access route* : *GET* `/v1/companyupdates` The listCompanyUpdates api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdates`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"companyUpdates","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","companyUpdates":[{"id":"ID","companyId":"ID","content":"Text","authorUserId":"ID","attachmentUrls":"String","visibility":"Enum","visibility_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Companyupdates](businessApi/listCompanyUpdates). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-company-service** documentation -Version:**`1.0.2`** ## Scope This document provides a structured architectural overview of the `company` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `Company` Service Settings [**Edit**](company/serviceSettings) Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Service Overview This service is configured to listen for HTTP requests on port `3002`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-company-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-company-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `companyFollower` | Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. | accessPrivate | | `companyUpdate` | A post/news update created by company admin and visible to followers depending on visibility. | accessPublic | | `company` | Represents a company profile and brand presence/pages on the network. | accessPublic | | `companyAdmin` | Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. | accessPrivate | ## companyFollower Data Object ### Object Overview **Description:** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **companyFollowerUnique**: [companyId, userId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `userId` | ID | Yes | FK to auth:user who follows the company. | | `companyId` | ID | Yes | FK to company:company being followed. | | `followedAt` | Date | Yes | Timestamp when user followed company. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **userId**: '00000000-0000-0000-0000-000000000000' - **companyId**: '00000000-0000-0000-0000-000000000000' - **followedAt**: new Date() ### Constant Properties `userId` `companyId` `followedAt` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `userId` `companyId` `followedAt` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `userId` `companyId` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `userId` `companyId` `followedAt` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `userId` `companyId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **userId**: ID has a filter named `userId` ## companyUpdate Data Object ### Object Overview **Description:** A post/news update created by company admin and visible to followers depending on visibility. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPublic — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Membership Settings This data object is configured to support membership-based access control, allowing users to be associated with specific instances of this object. A `companyAdmin` data object is used to manage membership based acces to this object. The `companyAdmin` object contains entries that link users to this data object, enabling fine-grained access control based on user membership status. Note that this is not a user management system, but rather a way to associate users with specific instances of this object. The `companyId` property in the membership object refers back to this data object, linking the membership entry to this object. The `userId` property in the membership object refers to the user who holds membership, typically linked to the user's session during authorization checks. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `companyId` | ID | Yes | FK to company whose update this is. | | `content` | Text | Yes | Body/content of the update/news item. | | `authorUserId` | ID | Yes | FK to auth:user who authored the update (must be active admin at time of post). | | `attachmentUrls` | String | No | Array of URLs for update attachments (files, images, links). | | `visibility` | Enum | Yes | Update visibility: public (all) or private (followers only). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Array Properties `attachmentUrls` Array properties can hold multiple values and are indicated by the `[]` suffix in their type. Avoid using arrays in properties that are used for relations, as they will not work correctly. Note that using connection objects instead of arrays is recommended for relations, as they provide better performance and flexibility. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **companyId**: '00000000-0000-0000-0000-000000000000' - **content**: 'text' - **authorUserId**: '00000000-0000-0000-0000-000000000000' - **visibility**: public ### Constant Properties `companyId` `authorUserId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `companyId` `content` `authorUserId` `attachmentUrls` `visibility` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **visibility**: [public, private] ### Elastic Search Indexing `companyId` `content` `authorUserId` `visibility` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `companyId` `authorUserId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `companyId` `authorUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `visibility` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **visibility**: Enum has a filter named `visibility` ## company Data Object ### Object Overview **Description:** Represents a company profile and brand presence/pages on the network. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPublic — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `name` | String | Yes | Company brand name. Displayed and searchable. Unique per company. | | `website` | String | No | Official company website link. | | `location` | String | No | Company HQ/main location string (e.g. city, country). | | `logoUrl` | String | No | Uploaded image URL for company logo/branding. | | `pageVisibility` | Enum | Yes | Visibility of the company page (public/private). | | `createdByUserId` | ID | Yes | - | | `description` | Text | No | Company description / about section. | | `industry` | String | No | Industry sector or market. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **name**: 'default' - **pageVisibility**: public - **createdByUserId**: '00000000-0000-0000-0000-000000000000' ### Auto Update Properties `name` `website` `location` `logoUrl` `pageVisibility` `createdByUserId` `description` `industry` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **pageVisibility**: [public, private] ### Elastic Search Indexing `name` `website` `location` `logoUrl` `pageVisibility` `createdByUserId` `description` `industry` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `name` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `name` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Filter Properties `name` `location` `pageVisibility` `industry` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **name**: String has a filter named `name` - **location**: String has a filter named `location` - **pageVisibility**: Enum has a filter named `pageVisibility` - **industry**: String has a filter named `industry` ## companyAdmin Data Object ### Object Overview **Description:** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **companyAdminUnique**: [companyId, userId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `assignedAt` | Date | Yes | Timestamp when admin assigned. | | `userId` | ID | Yes | FK to auth:user who is admin of this company. | | `companyId` | ID | Yes | FK to company. | | `assignedBy` | ID | Yes | User who assigned this admin (for audit). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **assignedAt**: new Date() - **userId**: '00000000-0000-0000-0000-000000000000' - **companyId**: '00000000-0000-0000-0000-000000000000' - **assignedBy**: '00000000-0000-0000-0000-000000000000' ### Constant Properties `assignedAt` `userId` `companyId` `assignedBy` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `assignedAt` `userId` `companyId` `assignedBy` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `userId` `companyId` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `assignedAt` `userId` `companyId` `assignedBy` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `userId` `companyId` `assignedBy` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **assignedBy**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: No ### Filter Properties `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **userId**: ID has a filter named `userId` ## Business Logic company has got 18 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [Get Companyadmin](/businessLogic/getcompanyadmin) * [Follow Company](/businessLogic/followcompany) * [Remove Companyadmin](/businessLogic/removecompanyadmin) * [Create Company](/businessLogic/createcompany) * [Get Company](/businessLogic/getcompany) * [List Companies](/businessLogic/listcompanies) * [Update Company](/businessLogic/updatecompany) * [Delete Company](/businessLogic/deletecompany) * [Assign Companyadmin](/businessLogic/assigncompanyadmin) * [List Companyadmins](/businessLogic/listcompanyadmins) * [Get Companyupdate](/businessLogic/getcompanyupdate) * [Unfollow Company](/businessLogic/unfollowcompany) * [List Companyfollowers](/businessLogic/listcompanyfollowers) * [Create Companyupdate](/businessLogic/createcompanyupdate) * [Update Companyupdate](/businessLogic/updatecompanyupdate) * [Get Companyfollower](/businessLogic/getcompanyfollower) * [Delete Companyupdate](/businessLogic/deletecompanyupdate) * [List Companyupdates](/businessLogic/listcompanyupdates) ## Edge Controllers No edge controllers defined for this service. --- ## Service Library ### Functions No general functions defined. ### Hook Functions No hook functions defined. ### Edge Functions No edge functions defined. ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3002` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* # EVENT GUIDE ## linkedin-content-service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Content` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Content` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Content` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Content` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Content` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent post-created **Event topic**: `linkedin-content-service-dbevent-post-created` This event is triggered upon the creation of a `post` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent post-updated **Event topic**: `linkedin-content-service-dbevent-post-updated` Activation of this event follows the update of a `post` data object. The payload contains the updated information under the `post` attribute, along with the original data prior to update, labeled as `old_post` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_post:{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, post:{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent post-deleted **Event topic**: `linkedin-content-service-dbevent-post-deleted` This event announces the deletion of a `post` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent like-created **Event topic**: `linkedin-content-service-dbevent-like-created` This event is triggered upon the creation of a `like` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent like-updated **Event topic**: `linkedin-content-service-dbevent-like-updated` Activation of this event follows the update of a `like` data object. The payload contains the updated information under the `like` attribute, along with the original data prior to update, labeled as `old_like` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_like:{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, like:{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent like-deleted **Event topic**: `linkedin-content-service-dbevent-like-deleted` This event announces the deletion of a `like` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent comment-created **Event topic**: `linkedin-content-service-dbevent-comment-created` This event is triggered upon the creation of a `comment` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent comment-updated **Event topic**: `linkedin-content-service-dbevent-comment-updated` Activation of this event follows the update of a `comment` data object. The payload contains the updated information under the `comment` attribute, along with the original data prior to update, labeled as `old_comment` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_comment:{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, comment:{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent comment-deleted **Event topic**: `linkedin-content-service-dbevent-comment-deleted` This event announces the deletion of a `comment` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Content` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event post-created **Event topic**: `elastic-index-linkedin_post-created` **Event payload**: ```json {"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event post-updated **Event topic**: `elastic-index-linkedin_post-created` **Event payload**: ```json {"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event post-deleted **Event topic**: `elastic-index-linkedin_post-deleted` **Event payload**: ```json {"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event post-extended **Event topic**: `elastic-index-linkedin_post-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event post-created **Event topic** : `linkedin-content-service-post-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"POST","action":"create","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-updated **Event topic** : `linkedin-content-service-comment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event posts-listed **Event topic** : `linkedin-content-service-posts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-liked **Event topic** : `linkedin-content-service-post-liked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"POST","action":"create","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-retrived **Event topic** : `linkedin-content-service-post-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"GET","action":"get","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-created **Event topic** : `linkedin-content-service-comment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-deleted **Event topic** : `linkedin-content-service-post-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-updated **Event topic** : `linkedin-content-service-post-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event likes-listed **Event topic** : `linkedin-content-service-likes-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `likes` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`likes`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"likes","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","likes":[{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-unliked **Event topic** : `linkedin-content-service-post-unliked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comments-listed **Event topic** : `linkedin-content-service-comments-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","comments":[{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-retrived **Event topic** : `linkedin-content-service-comment-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event userposts-listed **Event topic** : `linkedin-content-service-userposts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-deleted **Event topic** : `linkedin-content-service-comment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Index Event like-created **Event topic**: `elastic-index-linkedin_like-created` **Event payload**: ```json {"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event like-updated **Event topic**: `elastic-index-linkedin_like-created` **Event payload**: ```json {"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event like-deleted **Event topic**: `elastic-index-linkedin_like-deleted` **Event payload**: ```json {"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event like-extended **Event topic**: `elastic-index-linkedin_like-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event post-created **Event topic** : `linkedin-content-service-post-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"POST","action":"create","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-updated **Event topic** : `linkedin-content-service-comment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event posts-listed **Event topic** : `linkedin-content-service-posts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-liked **Event topic** : `linkedin-content-service-post-liked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"POST","action":"create","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-retrived **Event topic** : `linkedin-content-service-post-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"GET","action":"get","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-created **Event topic** : `linkedin-content-service-comment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-deleted **Event topic** : `linkedin-content-service-post-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-updated **Event topic** : `linkedin-content-service-post-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event likes-listed **Event topic** : `linkedin-content-service-likes-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `likes` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`likes`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"likes","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","likes":[{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-unliked **Event topic** : `linkedin-content-service-post-unliked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comments-listed **Event topic** : `linkedin-content-service-comments-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","comments":[{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-retrived **Event topic** : `linkedin-content-service-comment-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event userposts-listed **Event topic** : `linkedin-content-service-userposts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-deleted **Event topic** : `linkedin-content-service-comment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Index Event comment-created **Event topic**: `elastic-index-linkedin_comment-created` **Event payload**: ```json {"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event comment-updated **Event topic**: `elastic-index-linkedin_comment-created` **Event payload**: ```json {"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event comment-deleted **Event topic**: `elastic-index-linkedin_comment-deleted` **Event payload**: ```json {"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event comment-extended **Event topic**: `elastic-index-linkedin_comment-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event post-created **Event topic** : `linkedin-content-service-post-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"POST","action":"create","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-updated **Event topic** : `linkedin-content-service-comment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event posts-listed **Event topic** : `linkedin-content-service-posts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-liked **Event topic** : `linkedin-content-service-post-liked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"POST","action":"create","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-retrived **Event topic** : `linkedin-content-service-post-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"GET","action":"get","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comment-created **Event topic** : `linkedin-content-service-comment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-deleted **Event topic** : `linkedin-content-service-post-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event post-updated **Event topic** : `linkedin-content-service-post-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `post` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`post`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event likes-listed **Event topic** : `linkedin-content-service-likes-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `likes` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`likes`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"likes","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","likes":[{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event post-unliked **Event topic** : `linkedin-content-service-post-unliked` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `like` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`like`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event comments-listed **Event topic** : `linkedin-content-service-comments-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","comments":[{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-retrived **Event topic** : `linkedin-content-service-comment-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event userposts-listed **Event topic** : `linkedin-content-service-userposts-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `posts` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`posts`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event comment-deleted **Event topic** : `linkedin-content-service-comment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `comment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`comment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-content-service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Content Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Content Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Content Service via HTTP requests for purposes such as creating, updating, deleting and querying Content objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Content Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Content service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Content service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Content service. This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Content service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Content` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Content` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Content` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Content service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### Post resource *Resource Definition* : A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. *Post Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **content** | Text | | | *Main post content/body text* | | **companyId** | ID | | | *Optional. FK to company:company - if set, post is from company context (by admin).* | | **authorUserId** | ID | | | *FK to auth:user - the user who created the post. Required.* | | **visibility** | Enum | | | *Post-level visibility: public or private.* | | **attachmentUrls** | String | | | *Array of attachment URLs (e.g. images, docs, links). Optional.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### visibility Enum Property *Property Definition* : Post-level visibility: public or private.*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **public** | `"public""` | 0 | | **private** | `"private""` | 1 | ### Like resource *Resource Definition* : A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. *Like Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **likedAt** | Date | | | *Timestamp when the like was made.* | | **postId** | ID | | | *FK to content:post - the post that was liked. Required.* | | **userId** | ID | | | *FK to auth:user - owner of the like entry (who liked). Required.* | ### Comment resource *Resource Definition* : A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). *Comment Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **authorUserId** | ID | | | *FK to auth:user - user who authored comment.* | | **postId** | ID | | | *FK to content:post - the post this comment is for. Required.* | | **content** | Text | | | *Comment body/content.* | | **parentCommentId** | ID | | | *Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment.* | ## Business Api ### Create Post API *API Definition* : Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. *API Crud Type* : create *Default access route* : *POST* `/v1/posts` #### Parameters The createPost api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"POST","action":"create","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Post](businessApi/createPost). ### Update Comment API *API Definition* : Update an existing comment. Only the author can update. *API Crud Type* : update *Default access route* : *PATCH* `/v1/comments/:commentId` #### Parameters The updateComment api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Comment](businessApi/updateComment). ### List Posts API *API Definition* : List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. *API Crud Type* : list *Default access route* : *GET* `/v1/posts` The listPosts api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`posts`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Posts](businessApi/listPosts). ### Like Post API *API Definition* : Like a post. User can like a post only once; duplicate likes prevented. *API Crud Type* : create *Default access route* : *POST* `/v1/likepost` #### Parameters The likePost api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`like`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"POST","action":"create","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Like Post](businessApi/likePost). ### Get Post API *API Definition* : Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). *API Crud Type* : get *Default access route* : *GET* `/v1/posts/:postId` #### Parameters The getPost api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"GET","action":"get","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Post](businessApi/getPost). ### Create Comment API *API Definition* : Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. *API Crud Type* : create *Default access route* : *POST* `/v1/comments` #### Parameters The createComment api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Comment](businessApi/createComment). ### Delete Post API *API Definition* : Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/posts/:postId` #### Parameters The deletePost api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Post](businessApi/deletePost). ### Update Post API *API Definition* : Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). *API Crud Type* : update *Default access route* : *PATCH* `/v1/posts/:postId` #### Parameters The updatePost api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"post","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"post":{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Post](businessApi/updatePost). ### List Likes API *API Definition* : List likes on a given post (or by user). Supports filtering by postId and userId. *API Crud Type* : list *Default access route* : *GET* `/v1/likes` The listLikes api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`likes`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"likes","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","likes":[{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Likes](businessApi/listLikes). ### Unlike Post API *API Definition* : Undo a like by user for a given post. Soft-deletes the like record. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/unlikepost/:likeId` #### Parameters The unlikePost api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`like`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"like","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"like":{"id":"ID","likedAt":"Date","postId":"ID","userId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Unlike Post](businessApi/unlikePost). ### List Comments API *API Definition* : List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. *API Crud Type* : list *Default access route* : *GET* `/v1/comments` The listComments api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comments`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","comments":[{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Comments](businessApi/listComments). ### Get Comment API *API Definition* : Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. *API Crud Type* : get *Default access route* : *GET* `/v1/comments/:commentId` #### Parameters The getComment api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Comment](businessApi/getComment). ### List Userposts API *API Definition* : list all posts of a user *API Crud Type* : list *Default access route* : *GET* `/v1/userposts` The listUserPosts api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`posts`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"posts","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","posts":[{"id":"ID","content":"Text","companyId":"ID","authorUserId":"ID","visibility":"Enum","visibility_idx":"Integer","attachmentUrls":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Userposts](businessApi/listUserPosts). ### Delete Comment API *API Definition* : Delete (soft-delete) a comment. Only the author may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/comments/:commentId` #### Parameters The deleteComment api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"comment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"comment":{"id":"ID","authorUserId":"ID","postId":"ID","content":"Text","parentCommentId":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Comment](businessApi/deleteComment). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-content-service** documentation -Version:**`1.0.4`** ## Scope This document provides a structured architectural overview of the `content` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `Content` Service Settings [**Edit**](content/serviceSettings) Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Service Overview This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-content-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-content-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `post` | A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. | accessProtected | | `like` | A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. | accessProtected | | `comment` | A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). | accessProtected | ## post Data Object ### Object Overview **Description:** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessProtected — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `content` | Text | Yes | Main post content/body text | | `companyId` | ID | No | Optional. FK to company:company - if set, post is from company context (by admin). | | `authorUserId` | ID | Yes | FK to auth:user - the user who created the post. Required. | | `visibility` | Enum | Yes | Post-level visibility: public or private. | | `attachmentUrls` | String | No | Array of attachment URLs (e.g. images, docs, links). Optional. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Array Properties `attachmentUrls` Array properties can hold multiple values and are indicated by the `[]` suffix in their type. Avoid using arrays in properties that are used for relations, as they will not work correctly. Note that using connection objects instead of arrays is recommended for relations, as they provide better performance and flexibility. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **content**: 'text' - **authorUserId**: '00000000-0000-0000-0000-000000000000' - **visibility**: public ### Constant Properties `authorUserId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `content` `companyId` `visibility` `attachmentUrls` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **visibility**: [public, private] ### Elastic Search Indexing `content` `companyId` `authorUserId` `visibility` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `companyId` `authorUserId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `companyId` `authorUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: No - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `companyId` `authorUserId` `visibility` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **companyId**: ID has a filter named `companyId` - **authorUserId**: ID has a filter named `authorUserId` - **visibility**: Enum has a filter named `visibility` ## like Data Object ### Object Overview **Description:** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessProtected — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **uniqueLikeOnPost**: [postId, userId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `likedAt` | Date | Yes | Timestamp when the like was made. | | `postId` | ID | Yes | FK to content:post - the post that was liked. Required. | | `userId` | ID | Yes | FK to auth:user - owner of the like entry (who liked). Required. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **likedAt**: new Date() - **postId**: '00000000-0000-0000-0000-000000000000' - **userId**: '00000000-0000-0000-0000-000000000000' ### Always Create with Default Values Some of the default values are set to be always used when creating a new object, even if the property value is provided in the request body. It ensures that the property is always initialized with a default value when the object is created. - **likedAt**: Will be created with value `new Date()` ### Constant Properties `likedAt` `postId` `userId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Elastic Search Indexing `postId` `userId` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `postId` `userId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Cache Select Properties `postId` `userId` Cache select properties are used to collect data from Redis entity cache with a different key than the data object id. This allows you to cache data that is not directly related to the data object id, but a frequently used filter. ### Relation Properties `postId` `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **postId**: ID Relation to `post`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Session Data Properties `userId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **userId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `postId` `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **postId**: ID has a filter named `postId` - **userId**: ID has a filter named `userId` ## comment Data Object ### Object Overview **Description:** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessProtected — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `authorUserId` | ID | Yes | FK to auth:user - user who authored comment. | | `postId` | ID | Yes | FK to content:post - the post this comment is for. Required. | | `content` | Text | Yes | Comment body/content. | | `parentCommentId` | ID | No | Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **authorUserId**: '00000000-0000-0000-0000-000000000000' - **postId**: '00000000-0000-0000-0000-000000000000' - **content**: 'text' ### Constant Properties `authorUserId` `postId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `content` `parentCommentId` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `authorUserId` `postId` `content` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `postId` `parentCommentId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `authorUserId` `postId` `parentCommentId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **postId**: ID Relation to `post`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **parentCommentId**: ID Relation to `comment`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: No ### Session Data Properties `authorUserId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **authorUserId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `postId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **postId**: ID has a filter named `postId` ## Business Logic content has got 14 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [Create Post](/businessLogic/createpost) * [Update Comment](/businessLogic/updatecomment) * [List Posts](/businessLogic/listposts) * [Like Post](/businessLogic/likepost) * [Get Post](/businessLogic/getpost) * [Create Comment](/businessLogic/createcomment) * [Delete Post](/businessLogic/deletepost) * [Update Post](/businessLogic/updatepost) * [List Likes](/businessLogic/listlikes) * [Unlike Post](/businessLogic/unlikepost) * [List Comments](/businessLogic/listcomments) * [Get Comment](/businessLogic/getcomment) * [List Userposts](/businessLogic/listuserposts) * [Delete Comment](/businessLogic/deletecomment) ## Edge Controllers No edge controllers defined for this service. --- ## Service Library ### Functions #### getPostListVisibilityFilter.js ```js module.exports = (ctx) => { // Returns an MScript-style object filter for listPosts API // Only fetch posts that are: // - public (visibility == "public") // - or owned by the current user (authorUserId == session.userId) // If companyId filter present, only posts from that company. // This utility is invoked as MScript in fullWhereClause. const userId = ctx.session?.userId; const filters = []; if (ctx.authorUserId) { filters.push({ authorUserId: ctx.authorUserId }); } if (ctx.companyId) { filters.push({ companyId: ctx.companyId }); } // Show all public posts const publicOrOwned = userId ? { $or: [ { visibility: 'public' }, { authorUserId: userId } ] } : { visibility: 'public' }; filters.push(publicOrOwned); return filters.length > 1 ? { $and: filters } : filters[0]; }; ``` ### Hook Functions No hook functions defined. ### Edge Functions No edge functions defined. ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3001` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* -------------------------------------------------------- title: Example description: Test slug: example date: 01.04.2025 -------------------------------------------------------- # Example ## deneme # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 1 - Authentication Management** This document is the first part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This first document includes general information about the project and its authentication management. Please read it carefully and implement all requirements described here. The project has 1 auth service, 1 notification service, 1 BFF service, and 6 business services, plus other helper services such as bucket and realtime. In this document you will be informed only about the auth service. The initial frontend will be generated to use this service. Each service is a separate microservice application and listens for HTTP requests at different service URLs. Services may be deployed to the preview server, staging server, or production server. Therefore, each service has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the home page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each backend service has its own URL for each deployment environment. Users may want to test the frontend in one of the three deployments—preview, staging, or production. Please ensure that the home page includes a deployment server selection option so that, as the frontend coding agent, you can set the base URL for all services. The base URL of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base URL will be given in the service sections. Any request that requires login must include a valid token in the Bearer authorization header. Please note that for each service in the project (which will be introduced in following pages) will use a different address so it is a good practice to define a separate client for each service in the frontend application lib source. Not only the different base urls, some services even may need different access rules when shaping the request. ## Home page First build a home page which shows some static content about the application, and has got login and registration (if is public) buttons. The home page shpuld be updated later according to the content that each service provides, as a frontend developer use best and common practices to reflect the service content to the home page. User may also give extra information for the home page content in addtion to this prompt. Note that this page should include a deployment (environment) selection option to set the base URL. Set the default to `production`. After user logs in, page header should show the current login state as in modern web pages, logged in user fullname, avatar, email and with a logout link, make a fancy current user component. The home page may have different views before and after login. ## Registration Management ### User Registration User registration is public in the application, ensure that the register and login pages include a deployment server selection option so that you can set the base URL for all services. Start with a home page and set up the registration , verification, and login flow. Using the `registeruser` route of the auth API, send the required fields from your registration page. Please create a simple and polished registration page that includes only the necessary fields of the registration API. The `registerUser` API in the `auth` service is described with the request and response structure below. Note that since the `registerUser` API is a business API, it is versioned; call it with the given version like `/v1/registeruser`. ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, the frontend code should handle any verification requirements. Verification Management will be given in teh next prompt. The registration response will include a `user` object in the root envelope; this object contains user information with an `id` field. ## Login Management After successful registration and completing any required verifications, the user can log in. Please create a minimal, polished login page where the user can enter email and password. Note that this page should respect the deployment (environment) selection option made in the home page to set the base URL. If the user reaches this page directly skipping home page, the default `production`deployment will be used. The login API returns a created session. This session can be retrieved later with the access token using the `/currentuser` system route. Any request that requires login must include a valid token. When a user logs in successfully, the response JSON includes a JWT access token in the `accessToken` field. Under normal conditions, this token is also set as a cookie and consumed automatically. However, since AI coding agents’ preview options may fail to use cookies, ensure that each request includes the access token in the Bearer authorization header. If the login fails due to verification requirements, the response JSON includes an `errCode`. If it is `EmailVerificationNeeded`, start the email verification flow; if it is `MobileVerificationNeeded`, start the mobile verification flow. After a successful login, you can access session (user) information at any time with the `/currentuser` API. On inner pages, show brief profile information (avatar, name, etc.) using the session information from this API. Note that the `currentuser` API returns a session object, so there is no `id` property; instead, the values for the user and session are exposed as `userId` and `sessionId`. The response combines user and session information. The login, logout, and currentuser APIs are as follows. They are system routes and are not versioned. ### `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "sessionId": "e81c7d2b-4e95-9b1e-842e-3fb9c8c1df38", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... "accessToken": "ey7....", "userBucketToken": "e56d...." } ``` ### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates the session (if it exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` ### `GET /currentuser` — Current Session **Purpose** Returns the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). #### Request *No parameters.* #### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` #### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` Note that the `currentuser` API returns a session object, so there is no `id` property, instead, the values for the user and session are exposed as `userId` and `sessionId`. The response is a mix of user and session information. #### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. After you complete this first step, please ensure you have not made the following common mistakes: 1. When the application starts, please ensure that the `baseUrl` is set to the production server URL, and that the environment selector dropdown has the **Production** option selected by default. 2. Note that any api call to the application backend is based on a service base url, in this propmpt all auth apis should be called by `/auth-api` prefix after application's base url. 3. The `/currentuser` API returns a mix of session and user data. There is no `id` property —use `userId` and `sessionId`. 4. Please note that, the deployemnt environment selector will only be used in the home page. If any page is called directly bypassign home page, the page will use the stored or default environment. **After this prompt, the user may give you new instructions to update your first output or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 10 - Profile Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of profile ## Service Access Profile service management is handled through service specific base urls. Profile service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the profile service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ## Scope **Profile Service Description** Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. Profile service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`profile` Data Object**: Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **`premiumsubscription` Data Object**: premium subscription for a user **`certification` Data Object**: Official certification available for selection in user profile (dictionary only, not user relation). **`language` Data Object**: Official language available for selection in user profile (dictionary only, not user relation). **`sys_premiumsubscriptionPayment` Data Object**: A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **`sys_paymentCustomer` Data Object**: A payment storage object to store the customer values of the payment platform **`sys_paymentMethod` Data Object**: A payment storage object to store the payment methods of the platform customers ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## Profile Data Object Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... ### Profile Data Object Properties Profile data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `summary` | Text | false | No | Profile summary (bio/description). | | `headline` | String | false | No | Short tagline or headline for profile. | | `profilePhotoUrl` | String | false | No | URL for profile photo/avatar. | | `userId` | ID | false | Yes | Foreign key to auth:user. Owner of the profile. Single profile per user. | | `fullName` | String | false | Yes | Full name for display/search. | | `currentCompany` | String | false | No | Current employer/company, free text for now. | | `industry` | String | false | No | Industry sector name for profile. | | `languages` | String | true | No | Array of language names as string, links to language object (lookup/filter only). | | `skills` | String | true | No | List of professional skills (free-form tags). | | `location` | String | false | No | Location information (city, country, etc.) | | `experience` | Object | true | No | Array of experienceItem objects (job history). | | `profileVisibility` | Enum | false | Yes | Controls who can view profile: public or private. Used in search/list visibility. | | `education` | Object | true | No | Array of educationItem objects (degrees/certificates). | | `certifications` | String | true | No | Professional certifications by name, links to certification object. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Array Properties `languages` `skills` `experience` `education` `certifications` Array properties can hold multiple values. Array properties should be respected according to their multiple structure in the frontend in any user input for them. Please use multiple input components for the array proeprties when needed. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **profileVisibility**: [public, private] ### Relation Properties `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `headline` `fullName` `currentCompany` `industry` `location` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **headline**: String has a filter named `headline` - **fullName**: String has a filter named `fullName` - **currentCompany**: String has a filter named `currentCompany` - **industry**: String has a filter named `industry` - **location**: String has a filter named `location` ## Premiumsubscription Data Object premium subscription for a user ### Premiumsubscription Data Object Properties Premiumsubscription data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `profileId` | ID | false | Yes | the profile id of the subscription | | `currency` | String | false | Yes | currency | | `status` | String | false | Yes | - | | `price` | Double | false | Yes | the price of the subscription | | `userId` | ID | false | Yes | the userid of the subscription | | `_paymentConfirmation` | Enum | false | Yes | An automatic property that is used to check the confirmed status of the payment set by webhooks. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **_paymentConfirmation**: [pending, processing, paid, canceled] ### Relation Properties `profileId` `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **profileId**: ID Relation to `profile`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `profileId` `currency` `status` `price` `userId` `_paymentConfirmation` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **profileId**: ID has a filter named `subscriptionProfileId` - **currency**: String has a filter named `subscriptionCurrency` - **status**: String has a filter named `subscriptionStatus` - **price**: Double has a filter named `subscriptionPrice` - **userId**: ID has a filter named `subscriptionUserId` - **_paymentConfirmation**: Enum has a filter named `_paymentConfirmation` ## Certification Data Object Official certification available for selection in user profile (dictionary only, not user relation). ### Certification Data Object Properties Certification data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `name` | String | false | Yes | Unique certification name (e.g. PMP, CFA, AWS Certified). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Filter Properties `name` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **name**: String has a filter named `name` ## Language Data Object Official language available for selection in user profile (dictionary only, not user relation). ### Language Data Object Properties Language data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `name` | String | false | Yes | Unique language name (e.g. English, Spanish). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Filter Properties `name` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **name**: String has a filter named `name` ## Sys_premiumsubscriptionPayment Data Object A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config ### Sys_premiumsubscriptionPayment Data Object Properties Sys_premiumsubscriptionPayment data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `ownerId` | ID | false | No | An ID value to represent owner user who created the order | | `orderId` | ID | false | Yes | an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object | | `paymentId` | String | false | Yes | A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type | | `paymentStatus` | String | false | Yes | A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. | | `statusLiteral` | String | false | Yes | A string value to represent the logical payment status which belongs to the application lifecycle itself. | | `redirectUrl` | String | false | No | A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Filter Properties `ownerId` `orderId` `paymentId` `paymentStatus` `statusLiteral` `redirectUrl` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **ownerId**: ID has a filter named `ownerId` - **orderId**: ID has a filter named `orderId` - **paymentId**: String has a filter named `paymentId` - **paymentStatus**: String has a filter named `paymentStatus` - **statusLiteral**: String has a filter named `statusLiteral` - **redirectUrl**: String has a filter named `redirectUrl` ## Sys_paymentCustomer Data Object A payment storage object to store the customer values of the payment platform ### Sys_paymentCustomer Data Object Properties Sys_paymentCustomer data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `userId` | ID | false | No | An ID value to represent the user who is created as a stripe customer | | `customerId` | String | false | Yes | A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway | | `platform` | String | false | Yes | A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Filter Properties `userId` `customerId` `platform` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **userId**: ID has a filter named `userId` - **customerId**: String has a filter named `customerId` - **platform**: String has a filter named `platform` ## Sys_paymentMethod Data Object A payment storage object to store the payment methods of the platform customers ### Sys_paymentMethod Data Object Properties Sys_paymentMethod data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `paymentMethodId` | String | false | Yes | A string value to represent the id of the payment method on the payment platform. | | `userId` | ID | false | Yes | An ID value to represent the user who owns the payment method | | `customerId` | String | false | Yes | A string value to represent the customer id which is generated on the payment gateway. | | `cardHolderName` | String | false | No | A string value to represent the name of the card holder. It can be different than the registered customer. | | `cardHolderZip` | String | false | No | A string value to represent the zip code of the card holder. It is used for address verification in specific countries. | | `platform` | String | false | Yes | A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future. | | `cardInfo` | Object | false | Yes | A Json value to store the card details of the payment method. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Filter Properties `paymentMethodId` `userId` `customerId` `cardHolderName` `cardHolderZip` `platform` `cardInfo` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **paymentMethodId**: String has a filter named `paymentMethodId` - **userId**: ID has a filter named `userId` - **customerId**: String has a filter named `customerId` - **cardHolderName**: String has a filter named `cardHolderName` - **cardHolderZip**: String has a filter named `cardHolderZip` - **platform**: String has a filter named `platform` - **cardInfo**: Object has a filter named `cardInfo` ## API Reference ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 11 - Profile Service Premiumsubscription Payment Flow** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. ## Stripe Payment Flow For Premiumsubscription `Premiumsubscription` is a data object that stores order information used for Stripe payments. The payment flow can only start after an instance of this data object is created in the database. The ID of this data object—referenced as `premiumsubscriptionId` in the general business logic—will be used as the `orderId` in the payment flow. ## Accessing the service API for the payment flow API The Linkedin application doesn’t have a separate payment service; the payment flow is handled within the same service that manages orders. To access the related APIs, use the base URL of the `profile` service. Note that the application may be deployed to Preview, Staging, or Production. As with all API access, you should call the API using the base URL for the selected deployment. For the `profile` service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ## Creating the Premiumsubscription While creating the `premiumsubscription` instance is part of the business logic and can be implemented according to your architecture, this instance acts as the central hub for the payment flow and its related data objects. The order object is typically created via its own API (see the Business API for the create route of `premiumsubscription`). The payment flow begins **after** the object is created. Because of the data object’s **Stripe order settings**, the payment flow is aware of the following fields, references, and their purposes: - `id` (used as `orderId` or `${dataObject.objectName}Id`): The unique identifier of the data object instance at the center of the payment flow. - `orderId`: The order identifier is resolved from `this.premiumsubscription.id`. - `amount`: The payment amount is resolved from `this.premiumsubscription.price`. - `currency`: The payment currency is resolved from `this.premiumsubscription.currency`. - `description`: The payment description is resolved from ``Making subscription for this userId: ${this.premiumsubscription.userId} with profileId: ${this.premiumsubscription.profileId}``. - `orderStatusProperty`: `status` is updated automatically by the payment flow using a mapped status value. - `orderStatusUpdateDateProperty`: `updatedAt` stores the timestamp of the latest payment status update. - `orderOwnerIdProperty`: `userId` is used by the payment flow to verify the order owner and match it with the current user’s ID. - `mapPaymentResultToOrderStatus`: The order status is written to the data object instance using the following mapping. **paymentResultStarted**: `"pending"` **paymentResultCanceled**: `"cancelled"` **paymentResultFailed**: `"declined"` **paymentResultSuccess**: `"completed"` ## Before Payment Flow Starts It is assumed that the frontend provides a **“Pay”** or **“Checkout”** button that initiates the payment flow. The following steps occur after the user clicks this button. Note that an `premiumsubscription` instance must already exist to represent the order being paid, with its initial status set. A Stripe payment flow can be implemented in several ways, but the best practice is to use a **PaymentIntent** and manage it jointly from the backend and frontend. A *PaymentIntent* represents the intent to collect payment for a given order (or any payable entity). In the Linkedin application, the **PaymentIntent** is created in the backend, while the **PaymentMethod** (the user’s stored card information) is created in the frontend. Only the PaymentMethod ID and minimal metadata are stored in the backend for later reference. The frontend first requests the current user’s saved payment methods from the backend, displays them in a list, and provides UI options to **add or remove** payment methods. The user must select a Payment Method before starting the payment flow. ### Listing the Payment Methods for the User To list the payment methods of the currently logged-in user, call the following **system API** (unversioned): `GET /payment-methods/list` This endpoint requires no parameters and returns an array of payment methods belonging to the user — without any envelope. ```js const response = await fetch("$serviceUrl/payment-methods/list", { method: "GET", headers: { "Content-Type": "application/json" }, }); ```` Example response: ```json [ { "id": "19a5fbfd-3c25-405b-a7f7-06f023f2ca01", "paymentMethodId": "pm_1SQv9CP5uUv56Cse5BQ3nGW8", "userId": "f7103b85-fcda-4dec-92c6-c336f71fd3a2", "customerId": "cus_TNgWUw5QkmUPLa", "cardHolderName": "John Doe", "cardHolderZip": "34662", "platform": "stripe", "cardInfo": { "brand": "visa", "last4": "4242", "checks": { "cvc_check": "pass", "address_postal_code_check": "pass" }, "funding": "credit", "exp_month": 11, "exp_year": 2033 }, "isActive": true, "createdAt": "2025-11-07T19:16:38.469Z", "updatedAt": "2025-11-07T19:16:38.469Z", "_owner": "f7103b85-fcda-4dec-92c6-c336f71fd3a2" } ] ``` In each payment method object, the following fields are useful for displaying to the user: ```js for (const method of paymentMethods) { const brand = method.cardInfo.brand; // use brand for displaying VISA/MASTERCARD icons const paymentMethodId = method.paymentMethodId; // send this when initiating the payment flow const cardHolderName = method.cardHolderName; // show in list const number = `**** **** **** ${method.cardInfo.last4}`; // masked card number const expDate = `${method.cardInfo.exp_month}/${method.cardInfo.exp_year}`; // expiry date const id = method.id; // internal DB record ID, used for deletion const customerId = method.customerId; // Stripe customer reference } ``` If the list is empty, prompt the user to **add a new payment method**. ### Creating a Payment Method The payment page (or user profile page) should allow users to add a new payment method (credit card). Creating a Payment Method is a secure operation handled **entirely through Stripe.js** on the frontend — the backend never handles sensitive card data. After a card is successfully created, the backend only stores its reference (PaymentMethod ID) for reuse. Stripe provides multiple ways to collect card information, all through secure UI elements. Below is an example setup — refer to the latest Stripe documentation for alternative patterns. To initialize Stripe on the frontend, include your **public key**: ```html ``` ```js const stripe = Stripe("pk_test_51POkqt4.................."); const elements = stripe.elements(); const cardNumberElement = elements.create("cardNumber", { style: { base: { color: "#545454", fontSize: "16px" } }, }); cardNumberElement.mount("#card-number-element"); const cardExpiryElement = elements.create("cardExpiry", { style: { base: { color: "#545454", fontSize: "16px" } }, }); cardExpiryElement.mount("#card-expiry-element"); const cardCvcElement = elements.create("cardCvc", { style: { base: { color: "#545454", fontSize: "16px" } }, }); cardCvcElement.mount("#card-cvc-element"); // Note: cardholder name and ZIP code are collected via non-Stripe inputs (not secure). ``` You can dynamically show the card brand while typing: ```js cardNumberElement.on("change", (event) => { const cardBrand = event.brand; const cardNumberDiv = document.getElementById("card-number-element"); cardNumberDiv.style.backgroundImage = getBrandImageUrl(cardBrand); }); ``` Once the user completes the card form, create the Payment Method on Stripe. Note that the expiry and CVC fields are securely handled by Stripe.js and are never readable from your code. ```js const { paymentMethod, error } = await stripe.createPaymentMethod({ type: "card", card: cardNumberElement, billing_details: { name: cardholderName.value, address: { postal_code: cardholderZip.value }, }, }); ``` When a `paymentMethod` is successfully created, send its ID to your backend to attach it to the logged-in user’s account. Use the **system API** (unversioned): `POST /payment-methods/add` **Example:** ```js const response = await fetch("$serviceUrl/payment-methods/add", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ paymentMethodId: paymentMethod.id }), }); ``` When `addPaymentMethod` is called, the backend retrieves or creates the user’s Stripe Customer ID, attaches the Payment Method to that customer, and stores the reference in the local database for future use. Example response: ```json { "isActive": true, "cardHolderName": "John Doe", "userId": "f7103b85-fcda-4dec-92c6-c336f71fd3a2", "customerId": "cus_TNgWUw5QkmUPLa", "paymentMethodId": "pm_1SQw5aP5uUv56CseDGzT1dzP", "platform": "stripe", "cardHolderZip": "34662", "cardInfo": { "brand": "visa", "last4": "4242", "funding": "credit", "exp_month": 11, "exp_year": 2033 }, "id": "19a5ff70-4986-4760-8fc4-6b591bd6bbbf", "createdAt": "2025-11-07T20:16:55.451Z", "updatedAt": "2025-11-07T20:16:55.451Z" } ``` You can append this new entry directly to the UI list or refresh the list using the `listPaymentMethods` API. ### Deleting a Payment Method To remove a saved payment method from the current user’s account, call the **system API** (unversioned): `DELETE /payment-methods/delete/:paymentMethodId` **Example:** ```js await fetch( `$serviceUrl/payment-methods/delete/${paymentMethodId}`, { method: "DELETE", headers: { "Content-Type": "application/json" }, } ); ``` ## Starting the Payment Flow in Backend — Creation and Confirmation of the PaymentIntent Object The payment flow is initiated in the backend through the `startPremiumsubscriptionPayment` API. This API must be called with one of the user’s existing payment methods. Therefore, ensure that the frontend **forces the user to select a payment method** before initiating the payment. The `startPremiumsubscriptionPayment` API is a versioned **Business Logic API** and follows the same structure as other business APIs. In the Linkedin application, the payment flow starts by creating a **Stripe PaymentIntent** and confirming it in a single step within the backend. In a typical (“happy”) path, when the `startPremiumsubscriptionPayment` API is called, the response will include a successful or failed PaymentIntent result inside the `paymentResult` object, along with the `premiumsubscription` object. However, in certain edge cases—such as when 3D Secure (3DS) or other bank-level authentication is required—the confirmation step cannot complete immediately. In such cases, control should return to a frontend page to allow the user to finish the process. To enable this, a **`return_url`** must be provided during the PaymentIntent creation step. Although technically optional, it is **strongly recommended** to include a `return_url`. This ensures that the frontend payment result page can display both successful and failed payments and complete flows that require user interaction. The `return_url` must be a **frontend URL**. The `paymentUserParams` parameter of the `startPremiumsubscriptionPayment` API contains the data necessary to create the Stripe PaymentIntent. Call the API as follows: ```js const response = await fetch( `$serviceUrl/v1/startpremiumsubscriptionpayment/${orderId}`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ paymentUserParams: { paymentMethodId, return_url: `${yourFrontendReturnUrl}`, }, }), } ); ```` The API response will contain a `paymentResult` object. If an error occurs, it will begin with `{ "result": "ERR" }`. Otherwise, it will include the PaymentIntent information: ```json { "paymentResult": { "success": true, "paymentTicketId": "19a60f8f-eeff-43a2-9954-58b18839e1da", "orderId": "19a60f84-56ee-40c4-b9c1-392f83877838", "paymentId": "pi_3SR0UHP5uUv56Cse1kwQWCK8", "paymentStatus": "succeeded", "paymentIntentInfo": { "paymentIntentId": "pi_3SR0UHP5uUv56Cse1kwQWCK8", "clientSecret": "pi_3SR0UHP5uUv56Cse1kwQWCK8_secret_PTc3DriD0YU5Th4isBepvDWdg", "publicKey": "pk_test_51POkqWP5uU", "status": "succeeded" }, "statusLiteral": "success", "amount": 10, "currency": "USD", "description": "Your credit card is charged for babilOrder for 10", "metadata": { "order": "Purchase-Purchase-order", "orderId": "19a60f84-56ee-40c4-b9c1-392f83877838", "checkoutName": "babilOrder" }, "paymentUserParams": { "paymentMethodId": "pm_1SQw5aP5uUv56CseDGzT1dzP", "return_url": "${yourFrontendReturnUrl}" } } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ## Analyzing the API Response After calling the `startPremiumsubscriptionPayment` API, the most common expected outcome is a confirmed and completed payment. However, several alternate cases should be handled on the frontend. ### System Error Case The API may return a classic service-level error (unrelated to payment). Check the HTTP status code of the response. It should be `200` or `201`. Any `400`, `401`, `403`, or `404` indicates a system error. ```json { "result": "ERR", "status": 404, "message": "Record not found", "date": "2025-11-08T00:57:54.820Z" } ``` **Handle system errors on the payment page** (show a retry option). Do not navigate to the result page. ### Payment Error Case The API performs both database operations and the Stripe payment operation. If the payment fails but the service logic succeeds, the API may still return a `200 OK` status, with the failure recorded in the `paymentResult`. In this case, show an error message and allow the user to retry. ```json { "status": "OK", "statusCode": "200", "premiumsubscription": { "id": "19a60f8f-eeff-43a2-9954-58b18839e1da", "status": "failed" }, "paymentResult": { "result": "ERR", "status": 500, "message": "Stripe error message: Your card number is incorrect.", "errCode": "invalid_number", "date": "2025-11-08T00:57:54.820Z" } } ``` **Payment errors should be handled on the payment page** (retry option). Do not go to the result page. --- ### Happy Case When both the service and payment result succeed, this is considered the *happy path*. In this case, use the `premiumsubscription` and `paymentResult` objects in the response to display a success message to the user. `amount` and `description` values are included to help you show payment details on the result page. ```json { "status": "OK", "statusCode": "200", "order": { "id": "19a60f8f-eeff-43a2-9954-58b18839e1da", "status": "paid" }, "paymentResult": { "success": true, "paymentStatus": "succeeded", "paymentIntentInfo": { "status": "succeeded" }, "amount": 10, "currency": "USD", "description": "Your credit card is charged for babilOrder for 10" } } ``` To verify success: ```js if (paymentResult.paymentIntentInfo.status === "succeeded") { // Redirect to result page } ``` > Note: A successful result does not trigger fulfillment immediately. > Fulfillment begins only after the Stripe webhook updates the database. > It’s recommended to show a short “success” toast, wait a few milliseconds, and then navigate to the result page. **Handle the happy case in the result page** by sending the `premiumsubscriptionId` and the payment intent secret. ```js const orderId = new URLSearchParams(window.location.search).get("orderId"); const url = new URL(`$yourResultPageUrl`, location.origin); url.searchParams.set("orderId", orderId); url.searchParams.set("payment_intent_client_secret", currentPaymentIntent.clientSecret); setTimeout(() => { window.location.href = url.toString(); }, 600); ``` --- ### Edge Cases Although `startPremiumsubscriptionPayment` is designed to handle both creation and confirmation in one step, Stripe may return an incomplete result if third-party authentication or redirect steps are required. You must handle these cases in **both the payment page and the result page**, because some next actions are available immediately, while others occur only after a redirect. If the `paymentIntentInfo.status` equals `"requires_action"`, handle it using Stripe.js as shown below: ```js if (paymentResult.paymentIntentInfo.status === "requires_action") { await runNextAction( paymentResult.paymentIntentInfo.clientSecret, paymentResult.paymentIntentInfo.publicKey ); } ``` Helper function: ```js async function runNextAction(clientSecret, publicKey) { const stripe = Stripe(publicKey); const { error } = await stripe.handleNextAction({ clientSecret }); if (error) { console.log("next_action error:", error); showToast(error.code + ": " + error.message, "fa-circle-xmark text-red-500"); throw new Error(error.message); } } ``` After handling the next action, re-fetch the PaymentIntent from Stripe, evaluate its status, show appropriate feedback, and navigate to the result page. ```js const { paymentIntent } = await stripe.retrievePaymentIntent(clientSecret); if (paymentIntent.status === "succeeded") { showToast("Payment successful!", "fa-circle-check text-green-500"); } else if (paymentIntent.status === "processing") { showToast("Payment is processing…", "fa-circle-info text-blue-500"); } else if (paymentIntent.status === "requires_payment_method") { showToast("Payment failed. Try another card.", "fa-circle-xmark text-red-500"); } const orderId = new URLSearchParams(window.location.search).get("orderId"); const url = new URL(`$yourResultPageUrl`, location.origin); url.searchParams.set("orderId", orderId); url.searchParams.set("payment_intent_client_secret", currentPaymentIntent.clientSecret); setTimeout(() => { window.location.href = url.toString(); }, 600); ``` --- ## The Result Page The payment result page should handle the following steps: 1. Read `orderId` and `payment_intent_client_secret` from the query parameters. 2. Retrieve the PaymentIntent from Stripe and check its status. 3. If required, handle any `next_action` and re-fetch the PaymentIntent. 4. If the status is `"succeeded"`, display a clear visual confirmation. 5. Fetch the `premiumsubscription` instance from the backend to display any additional order or fulfillment details. Note that paymentIntent status only gives information about the Stripe side. The `premiumsubscription` instance in the service should also ve updated to start the fulfillment. In most cases, the `startpremiumsubscriptionPayment` api updates the status of the order using the response of the paymentIntent confirmation, but as stated above in some cases this update can be done only when the webhook executes. So in teh result page always get the final payment status in the `premiumsubscription. To ensure that service i To fetch the `premiumsubscription` instance, you van use the related api which is given before, and to ensure that the service is updated with the latest status read the _paymentConfirmation field of the `premiumsubscription` instance. ```js if (premiumsubscription._paymentConfirmation == "canceled") { // the payment is canceled, user can be informed that they should try again } if (premiumsubscription._paymentConfirmation == "paid") { // service knows that payment is done, user can be informed that fullfillment started } else { // it may be pending, processing // Fetch the object again until a canceled or paid status } ``` # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 2 - Verification Management** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document includes the verification processes for the autheitcation flow. Please read it carefully and implement all requirements described here. The project has 1 auth service, 1 notification service, 1 BFF service, and 6 business services, plus other helper services such as bucket and realtime. In this document you will be informed only about the auth service. Each service is a separate microservice application and listens for HTTP requests at different service URLs. Services may be deployed to the preview server, staging server, or production server. Therefore, each service has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the home page. ## Accessing the backend Each backend service has its own URL for each deployment environment. Users may want to test the frontend in one of the three deployments—preview, staging, or production. Please ensure that the home page includes a deployment server selection option so that, as the frontend coding agent, you can set the base URL for all services. For the auth service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` Any request that requires login must include a valid token in the Bearer authorization header. ## After User Registration Frontend should also be aware of verification after any login attempt. The login request may return a 401 or 403 with the error codes that indicates the verification needs. ```json { //... "errCode": "EmailVerificationNeeded", // or "errCode": "MobileVerificationNeeded", } ``` ## Email Verification In the registration response, check the `emailVerificationNeeded` property in the response root. If it is `true`, start the email verification flow. After the login process, if you receive an HTTP error and the response contains an `errCode` with the value `EmailVerificationNeeded`, start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user’s email. The backend will send a secret code to the provided email address. **The backend can send the email if the architect has configured a real mail service or SMTP server. During development, the backend also returns the secret code to the frontend. You can read this code from the `secretCode` property of the response.** 2. The secret code in the email will be a 6-digit code. Provide an input page so the user can paste this code into the frontend application. Navigate to this input page after starting the verification process. **If the `secretCode` is sent to the frontend for testing, display it on the input page so the user can copy and paste it.** 3. The `start` response includes a `codeIndex` property. Display its value on the input page so the user can match the index in the message with the one on the screen. 4. When the user submits the code, complete the email verification using the `complete` route of the backend (described below) with the user’s email and the secret code. 5. After a successful email verification response, please check the response object to have the property 'mobileVerificationNeeded' as `true`, if so navigate to the mobile verification flow as described below. **If no mobile verification is needed then just navigate the login page.** Below are the `start` and `complete` routes for email verification. These are system routes and therefore are not versioned. #### `POST /verification-services/email-verification/start` **Purpose:** Starts email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid" } ``` > ⚠️ In production, `secretCode` is **not** returned — it is only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid" } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Mobile Verification In the registration response, check the `mobileVerificationNeeded` property in the response root. If it is `true`, start the mobile verification flow. After the login process, if you receive a 403 error and the response contains an `errCode` with the value `MobileVerificationNeeded`, start the mobile verification flow. 1. Call the mobile verification `start` route of the backend (described below) with the user’s email. The backend will send a secret code to the user’s mobile number. **If a real texting service is configured, the backend sends the SMS. During development, the backend also returns the secret code to the frontend in the `secretCode` property.** 2. The secret code in the SMS will be a 6-digit code. Provide an input page so the user can paste this code. Navigate to this input page after starting the verification process. **If the `secretCode` is returned for testing, display it on the input page for easy copy/paste.** 3. When the user submits the code, complete mobile verification using the `complete` route of the backend (described below) with the user’s email and the secret code. 4. The `start` response includes a `codeIndex` property. Display its value on the input page so the user can match the index shown in the message with the one on the screen. 5. After a successful mobile verification response, navigate to the login page. **Verification Order** If both `emailVerificationNeeded` and `mobileVerificationNeeded` are `true`, handle both verification flows in order. First complete email verification, then mobile verification. Below are the `start` and `complete` routes for mobile verification. These are system routes and therefore are not versioned. #### `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid" } ``` > ⚠️ `secretCode` is returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- #### `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid" } ``` --- ## Resetting Password Users can reset their forgotten passwords without a login required, through email and mobile verification. To be able to start a password reset flow, users will click on the "Reset Password" link in the login page. Since there are two verification methods, by email or by mobile, for password reset, when the reset password link is clicked, frontend should ask user if they want to make the verification through email of mobile. According to the users selection the frontend shoudl start the related flow as explaned below step by step. ## Password Reset By Email Flow 1. Call the password reset by email verification `start` route of the backend (described below) with the user’s email. The backend will send a secret code to the provided email address. **The backend can send the email if the architect has configured a real mail service or SMTP server. During development, the backend also returns the secret code to the frontend. You can read this code from the `secretCode` property of the response.** 2. The secret code in the email will be a 6-digit code. Provide an input page so the user can paste this code into the frontend application. Navigate to this input page after starting the verification process. **If the `secretCode` is sent to the frontend for testing, display it on the input page so the user can copy and paste it.** 3. The `start` response includes a `codeIndex` property. Display its value on the input page so the user can match the index in the message with the one on the screen. 4. The input page should also include a double input area for the user to enter and confirm their new password. 5. When the user submits the code and the new password, complete the password reset by email using the `complete` route of the backend (described below) with the user’s email , the secret code and new password. 6. After a successful verification response, navigate to the login page. Below are the `start` and `complete` routes for password reset by email verification. These are system routes and therefore are not versioned. #### POST `/verification-services/password-reset-by-email/start` **Purpose**: Starts the password reset process by generating and sending a secret verification code. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|-------------------------------------| | email | String | Yes | The email address of the user | ```json { "email": "user@example.com" } ``` **Success Response** Returns secret code details (only in development environment) and confirmation that the verification step has been started. ```json { "userId": "user-uuid", "email": "user@example.com", "codeIndex": 1, "secretCode": "123456", "timeStamp": 1765484354, "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z", "verificationType": "byLink", } ``` ⚠️ In production, the secret code is only sent via email and not exposed in the API response. **Error Responses** - `401 NotAuthenticated`: Email address not found or not associated with a user. - `403 Forbidden`: Sending a code too frequently (spam prevention). --- #### POST `/verification-services/password-reset-by-email/complete` **Purpose**: Completes the password reset process by validating the secret code and updating the user's password. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|----------------------------------------------| | email | String | Yes | The email address of the user | | secretCode | String | Yes | The code received via email | | password | String | Yes | The new password the user wants to set | ```json { "email": "user@example.com", "secretCode": "123456", "password": "newSecurePassword123" } ``` **Success Response** ```json { "userId": "user-uuid", "email": "user@example.com", "isVerified": true } ``` **Error Responses** - `403 Forbidden`: - Secret code mismatch - Secret code expired - No ongoing verification found --- ## Password Reset By Mobile Flow 1. Call the password reset by mobile verification `start` route of the backend (described below) with the user’s email. The backend will send a secret code to the user’s mobile number. **If a real texting service is configured, the backend sends the SMS. During development, the backend also returns the secret code to the frontend in the `secretCode` property.** 2. The secret code in the SMS will be a 6-digit code. Provide an input page so the user can paste this code. Navigate to this input page after starting the verification process. **If the `secretCode` is returned for testing, display it on the input page for easy copy/paste.** 3. The `start` response includes a `codeIndex` property. Display its value on the input page so the user can match the index in the message with the one on the screen. Also display the half masked `mobile`number that comes in the response, to tell the user that their code is sent to this number. 4. The input page should also include a double input area for the user to enter and confirm their new password. 5. When the user submits the code, complete mobile verification using the `complete` route of the backend (described below) with the user’s email and the secret code. 6. After a successful mobile verification response, navigate to the login page. Below are the `start` and `complete` routes for password reset by mobile verification. These are system routes and therefore are not versioned. #### POST `/verification-services/password-reset-by-mobile/start` **Purpose**: Initiates the mobile-based password reset by sending a verification code to the user's mobile. #### Request Body | Parameter | Type | Required | Description | |-----------|--------|----------|------------------------------| | email | String | Yes | The email of the user that resets the pssword | ```json { "email": "user@user.com" } ``` ### Success Response Returns the verification context (code returned only in development): ```json { "status": "OK", "codeIndex": 1, timeStamp: 133241255, "mobile": "+905.....67", "secretCode": "123456", "expireTime": 86400, "date": "2024-04-29T10:00:00.000Z", verificationType: "byLink" } ``` ⚠️ In production, the `secretCode` is not included in the response and is only sent via SMS. ### Error Responses - **400 Bad Request**: Mobile already verified - **403 Forbidden**: Rate-limited (code already sent recently) - **404 Not Found**: User with provided mobile not found --- #### POST `/verification-services/password-reset-by-mobile/complete` **Purpose**: Finalizes the password reset process by validating the received verification code and updating the user’s password. #### Request Body | Parameter | Type | Required | Description | |-------------|--------|----------|-------------------------------------------------| | email | String | Yes | The email address of the user | | secretCode | String | Yes | The code received via SMS | | password | String | Yes | The new password to assign | ```json { "email": "user@example.com", "secretCode": "123456", "password": "NewSecurePassword123!" } ``` ### Success Response ```json { "userId": "user-uuid", "isVerified": true } ``` --- ** Please dont forget to arrange the code to be able to navigate to the verification pages both after registrations and login attempts if verification is needed.** **After this prompt, the user may give you new instructions to update your first output or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 3 - Profile Management** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document includes information and api descriptions about building a **profile page** in the frontend using the auth service profile api calls, and also in this document the bucket service will be introduced to manage the avatar. The project has 1 auth service, 1 notification service, 1 BFF service, and 6 business services, plus other helper services such as bucket and realtime. In this document you will use the auth service and bucket service. Each service is a separate microservice application and listens for HTTP requests at different service URLs. Services may be deployed to the preview server, staging server, or production server. Therefore, each service has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the home page. ## Accessing the backend Each backend service has its own URL for each deployment environment. Users may want to test the frontend in one of the three deployments—preview, staging, or production. Please ensure that the register and login pages include a deployment server selection option so that, as the frontend coding agent, you can set the base URL for all services. The base URL of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service, service urls are as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service URL will be given in the service sections. Any request that requires login must include a valid token in the Bearer authorization header. ## Bucket Management This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. To access the bucket service in each environement use the bucket service api urls below: * **Preview:** `https://linkedin.prw.mindbricks.com/bucket` * **Staging:** `https://linkedin-stage.mindbricks.co/bucket` * **Production:** `https://linkedin.mindbricks.co/bucket` **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {bucketServiceUrl}/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## Profile Page Design a profile page to manage (view and edit) user information. The profile page should also be able to upload the user avatar to the user’s public bucket. For bucket information, see the Bucket Management section above. On the profile page, you will need 4 business APIs: `getUser` , `updateProfile`, `updateUserPassword` and `archiveProfile`. Do not rely on the `/currentuser` response for profile data, because it contains session information. The most recent user data is in the user database and should be accessed via the `getUser` business API. The `updateProfile`, `updateUserPassword` and `archiveProfile` api can only be called by the users themselves. They are designed specific to the profile page. The avatar upload component should include an image-cropping component with zoom and pan capabilities. The frontend will send the image to the bucket after it is scaled and cropped. Do not implement your own cropping component; instead, use the library component `react-easy-crop` by installing it. **Note that the user cannot change/update their `email` or `roleId`.** For password update you should make a separate block in the UI, so that user can enter old password, new password and confirm new password before calling the `updateUserPassword`. Here are the 3 auth APIs—`getUser` , `updateProfile` and `updateUserPassword`— as follows: You can access these APIs through the auth service base URL, `{appUrl}/auth-api`. ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### Archiving A Profile A user may want to archive their profile. So the profile page should include an archive section for the users to archive their accounts. When an account is archived, it is marked as archived and an aarchiveDate is atteched to the profile. All user data is kept in the database for 1 month after user archived. If user tries to login or register with the same email, the account will be activated again. But if no login or register occures in 1 month after archiving, the profile and its related data will be deleted permanenetly. So in the profile page, 1. The arcihve options should be accepted after user writes a text like ("ARCHİVE MY ACCOUNT") to a confirmation dialog, so that frontend UX can ensure this is not an unconscious request. 2. The user should be warned about the process, that his account will be available for a restore for 1 month. The archive api, can only be called by the users themselves and its used as follows. ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` --- After you complete this step, please ensure you have not made the following common mistakes: 1. The auth API and bucket API are different services, and both URLs should be set according to the selected environment (production, staging, preview). 2. Note that any api call to the application backend is based on a service base url, in this propmpt all auth apis should be called by `/auth-api` prefix after application's base url, and bucket apis should be called by `/bucket` prefix after base url. 3. The auth API and bucket API use different tokens. The auth API requires the `accessToken` in the Bearer header; the bucket API requires bucket-specific tokens such as `userBucketToken` or other application-specific bucket tokens. You may need two separate Axios clients: one for auth (always using the access token) and one for bucket operations (using the relevant bucket token). 4. On the profile page, fetch the latest user data from the service using `getUser`. The `/currentuser` API is session-stored data; the latest data is in the database. 5. When you upload the avatar image on the profile page, use the returned download URL as the user’s `avatar` property and update the user record when the Save button is clicked. **After this prompt, the user may give you new instructions to update your first output or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 4 - User Management** This document is the 2nd part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for administrative user management. ## Service Access User management is handled through auth service again. Auth service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the auth service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` Please note that any feature in this document is open to admins only. When the user logins, the response includes a roleId field. This roleId should one of these following admin roles. `superAdmin`, `admin`, ## Scope Auth service provides following feature for user management in linkedin application. These features are already handled in the previous part. 1. User Registration 2. User Authentication 3. Password Reset 3. Email (and/or) Mobile Verification 4. Profile Management These features will be handled in this part. - User Management - User Groups Management - Permission Manageemnt ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## User Management User management will be one of the main parts of the administrative manageemnts, so there will be a minimal but fancy `users` page in the admin dashboard. ### User Roles - `superadmin` : The first creator of the backend, the owner of the application, root user, has got an absolute authroization on all actions. It can not be assgined any other user. It can't be unassigned. Super admin user can not be deleted in any way. - `admin` : The role that can be assigned to any user by the super admin. This role includes most permissions that super admin have, but admins can't assign admin roles, can't unassign an admin role, can't delete other users who have admin role. In addition to these limitations, some critical actions in the business services may also be open to only super admin. - `user` : The standard role that is assgined to every user when first created or registered. This role doesnt have any privilages and can access to their own data or public data. The roles object is a hardcoded object in the generated code, and it contains the following roles: ```json { "superAdmin": "'superAdmin'", "admin": "'admin'", "user": "'user'" } ``` Each user may have only one role, and it is given in `/login` , `/currentuser` or `/users/:userId` response as follows ```json { // ... "roleId":"superAdmin", // ... } ``` ## Listing Users You can list users using the `listUsers` api. ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Searching Users You may search users with their full names and emails. The search is done in elasticsearch index of the user table so a fast response is provided by the backend. You can send search request on each character update in the search box but start searching after 3 chars. The keyword parameter that is used in the business logic of the api, is read from the keyword query parameter. eg: `GET /v1/searchusers?keyword=Joe` When the user deletes the search keyword, use the `listUsers` api to get the full list again. ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` #### Pagination When you list the users please use pagination. To be able to use pagination you should provide a `pageNumber` paramater in the query. The default row count for one page is 25, add an option for user to change it to 50 or 100. You can provide this value to the api through the `pageRowCount` parameter; `GET /users?pageNumber=1&pageRowCount=50` ## Creatng Users The user management console in the admin dashboard should provide UX components for user creating by admins. When creating users, it should also be possible to upload user avatar. Note that when creating, updating users , admins can not set emailVerified (or mobileVerified if exists) as true, since it is a logical mechanism and should be verified only through verification processes. ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### Avatar Upload Normally when user registers by his own, the avatar is uploaded to the logged in user's public bucket, however in this user admin panel, if any avatar upload is needed, it should be uploaded to the application public bucket. To access this application bucket, the `applicationBucketToken` should be used in the bearer header, and the bucketId in the payload should be given as `"linkedin-public-common-bucket"` . Before the avatar upload, a specific componenet from `react-easy-crop` lib should be used for zoom, pan and crop. This component also requested in the PART 1 prompt for profile page, so ensure taht you reuse the previous code if exists. ## Updating Users User update is possible by `updateUser`api. However since this update api is also called by teh user themselves it is lmited with name and avatar change (or any other user related property). For roleId and password updates seperate apis are used. So arrange the user update UI as to update the user info, as to set roleId and as to update password. ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` For role updates there are some rules. 1. Superadmin role can not be unassigned even by superadmin. 2. Admin roles can be assgined or unassgined only by superadmin. 3. All other roles can be assigned and unassgined by admins and superadmin. For password updates there are some rules. 1. Superadmin and admin passwords can be updated only by superadmin. 2. Admins can update only non-admin passwords. ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### Deleting Users Deleting users is possible in certain conditions. 1. SuperAdmin can not be deleted. 2. Admins can be deleted by only superadmin. 3. Users can be deleted by admins or superadmin. ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` --- When you list user group members, a `user` object will also be inserted in each userGroupMember object, with fullname, avatar and email. ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 5 - JobApplication Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of jobApplication ## Service Access JobApplication service management is handled through service specific base urls. JobApplication service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the jobApplication service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ## Scope **JobApplication Service Description** Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. JobApplication service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`jobPosting` Data Object**: Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **`jobApplication` Data Object**: Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## JobPosting Data Object Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. ### JobPosting Data Object Properties JobPosting data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `description` | Text | false | Yes | Detailed description of the job posting. | | `title` | String | false | Yes | Job title/position name. | | `applicationDeadline` | Date | false | No | Last date for accepting applications. Checked during apply. | | `companyId` | ID | false | No | Company offering the job. FK to company:company | | `employmentType` | Enum | false | Yes | Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). | | `postedByUserId` | ID | false | Yes | User (admin/recruiter) who posted the job. FK to auth:user; used for ownership. | | `salaryRange` | String | false | No | Human-readable salary range (free-form for v1; can be refined later). | | `location` | String | false | No | Primary job location (city, country, etc.) | | `visibility` | Enum | false | Yes | Controls who can see/apply to this job: public (all) or private (admins only). | | `workplaceType` | Enum | false | Yes | Workplace type (on-site,remote,hybrid). | | `status` | Enum | false | Yes | status : active or closed | | `companyName` | String | false | Yes | company name | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **employmentType**: [full_time, part_time, contract, internship, volunteer, other, temporary] - **visibility**: [public, private] - **workplaceType**: [on_site, remote, hybrid] - **status**: [active, closed] ### Relation Properties `companyId` `postedByUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **postedByUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `title` `applicationDeadline` `companyId` `employmentType` `postedByUserId` `location` `visibility` `workplaceType` `status` `companyName` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **title**: String has a filter named `title` - **applicationDeadline**: Date has a filter named `applicationDeadline` - **companyId**: ID has a filter named `companyId` - **employmentType**: Enum has a filter named `employmentType` - **postedByUserId**: ID has a filter named `postedByUserId` - **location**: String has a filter named `location` - **visibility**: Enum has a filter named `visibility` - **workplaceType**: Enum has a filter named `workplaceType` - **status**: Enum has a filter named `status` - **companyName**: String has a filter named `companyName` ## JobApplication Data Object Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Data Object Properties JobApplication data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `jobPostingId` | ID | false | Yes | FK to jobPosting: job applied for. | | `applicantUserId` | ID | false | Yes | User who submitted the application. FK to auth:user.id; used for ownership. | | `coverLetter` | Text | false | No | User's (optional) cover letter/body with application. | | `resumeUrl` | String | false | No | URL/path to user resume/doc to share with recruiter/admin. User-provided. | | `lastStatusUpdateAt` | Date | false | Yes | Timestamp of latest status change (set when status is updated). | | `status` | Enum | false | Yes | Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. | | `appliedAt` | Date | false | Yes | Timestamp when application was submitted. Set automatically on create. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **status**: [submitted, in_review, accepted, rejected] ### Relation Properties `jobPostingId` `applicantUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **jobPostingId**: ID Relation to `jobPosting`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **applicantUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `jobPostingId` `applicantUserId` `lastStatusUpdateAt` `status` `appliedAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **jobPostingId**: ID has a filter named `jobPostingId` - **applicantUserId**: ID has a filter named `applicantUserId` - **lastStatusUpdateAt**: Date has a filter named `lastStatusUpdateAt` - **status**: Enum has a filter named `status` - **appliedAt**: Date has a filter named `appliedAt` ## API Reference ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 6 - Networking Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of networking ## Service Access Networking service management is handled through service specific base urls. Networking service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the networking service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ## Scope **Networking Service Description** Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... Networking service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`connection` Data Object**: Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **`connectionRequest` Data Object**: Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## Connection Data Object Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. ### Connection Data Object Properties Connection data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `connectedSince` | Date | false | Yes | Timestamp when connection was established. | | `userId1` | ID | false | Yes | FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. | | `userId2` | ID | false | Yes | FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Relation Properties `userId1` `userId2` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **userId1**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **userId2**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ## ConnectionRequest Data Object Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### ConnectionRequest Data Object Properties ConnectionRequest data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `receiverUserId` | ID | false | Yes | FK to auth:user.id — target of the request. | | `senderUserId` | ID | false | Yes | FK to auth:user.id — user sending the connection request. | | `sentAt` | Date | false | Yes | Timestamp when request was sent. | | `status` | Enum | false | Yes | Request status: pending/accepted/rejected. | | `respondedAt` | Date | false | No | Timestamp when receiver accepted/rejected. | | `message` | String | false | No | Optional introductory message from sender to receiver. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **status**: [pending, accepted, rejected] ### Relation Properties `receiverUserId` `senderUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **receiverUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **senderUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `status` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **status**: Enum has a filter named `status` ## API Reference ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 7 - Company Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of company ## Service Access Company service management is handled through service specific base urls. Company service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the company service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ## Scope **Company Service Description** Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. Company service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`companyFollower` Data Object**: Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **`companyUpdate` Data Object**: A post/news update created by company admin and visible to followers depending on visibility. **`company` Data Object**: Represents a company profile and brand presence/pages on the network. **`companyAdmin` Data Object**: Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## CompanyFollower Data Object Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. ### CompanyFollower Data Object Properties CompanyFollower data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `userId` | ID | false | Yes | FK to auth:user who follows the company. | | `companyId` | ID | false | Yes | FK to company:company being followed. | | `followedAt` | Date | false | Yes | Timestamp when user followed company. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Relation Properties `userId` `companyId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **userId**: ID has a filter named `userId` ## CompanyUpdate Data Object A post/news update created by company admin and visible to followers depending on visibility. ### CompanyUpdate Data Object Properties CompanyUpdate data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `companyId` | ID | false | Yes | FK to company whose update this is. | | `content` | Text | false | Yes | Body/content of the update/news item. | | `authorUserId` | ID | false | Yes | FK to auth:user who authored the update (must be active admin at time of post). | | `attachmentUrls` | String | true | No | Array of URLs for update attachments (files, images, links). | | `visibility` | Enum | false | Yes | Update visibility: public (all) or private (followers only). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Array Properties `attachmentUrls` Array properties can hold multiple values. Array properties should be respected according to their multiple structure in the frontend in any user input for them. Please use multiple input components for the array proeprties when needed. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **visibility**: [public, private] ### Relation Properties `companyId` `authorUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `visibility` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **visibility**: Enum has a filter named `visibility` ## Company Data Object Represents a company profile and brand presence/pages on the network. ### Company Data Object Properties Company data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `name` | String | false | Yes | Company brand name. Displayed and searchable. Unique per company. | | `website` | String | false | No | Official company website link. | | `location` | String | false | No | Company HQ/main location string (e.g. city, country). | | `logoUrl` | String | false | No | Uploaded image URL for company logo/branding. | | `pageVisibility` | Enum | false | Yes | Visibility of the company page (public/private). | | `createdByUserId` | ID | false | Yes | - | | `description` | Text | false | No | Company description / about section. | | `industry` | String | false | No | Industry sector or market. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **pageVisibility**: [public, private] ### Filter Properties `name` `location` `pageVisibility` `industry` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **name**: String has a filter named `name` - **location**: String has a filter named `location` - **pageVisibility**: Enum has a filter named `pageVisibility` - **industry**: String has a filter named `industry` ## CompanyAdmin Data Object Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### CompanyAdmin Data Object Properties CompanyAdmin data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `assignedAt` | Date | false | Yes | Timestamp when admin assigned. | | `userId` | ID | false | Yes | FK to auth:user who is admin of this company. | | `companyId` | ID | false | Yes | FK to company. | | `assignedBy` | ID | false | Yes | User who assigned this admin (for audit). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Relation Properties `userId` `companyId` `assignedBy` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **assignedBy**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: No ### Filter Properties `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **userId**: ID has a filter named `userId` ## API Reference ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 8 - Content Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of content ## Service Access Content service management is handled through service specific base urls. Content service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the content service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ## Scope **Content Service Description** Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. Content service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`post` Data Object**: A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **`like` Data Object**: A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **`comment` Data Object**: A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## Post Data Object A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. ### Post Data Object Properties Post data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `content` | Text | false | Yes | Main post content/body text | | `companyId` | ID | false | No | Optional. FK to company:company - if set, post is from company context (by admin). | | `authorUserId` | ID | false | Yes | FK to auth:user - the user who created the post. Required. | | `visibility` | Enum | false | Yes | Post-level visibility: public or private. | | `attachmentUrls` | String | true | No | Array of attachment URLs (e.g. images, docs, links). Optional. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Array Properties `attachmentUrls` Array properties can hold multiple values. Array properties should be respected according to their multiple structure in the frontend in any user input for them. Please use multiple input components for the array proeprties when needed. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an additional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the {fieldName_idx} property to sort by the enum value or when your enum options represent a hiyerarchy of values. In the frontend input components, enum type properties should only accept values from an option component that lists the enum options. - **visibility**: [public, private] ### Relation Properties `companyId` `authorUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: No - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `companyId` `authorUserId` `visibility` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **companyId**: ID has a filter named `companyId` - **authorUserId**: ID has a filter named `authorUserId` - **visibility**: Enum has a filter named `visibility` ## Like Data Object A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. ### Like Data Object Properties Like data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `likedAt` | Date | false | Yes | Timestamp when the like was made. | | `postId` | ID | false | Yes | FK to content:post - the post that was liked. Required. | | `userId` | ID | false | Yes | FK to auth:user - owner of the like entry (who liked). Required. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Relation Properties `postId` `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **postId**: ID Relation to `post`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `postId` `userId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **postId**: ID has a filter named `postId` - **userId**: ID has a filter named `userId` ## Comment Data Object A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Comment Data Object Properties Comment data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `authorUserId` | ID | false | Yes | FK to auth:user - user who authored comment. | | `postId` | ID | false | Yes | FK to content:post - the post this comment is for. Required. | | `content` | Text | false | Yes | Comment body/content. | | `parentCommentId` | ID | false | No | Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Relation Properties `authorUserId` `postId` `parentCommentId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **authorUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **postId**: ID Relation to `post`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **parentCommentId**: ID Relation to `comment`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: No ### Filter Properties `postId` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **postId**: ID has a filter named `postId` ## API Reference ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # **LINKEDIN** **FRONTEND GUIDE FOR AI CODING AGENTS - PART 9 - Messaging Service** This document is a part of a REST API guide for the linkedin project. It is designed for AI agents that will generate frontend code to consume the project’s backend. This document provides extensive instruction for the usage of messaging ## Service Access Messaging service management is handled through service specific base urls. Messaging service may be deployed to the preview server, staging server, or production server. Therefore,it has 3 access URLs. The frontend application must support all deployment environments during development, and the user should be able to select the target API server on the login page (already handled in first part.). For the messaging service, the base URLs are: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ## Scope **Messaging Service Description** Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. Messaging service provides apis and business logic for following data objects in linkedin application. Each data object may be either a central domain of the application data structure or a related helper data object for a central concept. Note that data object concept is equal to table concept in the database, in the service database each data object is represented as a db table scheme and the object instances as table rows. **`message` Data Object**: Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **`conversation` Data Object**: Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ## API Structure ### Object Structure of a Successful Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope includes the data and essential metadata such as configuration details and pagination information, providing context to the client. **HTTP Status Codes:** * **200 OK**: Returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request was processed successfully. * **201 Created**: Returned for CREATE operations, indicating that the resource was created successfully. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling that the request executed successfully. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` * **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation. ### Additional Data Each API may include additional data besides the main data object, depending on the business logic of the API. These will be provided in each API’s response signature. ### Error Response If a request encounters an issue—whether due to a logical fault or a technical problem—the service responds with a standardized JSON error structure. The HTTP status code indicates the nature of the error, using commonly recognized codes for clarity: * **400 Bad Request**: The request was improperly formatted or contained invalid parameters. * **401 Unauthorized**: The request lacked a valid authentication token; login is required. * **403 Forbidden**: The current token does not grant access to the requested resource. * **404 Not Found**: The requested resource was not found on the server. * **500 Internal Server Error**: The server encountered an unexpected condition. Each error response is structured to provide meaningful insight into the problem, assisting in efficient diagnosis and resolution. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Bucket Management (This information is also given in PART 1 prompt.) This application has a bucket service used to store user files and other object-related files. The bucket service is login-agnostic, so for write operations or private reads, include a bucket token (provided by services) in the request’s Authorization header as a Bearer token. Please note that all other business services require the access token in the Bearer header, while the bucket service expects a bucket token because it is login-agnostic. Ensure you manage the required token injection properly; any auth interceptor should not replace the bucket token with the access token. **User Bucket** This bucket stores public user files for each user. When a user logs in—or in the `/currentuser` response—there is a `userBucketToken` to use when sending user-related public files to the bucket service. ```json { //... "userBucketToken": "e56d...." } ``` To upload a file `POST {baseUrl}/bucket/upload` The request body is form-data which includes the `bucketId` and the file binary in the `files` field. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on success, e.g., body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you need its `fileId`. If you upload an avatar or other asset, ensure the download URL or the `fileId` is stored in the backend. Buckets are mostly used in object creations that require an additional file, such as a product image or user avatar. After uploading your image to the bucket, insert the returned download URL into the related property of the target object record. **Application Bucket** This Linkedin application also includes a common public bucket that anyone can read, but only users with the `superAdmin`, `admin`, or `saasAdmin` roles can write (upload) to it. When a user with one of these admin roles is logged in, the `/login` response or the `/currentuser` response also returns an `applicationBucketToken` field, which is used when uploading any file to the application bucket. ```json { //... "applicationBucketToken": "e23fd...." } ``` The common public application bucket ID is `"linkedin-public-common-bucket"` In certain admin areas—such as product management pages—since the user already has the application bucket token, they will be able to upload related object images. Please configure your UI to upload files to the application bucket using this bucket token whenever needed. **Object Buckets** Some objects may also return a bucket token for uploading or accessing files related to that object. For example, in a project management application, when you fetch a project’s data, a public or private bucket token may be provided to upload or download project-related files. These buckets will be used as described in the relevant object definitions. ## Message Data Object Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. ### Message Data Object Properties Message data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `content` | Text | false | Yes | Raw message body/content. | | `senderUserId` | ID | false | Yes | auth:user.id of message sender. | | `deletedFor` | ID | true | No | Array of userIds who have deleted/hid this message (soft/hide). | | `readBy` | ID | true | No | Array of userIds who have read this message. Used for read receipts. | | `conversationId` | ID | false | Yes | Conversation this message belongs to (messaging:conversation). | | `sentAt` | Date | false | No | Timestamp when message is sent (defaults to now on create). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Array Properties `deletedFor` `readBy` Array properties can hold multiple values. Array properties should be respected according to their multiple structure in the frontend in any user input for them. Please use multiple input components for the array proeprties when needed. ### Relation Properties `senderUserId` `deletedFor` `readBy` `conversationId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **senderUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes - **deletedFor**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: No - **readBy**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: No - **conversationId**: ID Relation to `conversation`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `senderUserId` `conversationId` `sentAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **senderUserId**: ID has a filter named `senderUserId` - **conversationId**: ID has a filter named `conversationId` - **sentAt**: Date has a filter named `sentAt` ## Conversation Data Object Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Conversation Data Object Properties Conversation data object has got following properties that are represented as table fields in the database scheme. These properties don't stand just for data storage, but each may have different settings to manage the business logic. | Property | Type | IsArray | Required | Description | |----------|------|---------|----------|-------------| | `isGroup` | Boolean | false | Yes | True for group; false for one-to-one conversation (default false). | | `participantIds` | ID | true | Yes | Array of user IDs (auth:user) participating in the conversation (min 2). | | `lastMessageAt` | Date | false | No | Timestamp of most recent message sent in this conversation. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value, formula or session bind is set. ### Array Properties `participantIds` Array properties can hold multiple values. Array properties should be respected according to their multiple structure in the frontend in any user input for them. Please use multiple input components for the array proeprties when needed. ### Relation Properties `participantIds` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. The relations may reference to a data object either in this service or in another service. Id the reference is remote, backend handles the relations through service communication or elastic search. These relations should be respected in the frontend so that instaead of showing the related objects id, the frontend should list human readable values from other data objects. If the relation points to another service, frontend should use the referenced service api in case it needs related data. The relation logic is montly handled in backend so the api responses feeds the frontend about the relational data. In mmost cases the api response will provide the relational data as well as the main one. In frontend, please ensure that, 1- instaead of these relational ids you show the main human readable field of the related target data (like name), 2- if this data object needs a user input of these relational ids, you should provide a combobox with the list of possible records or (a searchbox) to select with the realted target data object main human readable field. - **participantIds**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. Required: Yes ### Filter Properties `isGroup` `participantIds` `lastMessageAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's. - **isGroup**: Boolean has a filter named `isGroup` - **participantIds**: ID has a filter named `participantIds` - **lastMessageAt**: Date has a filter named `lastMessageAt` ## API Reference ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` **After this prompt, the user may give you new instructions to update the output of this prompt or provide subsequent prompts about the project.** # EVENT GUIDE ## linkedin-jobapplication-service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `JobApplication` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `JobApplication` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `JobApplication` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `JobApplication` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `JobApplication` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent jobPosting-created **Event topic**: `linkedin-jobapplication-service-dbevent-jobposting-created` This event is triggered upon the creation of a `jobPosting` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent jobPosting-updated **Event topic**: `linkedin-jobapplication-service-dbevent-jobposting-updated` Activation of this event follows the update of a `jobPosting` data object. The payload contains the updated information under the `jobPosting` attribute, along with the original data prior to update, labeled as `old_jobPosting` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_jobPosting:{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, jobPosting:{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent jobPosting-deleted **Event topic**: `linkedin-jobapplication-service-dbevent-jobposting-deleted` This event announces the deletion of a `jobPosting` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent jobApplication-created **Event topic**: `linkedin-jobapplication-service-dbevent-jobapplication-created` This event is triggered upon the creation of a `jobApplication` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent jobApplication-updated **Event topic**: `linkedin-jobapplication-service-dbevent-jobapplication-updated` Activation of this event follows the update of a `jobApplication` data object. The payload contains the updated information under the `jobApplication` attribute, along with the original data prior to update, labeled as `old_jobApplication` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_jobApplication:{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, jobApplication:{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent jobApplication-deleted **Event topic**: `linkedin-jobapplication-service-dbevent-jobapplication-deleted` This event announces the deletion of a `jobApplication` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `JobApplication` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event jobposting-created **Event topic**: `elastic-index-linkedin_jobposting-created` **Event payload**: ```json {"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobposting-updated **Event topic**: `elastic-index-linkedin_jobposting-created` **Event payload**: ```json {"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobposting-deleted **Event topic**: `elastic-index-linkedin_jobposting-deleted` **Event payload**: ```json {"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobposting-extended **Event topic**: `elastic-index-linkedin_jobposting-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event jobapplication-deleted **Event topic** : `linkedin-jobapplication-service-jobapplication-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-retrived **Event topic** : `linkedin-jobapplication-service-jobapplication-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-updated **Event topic** : `linkedin-jobapplication-service-jobposting-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-deleted **Event topic** : `linkedin-jobapplication-service-jobposting-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-retrived **Event topic** : `linkedin-jobapplication-service-jobposting-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-updated **Event topic** : `linkedin-jobapplication-service-jobapplication-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-created **Event topic** : `linkedin-jobapplication-service-jobapplication-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobpostings-listed **Event topic** : `linkedin-jobapplication-service-jobpostings-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPostings` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPostings`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPostings","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobPostings":[{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event jobapplications-listed **Event topic** : `linkedin-jobapplication-service-jobapplications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobApplications":[{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event jobposting-created **Event topic** : `linkedin-jobapplication-service-jobposting-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Index Event jobapplication-created **Event topic**: `elastic-index-linkedin_jobapplication-created` **Event payload**: ```json {"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobapplication-updated **Event topic**: `elastic-index-linkedin_jobapplication-created` **Event payload**: ```json {"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobapplication-deleted **Event topic**: `elastic-index-linkedin_jobapplication-deleted` **Event payload**: ```json {"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event jobapplication-extended **Event topic**: `elastic-index-linkedin_jobapplication-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event jobapplication-deleted **Event topic** : `linkedin-jobapplication-service-jobapplication-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-retrived **Event topic** : `linkedin-jobapplication-service-jobapplication-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-updated **Event topic** : `linkedin-jobapplication-service-jobposting-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-deleted **Event topic** : `linkedin-jobapplication-service-jobposting-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobposting-retrived **Event topic** : `linkedin-jobapplication-service-jobposting-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-updated **Event topic** : `linkedin-jobapplication-service-jobapplication-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobapplication-created **Event topic** : `linkedin-jobapplication-service-jobapplication-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplication` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplication`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event jobpostings-listed **Event topic** : `linkedin-jobapplication-service-jobpostings-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPostings` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPostings`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPostings","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobPostings":[{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event jobapplications-listed **Event topic** : `linkedin-jobapplication-service-jobapplications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobApplications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobApplications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobApplications":[{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event jobposting-created **Event topic** : `linkedin-jobapplication-service-jobposting-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `jobPosting` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`jobPosting`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-jobapplication-service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the JobApplication Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our JobApplication Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the JobApplication Service via HTTP requests for purposes such as creating, updating, deleting and querying JobApplication objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the JobApplication Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the JobApplication service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the JobApplication service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the JobApplication service. This service is configured to listen for HTTP requests on port `3003`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the JobApplication service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `JobApplication` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `JobApplication` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `JobApplication` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources JobApplication service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### JobPosting resource *Resource Definition* : Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. *JobPosting Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **description** | Text | | | *Detailed description of the job posting.* | | **title** | String | | | *Job title/position name.* | | **applicationDeadline** | Date | | | *Last date for accepting applications. Checked during apply.* | | **companyId** | ID | | | *Company offering the job. FK to company:company* | | **employmentType** | Enum | | | *Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other).* | | **postedByUserId** | ID | | | *User (admin/recruiter) who posted the job. FK to auth:user; used for ownership.* | | **salaryRange** | String | | | *Human-readable salary range (free-form for v1; can be refined later).* | | **location** | String | | | *Primary job location (city, country, etc.)* | | **visibility** | Enum | | | *Controls who can see/apply to this job: public (all) or private (admins only).* | | **workplaceType** | Enum | | | *Workplace type (on-site,remote,hybrid).* | | **status** | Enum | | | *status : active or closed* | | **companyName** | String | | | *company name* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### employmentType Enum Property *Property Definition* : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other).*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **full_time** | `"full_time""` | 0 | | **part_time** | `"part_time""` | 1 | | **contract** | `"contract""` | 2 | | **internship** | `"internship""` | 3 | | **volunteer** | `"volunteer""` | 4 | | **other** | `"other""` | 5 | | **temporary** | `"temporary""` | 6 | ##### visibility Enum Property *Property Definition* : Controls who can see/apply to this job: public (all) or private (admins only).*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **public** | `"public""` | 0 | | **private** | `"private""` | 1 | ##### workplaceType Enum Property *Property Definition* : Workplace type (on-site,remote,hybrid).*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **on_site** | `"on_site""` | 0 | | **remote** | `"remote""` | 1 | | **hybrid** | `"hybrid""` | 2 | ##### status Enum Property *Property Definition* : status : active or closed*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **active** | `"active""` | 0 | | **closed** | `"closed""` | 1 | ### JobApplication resource *Resource Definition* : Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. *JobApplication Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **jobPostingId** | ID | | | *FK to jobPosting: job applied for.* | | **applicantUserId** | ID | | | *User who submitted the application. FK to auth:user.id; used for ownership.* | | **coverLetter** | Text | | | *User's (optional) cover letter/body with application.* | | **resumeUrl** | String | | | *URL/path to user resume/doc to share with recruiter/admin. User-provided.* | | **lastStatusUpdateAt** | Date | | | *Timestamp of latest status change (set when status is updated).* | | **status** | Enum | | | *Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job.* | | **appliedAt** | Date | | | *Timestamp when application was submitted. Set automatically on create.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### status Enum Property *Property Definition* : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job.*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **submitted** | `"submitted""` | 0 | | **in_review** | `"in_review""` | 1 | | **accepted** | `"accepted""` | 2 | | **rejected** | `"rejected""` | 3 | ## Business Api ### Delete Jobapplication API *API Definition* : Delete (soft) job application. Only applicant or admin for the job's company may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/jobapplications/:jobApplicationId` #### Parameters The deleteJobApplication api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Jobapplication](businessApi/deleteJobApplication). ### Get Jobapplication API *API Definition* : Get job application record. Only applicant or admin of company may view. *API Crud Type* : get *Default access route* : *GET* `/v1/jobapplications/:jobApplicationId` #### Parameters The getJobApplication api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Jobapplication](businessApi/getJobApplication). ### Update Jobposting API *API Definition* : Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. *API Crud Type* : update *Default access route* : *PATCH* `/v1/jobpostings/:jobPostingId` #### Parameters The updateJobPosting api has got 12 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Jobposting](businessApi/updateJobPosting). ### Delete Jobposting API *API Definition* : Delete (soft) a job posting. Only admin for companyId may delete. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/jobpostings/:jobPostingId` #### Parameters The deleteJobPosting api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Jobposting](businessApi/deleteJobPosting). ### Get Jobposting API *API Definition* : Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. *API Crud Type* : get *Default access route* : *GET* `/v1/jobpostings/:jobPostingId` #### Parameters The getJobPosting api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"GET","action":"get","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Jobposting](businessApi/getJobPosting). ### Update Jobapplication API *API Definition* : Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. *API Crud Type* : update *Default access route* : *PATCH* `/v1/jobapplications/:jobApplicationId` #### Parameters The updateJobApplication api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Jobapplication](businessApi/updateJobApplication). ### Create Jobapplication API *API Definition* : Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. *API Crud Type* : create *Default access route* : *POST* `/v1/jobapplications` #### Parameters The createJobApplication api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplication","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobApplication":{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Jobapplication](businessApi/createJobApplication). ### List Jobpostings API *API Definition* : List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. *API Crud Type* : list *Default access route* : *GET* `/v1/jobpostings` The listJobPostings api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPostings`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPostings","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobPostings":[{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Jobpostings](businessApi/listJobPostings). ### List Jobapplications API *API Definition* : List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. *API Crud Type* : list *Default access route* : *GET* `/v1/jobapplications` The listJobApplications api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplications`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobApplications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","jobApplications":[{"id":"ID","jobPostingId":"ID","applicantUserId":"ID","coverLetter":"Text","resumeUrl":"String","lastStatusUpdateAt":"Date","status":"Enum","status_idx":"Integer","appliedAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Jobapplications](businessApi/listJobApplications). ### Create Jobposting API *API Definition* : Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. *API Crud Type* : create *Default access route* : *POST* `/v1/jobpostings` #### Parameters The createJobPosting api has got 11 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"jobPosting","method":"POST","action":"create","appVersion":"Version","rowCount":1,"jobPosting":{"id":"ID","description":"Text","title":"String","applicationDeadline":"Date","companyId":"ID","employmentType":"Enum","employmentType_idx":"Integer","postedByUserId":"ID","salaryRange":"String","location":"String","visibility":"Enum","visibility_idx":"Integer","workplaceType":"Enum","workplaceType_idx":"Integer","status":"Enum","status_idx":"Integer","companyName":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Jobposting](businessApi/createJobPosting). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-jobapplication-service** documentation -Version:**`1.0.12`** ## Scope This document provides a structured architectural overview of the `jobApplication` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `JobApplication` Service Settings [**Edit**](jobapplication/serviceSettings) Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### Service Overview This service is configured to listen for HTTP requests on port `3003`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-jobapplication-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-jobapplication-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `jobPosting` | Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. | accessPublic | | `jobApplication` | Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. | accessPrivate | ## jobPosting Data Object ### Object Overview **Description:** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPublic — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `description` | Text | Yes | Detailed description of the job posting. | | `title` | String | Yes | Job title/position name. | | `applicationDeadline` | Date | No | Last date for accepting applications. Checked during apply. | | `companyId` | ID | No | Company offering the job. FK to company:company | | `employmentType` | Enum | Yes | Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). | | `postedByUserId` | ID | Yes | User (admin/recruiter) who posted the job. FK to auth:user; used for ownership. | | `salaryRange` | String | No | Human-readable salary range (free-form for v1; can be refined later). | | `location` | String | No | Primary job location (city, country, etc.) | | `visibility` | Enum | Yes | Controls who can see/apply to this job: public (all) or private (admins only). | | `workplaceType` | Enum | Yes | Workplace type (on-site,remote,hybrid). | | `status` | Enum | Yes | status : active or closed | | `companyName` | String | Yes | company name | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **description**: 'text' - **title**: 'default' - **employmentType**: "full_time" - **postedByUserId**: '00000000-0000-0000-0000-000000000000' - **visibility**: public - **workplaceType**: "on_site" - **status**: active - **companyName**: 'default' ### Auto Update Properties `description` `title` `applicationDeadline` `companyId` `employmentType` `postedByUserId` `salaryRange` `location` `visibility` `workplaceType` `status` `companyName` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **employmentType**: [full_time, part_time, contract, internship, volunteer, other, temporary] - **visibility**: [public, private] - **workplaceType**: [on_site, remote, hybrid] - **status**: [active, closed] ### Elastic Search Indexing `description` `title` `applicationDeadline` `companyId` `employmentType` `postedByUserId` `location` `visibility` `workplaceType` `status` `companyName` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `companyId` `postedByUserId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `companyId` `postedByUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **companyId**: ID Relation to `company`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **postedByUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Session Data Properties `postedByUserId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **postedByUserId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `title` `applicationDeadline` `companyId` `employmentType` `postedByUserId` `location` `visibility` `workplaceType` `status` `companyName` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **title**: String has a filter named `title` - **applicationDeadline**: Date has a filter named `applicationDeadline` - **companyId**: ID has a filter named `companyId` - **employmentType**: Enum has a filter named `employmentType` - **postedByUserId**: ID has a filter named `postedByUserId` - **location**: String has a filter named `location` - **visibility**: Enum has a filter named `visibility` - **workplaceType**: Enum has a filter named `workplaceType` - **status**: Enum has a filter named `status` - **companyName**: String has a filter named `companyName` ## jobApplication Data Object ### Object Overview **Description:** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **uniqueJobApplicationPerUserPerJob**: [jobPostingId, applicantUserId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `jobPostingId` | ID | Yes | FK to jobPosting: job applied for. | | `applicantUserId` | ID | Yes | User who submitted the application. FK to auth:user.id; used for ownership. | | `coverLetter` | Text | No | User's (optional) cover letter/body with application. | | `resumeUrl` | String | No | URL/path to user resume/doc to share with recruiter/admin. User-provided. | | `lastStatusUpdateAt` | Date | Yes | Timestamp of latest status change (set when status is updated). | | `status` | Enum | Yes | Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. | | `appliedAt` | Date | Yes | Timestamp when application was submitted. Set automatically on create. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **jobPostingId**: '00000000-0000-0000-0000-000000000000' - **applicantUserId**: '00000000-0000-0000-0000-000000000000' - **lastStatusUpdateAt**: new Date() - **status**: submitted - **appliedAt**: new Date() ### Constant Properties `jobPostingId` `applicantUserId` `appliedAt` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `coverLetter` `resumeUrl` `lastStatusUpdateAt` `status` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **status**: [submitted, in_review, accepted, rejected] ### Elastic Search Indexing `jobPostingId` `applicantUserId` `lastStatusUpdateAt` `status` `appliedAt` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `jobPostingId` `applicantUserId` `lastStatusUpdateAt` `status` `appliedAt` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `jobPostingId` `applicantUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **jobPostingId**: ID Relation to `jobPosting`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **applicantUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Session Data Properties `applicantUserId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **applicantUserId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Formula Properties `lastStatusUpdateAt` `appliedAt` Formula properties are used to define calculated fields that derive their values from other properties or external data. These properties are automatically calculated based on the defined formula and can be used for dynamic data retrieval. - **lastStatusUpdateAt**: Date - Formula: `new Date()` - Update Formula: `new Date()` - Calculate After Instance: No - Calculate When Input Has: [status] - **appliedAt**: Date - Formula: `new Date()` - Calculate After Instance: No ### Filter Properties `jobPostingId` `applicantUserId` `lastStatusUpdateAt` `status` `appliedAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **jobPostingId**: ID has a filter named `jobPostingId` - **applicantUserId**: ID has a filter named `applicantUserId` - **lastStatusUpdateAt**: Date has a filter named `lastStatusUpdateAt` - **status**: Enum has a filter named `status` - **appliedAt**: Date has a filter named `appliedAt` ## Business Logic jobApplication has got 10 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [Delete Jobapplication](/businessLogic/deletejobapplication) * [Get Jobapplication](/businessLogic/getjobapplication) * [Update Jobposting](/businessLogic/updatejobposting) * [Delete Jobposting](/businessLogic/deletejobposting) * [Get Jobposting](/businessLogic/getjobposting) * [Update Jobapplication](/businessLogic/updatejobapplication) * [Create Jobapplication](/businessLogic/createjobapplication) * [List Jobpostings](/businessLogic/listjobpostings) * [List Jobapplications](/businessLogic/listjobapplications) * [Create Jobposting](/businessLogic/createjobposting) ## Edge Controllers No edge controllers defined for this service. --- ## Service Library ### Functions #### hasUserAlreadyApplied.js ```js module.exports = async function(userId, jobPostingId) { const JobApplication = this.getModel('jobApplication'); const app = await JobApplication.findOne({ where: { applicantUserId: userId, jobPostingId: jobPostingId, isActive: true }}); return !!app; } ``` #### getAdminJobPostingIds.js ```js module.exports = async function(userId) { const CompanyAdmin = this.getModel('companyAdmin', 'company'); const companies = await CompanyAdmin.findAll({ where: { userId: userId, isActive: true }}); const companyIds = companies.map(a => a.companyId); const JobPosting = this.getModel('jobPosting'); const jobPostings = await JobPosting.findAll({ where: { companyId: { $in: companyIds }, isActive: true }}); return jobPostings.map(jp => jp.id); } ``` ### Hook Functions No hook functions defined. ### Edge Functions No edge functions defined. ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3003` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* # EVENT GUIDE ## linkedin-messaging-service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Messaging` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Messaging` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Messaging` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Messaging` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Messaging` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent message-created **Event topic**: `linkedin-messaging-service-dbevent-message-created` This event is triggered upon the creation of a `message` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent message-updated **Event topic**: `linkedin-messaging-service-dbevent-message-updated` Activation of this event follows the update of a `message` data object. The payload contains the updated information under the `message` attribute, along with the original data prior to update, labeled as `old_message` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_message:{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, message:{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent message-deleted **Event topic**: `linkedin-messaging-service-dbevent-message-deleted` This event announces the deletion of a `message` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent conversation-created **Event topic**: `linkedin-messaging-service-dbevent-conversation-created` This event is triggered upon the creation of a `conversation` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent conversation-updated **Event topic**: `linkedin-messaging-service-dbevent-conversation-updated` Activation of this event follows the update of a `conversation` data object. The payload contains the updated information under the `conversation` attribute, along with the original data prior to update, labeled as `old_conversation` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_conversation:{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, conversation:{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent conversation-deleted **Event topic**: `linkedin-messaging-service-dbevent-conversation-deleted` This event announces the deletion of a `conversation` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Messaging` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event message-created **Event topic**: `elastic-index-linkedin_message-created` **Event payload**: ```json {"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event message-updated **Event topic**: `elastic-index-linkedin_message-created` **Event payload**: ```json {"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event message-deleted **Event topic**: `elastic-index-linkedin_message-deleted` **Event payload**: ```json {"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event message-extended **Event topic**: `elastic-index-linkedin_message-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event messages-listed **Event topic** : `linkedin-messaging-service-messages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `messages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`messages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"messages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","messages":[{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event conversation-updated **Event topic** : `linkedin-messaging-service-conversation-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-retrived **Event topic** : `linkedin-messaging-service-message-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"GET","action":"get","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-retrived **Event topic** : `linkedin-messaging-service-conversation-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"GET","action":"get","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-updated **Event topic** : `linkedin-messaging-service-message-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-deleted **Event topic** : `linkedin-messaging-service-conversation-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversations-listed **Event topic** : `linkedin-messaging-service-conversations-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversations` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversations`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversations","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","conversations":[{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event message-deleted **Event topic** : `linkedin-messaging-service-message-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-created **Event topic** : `linkedin-messaging-service-message-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"POST","action":"create","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-created **Event topic** : `linkedin-messaging-service-conversation-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"POST","action":"create","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Index Event conversation-created **Event topic**: `elastic-index-linkedin_conversation-created` **Event payload**: ```json {"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event conversation-updated **Event topic**: `elastic-index-linkedin_conversation-created` **Event payload**: ```json {"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event conversation-deleted **Event topic**: `elastic-index-linkedin_conversation-deleted` **Event payload**: ```json {"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event conversation-extended **Event topic**: `elastic-index-linkedin_conversation-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event messages-listed **Event topic** : `linkedin-messaging-service-messages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `messages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`messages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"messages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","messages":[{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event conversation-updated **Event topic** : `linkedin-messaging-service-conversation-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-retrived **Event topic** : `linkedin-messaging-service-message-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"GET","action":"get","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-retrived **Event topic** : `linkedin-messaging-service-conversation-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"GET","action":"get","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-updated **Event topic** : `linkedin-messaging-service-message-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-deleted **Event topic** : `linkedin-messaging-service-conversation-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversations-listed **Event topic** : `linkedin-messaging-service-conversations-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversations` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversations`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversations","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","conversations":[{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event message-deleted **Event topic** : `linkedin-messaging-service-message-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event message-created **Event topic** : `linkedin-messaging-service-message-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `message` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`message`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"POST","action":"create","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event conversation-created **Event topic** : `linkedin-messaging-service-conversation-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `conversation` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`conversation`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"POST","action":"create","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-messaging-service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Messaging Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Messaging Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Messaging Service via HTTP requests for purposes such as creating, updating, deleting and querying Messaging objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Messaging Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Messaging service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Messaging service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Messaging service. This service is configured to listen for HTTP requests on port `3006`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Messaging service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Messaging` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Messaging` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Messaging` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Messaging service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### Message resource *Resource Definition* : Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. *Message Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **content** | Text | | | *Raw message body/content.* | | **senderUserId** | ID | | | *auth:user.id of message sender.* | | **deletedFor** | ID | | | *Array of userIds who have deleted/hid this message (soft/hide).* | | **readBy** | ID | | | *Array of userIds who have read this message. Used for read receipts.* | | **conversationId** | ID | | | *Conversation this message belongs to (messaging:conversation).* | | **sentAt** | Date | | | *Timestamp when message is sent (defaults to now on create).* | ### Conversation resource *Resource Definition* : Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. *Conversation Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **isGroup** | Boolean | | | *True for group; false for one-to-one conversation (default false).* | | **participantIds** | ID | | | *Array of user IDs (auth:user) participating in the conversation (min 2).* | | **lastMessageAt** | Date | | | *Timestamp of most recent message sent in this conversation.* | ## Business Api ### List Messages API *API Definition* : List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. *API Crud Type* : list *Default access route* : *GET* `/v1/messages` The listMessages api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`messages`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"messages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","messages":[{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Messages](businessApi/listMessages). ### Update Conversation API *API Definition* : Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. *API Crud Type* : update *Default access route* : *PATCH* `/v1/conversations/:conversationId` #### Parameters The updateConversation api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Conversation](businessApi/updateConversation). ### Get Message API *API Definition* : Fetch a specific message if the requesting user is a participant in the conversation. *API Crud Type* : get *Default access route* : *GET* `/v1/messages/:messageId` #### Parameters The getMessage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"GET","action":"get","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Message](businessApi/getMessage). ### Get Conversation API *API Definition* : Fetch details for a conversation thread. Only participants may view. *API Crud Type* : get *Default access route* : *GET* `/v1/conversations/:conversationId` #### Parameters The getConversation api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"GET","action":"get","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Conversation](businessApi/getConversation). ### Update Message API *API Definition* : Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. *API Crud Type* : update *Default access route* : *PATCH* `/v1/messages/:messageId` #### Parameters The updateMessage api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Message](businessApi/updateMessage). ### Delete Conversation API *API Definition* : Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). *API Crud Type* : delete *Default access route* : *DELETE* `/v1/conversations/:conversationId` #### Parameters The deleteConversation api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Conversation](businessApi/deleteConversation). ### List Conversations API *API Definition* : List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). *API Crud Type* : list *Default access route* : *GET* `/v1/conversations` The listConversations api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversations`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversations","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","conversations":[{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Conversations](businessApi/listConversations). ### Delete Message API *API Definition* : Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). *API Crud Type* : delete *Default access route* : *DELETE* `/v1/messages/:messageId` #### Parameters The deleteMessage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Message](businessApi/deleteMessage). ### Create Message API *API Definition* : Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. *API Crud Type* : create *Default access route* : *POST* `/v1/messages` #### Parameters The createMessage api has got 6 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"message","method":"POST","action":"create","appVersion":"Version","rowCount":1,"message":{"id":"ID","content":"Text","senderUserId":"ID","deletedFor":"ID","readBy":"ID","conversationId":"ID","sentAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Message](businessApi/createMessage). ### Create Conversation API *API Definition* : Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. *API Crud Type* : create *Default access route* : *POST* `/v1/conversations` #### Parameters The createConversation api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"conversation","method":"POST","action":"create","appVersion":"Version","rowCount":1,"conversation":{"id":"ID","isGroup":"Boolean","participantIds":"ID","lastMessageAt":"Date","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Conversation](businessApi/createConversation). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-messaging-service** documentation -Version:**`1.0.1`** ## Scope This document provides a structured architectural overview of the `messaging` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `Messaging` Service Settings [**Edit**](messaging/serviceSettings) Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Service Overview This service is configured to listen for HTTP requests on port `3006`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-messaging-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-messaging-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `message` | Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. | accessProtected | | `conversation` | Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. | accessProtected | ## message Data Object ### Object Overview **Description:** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessProtected — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **conversationId_sentAt**: [conversationId, sentAt] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `doInsert` The new record will be inserted without checking for duplicates. This means that the composite index is designed for search purposes only. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `content` | Text | Yes | Raw message body/content. | | `senderUserId` | ID | Yes | auth:user.id of message sender. | | `deletedFor` | ID | No | Array of userIds who have deleted/hid this message (soft/hide). | | `readBy` | ID | No | Array of userIds who have read this message. Used for read receipts. | | `conversationId` | ID | Yes | Conversation this message belongs to (messaging:conversation). | | `sentAt` | Date | No | Timestamp when message is sent (defaults to now on create). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Array Properties `deletedFor` `readBy` Array properties can hold multiple values and are indicated by the `[]` suffix in their type. Avoid using arrays in properties that are used for relations, as they will not work correctly. Note that using connection objects instead of arrays is recommended for relations, as they provide better performance and flexibility. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **content**: 'text' - **senderUserId**: '00000000-0000-0000-0000-000000000000' - **conversationId**: '00000000-0000-0000-0000-000000000000' ### Constant Properties `senderUserId` `conversationId` `sentAt` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `content` `deletedFor` `readBy` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `content` `senderUserId` `conversationId` `sentAt` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `senderUserId` `conversationId` `sentAt` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `senderUserId` `deletedFor` `readBy` `conversationId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **senderUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **deletedFor**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: No - **readBy**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: No - **conversationId**: ID Relation to `conversation`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `senderUserId` `conversationId` `sentAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **senderUserId**: ID has a filter named `senderUserId` - **conversationId**: ID has a filter named `conversationId` - **sentAt**: Date has a filter named `sentAt` ## conversation Data Object ### Object Overview **Description:** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessProtected — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **participantIds_isGroup_unique**: [participantIds, isGroup] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `isGroup` | Boolean | Yes | True for group; false for one-to-one conversation (default false). | | `participantIds` | ID | Yes | Array of user IDs (auth:user) participating in the conversation (min 2). | | `lastMessageAt` | Date | No | Timestamp of most recent message sent in this conversation. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Array Properties `participantIds` Array properties can hold multiple values and are indicated by the `[]` suffix in their type. Avoid using arrays in properties that are used for relations, as they will not work correctly. Note that using connection objects instead of arrays is recommended for relations, as they provide better performance and flexibility. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **participantIds**: [] ### Auto Update Properties `isGroup` `participantIds` `lastMessageAt` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `isGroup` `participantIds` `lastMessageAt` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `isGroup` `participantIds` `lastMessageAt` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Relation Properties `participantIds` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **participantIds**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `isGroup` `participantIds` `lastMessageAt` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **isGroup**: Boolean has a filter named `isGroup` - **participantIds**: ID has a filter named `participantIds` - **lastMessageAt**: Date has a filter named `lastMessageAt` ## Business Logic messaging has got 10 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [List Messages](/businessLogic/listmessages) * [Update Conversation](/businessLogic/updateconversation) * [Get Message](/businessLogic/getmessage) * [Get Conversation](/businessLogic/getconversation) * [Update Message](/businessLogic/updatemessage) * [Delete Conversation](/businessLogic/deleteconversation) * [List Conversations](/businessLogic/listconversations) * [Delete Message](/businessLogic/deletemessage) * [Create Message](/businessLogic/createmessage) * [Create Conversation](/businessLogic/createconversation) ## Edge Controllers ### helloWorld **Configuration:** - **Function Name**: `helloWorld` - **Login Required**: No **REST Settings:** - **Path**: `/helloworld` - **Method**: --- ### sendMail **Configuration:** - **Function Name**: `sendMail` - **Login Required**: Yes **REST Settings:** - **Path**: `/sendmail` - **Method**: --- --- ## Service Library ### Functions No general functions defined. ### Hook Functions No hook functions defined. ### Edge Functions No edge functions defined. ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3006` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* # EVENT API GUIDE ## NOTIFICATION SERVICE The Notification service is a microservice that allows sending notifications through SMS, Email, and Push channels. Providers can be configured dynamically through the `.env` file. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to. For inquiries, feedback, or further information regarding the architecture, please direct your communication to: **Email**: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Notification Service Event Publishers and Listeners. This document provides a comprehensive overview of the event-driven architecture employed in the Notification Service, detailing the various events that are published and consumed within the system. **Intended Audience** This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the Notification Service. It assumes familiarity with microservices architecture and the Kafka messaging system. **Overview** This document outlines the key components of the Notification Service's event-driven architecture, including the events that are published and consumed, the Kafka topics used, and the expected payloads for each event. It serves as a reference guide for understanding how events flow through the system and how different components interact with each other. ## Kafka Event Publishers ### Kafka Event Publisher: sendEmailNotification **Event Topic**: `linkedin-notification-service-notification-email` When a notification is sent through the Email channel, this publisher is responsible for sending the notification to the Kafka topic `linkedin-notification-service-notification-email`. The payload of the event includes the necessary information for sending the email, such as recipient details, subject, and message body. ### Kafka Event Publisher: sendPushNotification **Event Topic**: `linkedin-notification-service-notification-push` When a notification is sent through the Push channel, this publisher is responsible for sending the notification to the Kafka topic `linkedin-notification-service-notification-push`. The payload of the event includes the necessary information for sending the push notification, such as recipient details, title, and message body. ### Kafka Event Publisher: sendSmsNotification **Event Topic**: linkedin-notification-service-notification-sms` When a notification is sent through the SMS channel, this publisher is responsible for sending the notification to the Kafka topic `linkedin-notification-service-notification-sms`. The payload of the event includes the necessary information for sending the SMS, such as recipient details and message body. ## Kafka Event Listeners ### Kafka Event Listener: runEmailSenderListener **Event Topic**: `linkedin-notification-service-notification-email` When a notification is sent through the Email channel, this listener is triggered. It consumes messages from the `linkedin-notification-service-notification-email` topic, parses the payload, and uses the dynamically configured email provider to send the notification. ### Kafka Event Listener: runPushSenderListener **Event Topic**: `linkedin-notification-service-notification-push` When a notification is sent through the Push channel, this listener is triggered. It consumes messages from the `linkedin-notification-service-notification-push` topic, parses the payload, and uses the dynamically configured push provider to send the notification. ### Kafka Event Listener: runSmsSenderListener **Event Topic**: `linkedin-notification-service-notification-sms` When a notification is sent through the SMS channel, this listener is triggered. It consumes messages from the `linkedin-notification-service-notification-sms` topic, parses the payload, and uses the dynamically configured SMS provider to send the notification. ### Kafka Event Listener: runemailVerification1Listener **Event Topic**: `auth.user.created` When a notification is sent through the `auth.user.created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`UserProfileDetailView`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runconnectionRequestReceivedListener **Event Topic**: `linkedin-networking-service-connectionrequest-created` When a notification is sent through the `linkedin-networking-service-connectionrequest-created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`userdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runconnectionRequestAcceptedListener **Event Topic**: `linkedin-networking-service-connectionrequest-updated` When a notification is sent through the `linkedin-networking-service-connectionrequest-updated` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`userdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runnewMessageReceivedListener **Event Topic**: `linkedin-messaging-service-message-created` When a notification is sent through the `linkedin-messaging-service-message-created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`conversationdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runjobApplicationSubmittedListener **Event Topic**: `linkedin-jobapplication-service-jobapplication-created` When a notification is sent through the `linkedin-jobapplication-service-jobapplication-created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`jobapplicationdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runjobApplicationStatusUpdatedListener **Event Topic**: `linkedin-jobapplication-service-jobapplication-updated` When a notification is sent through the `linkedin-jobapplication-service-jobapplication-updated` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`jobapplicationdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runjobApplicationReceivedListener **Event Topic**: `linkedin-jobapplication-service-jobapplication-created` When a notification is sent through the `linkedin-jobapplication-service-jobapplication-created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`jobpostingdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runpostLikedListener **Event Topic**: `linkedin-content-service-post-liked` When a notification is sent through the `linkedin-content-service-post-liked` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`postdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runpostCommentedListener **Event Topic**: `linkedin-content-service-comment-created` When a notification is sent through the `linkedin-content-service-comment-created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`postdetailview`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runcompanyFollowedListener **Event Topic**: `company.companyFollower.created` When a notification is sent through the `company.companyFollower.created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`CompanyProfileView`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runcompanyUpdatePublishedListener **Event Topic**: `company.companyUpdate.created` When a notification is sent through the `company.companyUpdate.created` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (`CompanyProfileView`). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runemailVerification2Listener **Event Topic**: `linkedin-user-service-email-verification-start` When a notification is sent through the `linkedin-user-service-email-verification-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runmobileVerificationListener **Event Topic**: `linkedin-user-service-mobile-verification-start` When a notification is sent through the `linkedin-user-service-mobile-verification-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runpasswordResetByEmailListener **Event Topic**: `linkedin-user-service-password-reset-by-email-start` When a notification is sent through the `linkedin-user-service-password-reset-by-email-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runpasswordResetByMobileListener **Event Topic**: `linkedin-user-service-password-reset-by-mobile-start` When a notification is sent through the `linkedin-user-service-password-reset-by-mobile-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runemail2FactorListener **Event Topic**: `linkedin-user-service-email-2FA-start` When a notification is sent through the `linkedin-user-service-email-2FA-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. ### Kafka Event Listener: runmobile2FactorListener **Event Topic**: `linkedin-user-service-mobile-2FA-start` When a notification is sent through the `linkedin-user-service-mobile-2FA-start` topic, this listener is triggered. It processes the message, extracts required metadata, and constructs a notification payload using a predefined template (`[object Object]`). It supports condition-based filtering and optionally enriches the payload by retrieving data from ElasticSearch if the `dataView` source is used (``). The notification is sent to the target(s) identified in the payload or in the retrieved data source using the Notification Service. # REST API GUIDE ## NOTIFICATION SERVICE The Notification service is a microservice that allows sending notifications through SMS, Email, and Push channels. Providers can be configured dynamically through the `.env` file. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to. For inquiries, feedback, or further information regarding the architecture, please direct your communication to: **Email**: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Notification Service REST API. This document provides a comprehensive overview of the available endpoints, how they work, and how to use them efficiently. **Intended Audience** This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the Notification Service. It assumes familiarity with microservices architecture and RESTful APIs. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. **Beyond REST** It's important to note that the Notification Service also supports alternative methods of interaction, such as messaging via a Kafka message broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. --- ## Routes ### Route: Register Device _Route Definition_: Registers a device for a user. _Route Type_: create _Default access route_: _POST_ `/devices/register` ### Parameters | Parameter | Type | Required | Population | |-----------|--------|----------|-------------| | device | Object | Yes | body | | userId | ID | Yes | req.userId | ```js axios({ method: "POST", url: `/devices/register`, data: { device:"Object" }, params:{} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. Any validation errors will return status code `400` with an error message. ### Route: Unregister Device _Route Definition_: Removes a registered device. _Route Type_: delete _Default access route_: _DELETE_ `/devices/unregister/:deviceId` ### Parameters | Parameter | Type | Required | Population | |-----------|--------|----------|-------------| | deviceId | ID | Yes | path.param | | userId | ID | Yes | req.userId | ```js axios({ method: "DELETE", url: `/devices/unregister/${deviceId}`, data:{}, params:{} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. Any validation errors will return status code `400` with an error message. ### Route: Get Notifications _Route Definition_: Retrieves a paginated list of notifications. _Route Type_: get _Default access route_: _GET_ `/notifications` ### Parameters | Parameter | Type | Required | Population | |-----------|--------|----------|-------------| | page | Number | No | query.page | | limit | Number | No | query.limit | | sortBy | String | No | query.sortBy| | userId | ID | Yes | req.userId | ```js axios({ method: "GET", url: `/notifications`, data:{}, params: { page: "Number", limit: "Number", sortBy: "String" } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. Any validation errors will return status code `400` with an error message. ### Route: Send Notification _Route Definition_: Sends a notification to specified recipients. _Route Type_: create _Default access route_: _POST_ `/notifications` ### Parameters | Parameter | Type | Required | Population | |---------------|--------|----------|------------| |notification | Object | Yes | body | ```js axios({ method: "POST", url: `/notifications`, data: { notification:"Object" }, params:{} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. Any validation errors will return status code `400` with an error message. ### Route: Mark Notifications as Seen _Route Definition_: Marks selected notifications as seen. _Route Type_: update _Default access route_: _POST_ `/notifications/seen` ### Parameters | Parameter | Type | Required | Population | |------------------ |--------|----------|------------| | notificationIds | Array | Yes | body | | userId | ID | Yes | req.userId | ```js axios({ method: "POST", url: `/notifications/seen`, data: { notificationIds:"Object" }, params:{} }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. Any validation errors will return status code `400` with an error message. --- # Service Design Specification **Notification Service Documentation** **Version:** `1.0` --- ## Scope This document provides a comprehensive architectural overview of the **Notification Service**, which is responsible for sending multi-channel notifications via Email, SMS, and Push. The service supports both REST and gRPC interfaces and utilizes an event-driven architecture through Kafka. This document is intended for: * **Backend Developers** integrating notification capabilities. * **DevOps Engineers** deploying or monitoring the notification system. * **Architects** evaluating extensibility, observability, and scalability. > For detailed REST interface, refer to the \[REST API Guide]. > For Kafka-based publishing and consumption flows, refer to the \[Event API Guide]. --- ## Service Settings * **Port**: Configurable via `HTTP_PORT`, default: `3000` * **Primary Interfaces**: * REST over Express * gRPC over Proto3 * Kafka via event topics * **Database**: PostgreSQL (via Sequelize) * **Optional**: Redis (for caching or state sharing) * **Email/SMS/Push Provider Configuration**: Dynamically switchable via `.env` --- ## Interfaces Overview ### REST API Exposes endpoints to: * Register/unregister devices * Fetch user notifications * Send new notifications * Mark notifications as seen For full list and parameters, refer to the **REST API Guide**. ### gRPC API Defined via `notification.sender.proto`: * `SendNotice()` RPC triggers notification dispatch for all specified channels. * Used for inter-service communication where synchronous flow is preferred. ### Kafka Events * The service **publishes** to and **subscribes** from: * `-notification-email` * `-notification-push` * `-notification-sms` For event structure and consumption logic, refer to the **Event API Guide**. --- ## Provider Architecture Each channel (SMS, Email, Push) is pluggable using a provider pattern. Providers can be toggled via env vars. ### Email Providers * SendGrid * SMTP * AmazonSES * FakeProvider (for dev/test) ### Push Providers * Firebase (FCM) * OneSignal * AmazonSNS * FakeProvider ### SMS Providers * Twilio * AmazonSNS * NetGSM * Vonage * FakeProvider Each provider implements a common `send(payload)` method and logs delivery result. --- ## Storage Mode Notifications can be optionally stored in the PostgreSQL database if `STORED_NOTICE=true` and `notificationBody.isStored=true`. Stored data includes: * `userId`, `title`, `body` * `metadata` (JSON) * `isSeen` flag * `createdAt` / `updatedAt` timestamps --- ## Aggregation & Templating Notification body and title can be: * Directly passed as raw strings * Or dynamically populated via predefined templates: * `WELCOME` * `OTP` * `RESETPASSWORD` * `NONE` (no template) Template rendering supports interpolation with `metadata`. Separate template files exist for: * Email (HTML) * SMS (Text) * Push (structured JSON) --- ## Middleware ### Error Handling * `ApiError` used for standard error shaping * `errorConverter`, `errorHandler` used globally ### Validation * All routes use Joi schema validation * Validations available for: * Device registration * Notification send * Pagination and sort filters * Mark-as-seen by IDs ### Utilities * `pick()`: Selects allowed keys from request * `pagination()`: Sequelize-based paginated query utility --- ## Lifecycle & Boot Process 1. Loads configuration from `.env` using `dotenv` 2. Initializes: * Express HTTP Server * gRPC Server (if `GRPC_ACTIVE=true`) * Kafka listeners * Redis connection * PostgreSQL connection 3. Injects OpenAPI/Swagger via `api-face` 4. Registers REST routes and middleware 5. Launches any scheduled cron jobs 6. Handles graceful shutdown via `SIGINT` --- ## Environment Variables | Variable | Description | | ---------------------- | ----------------------------------- | | `HTTP_PORT` | Express HTTP port (default: 3000) | | `GRPC_PORT` | gRPC server port (default: 50051) | | `SERVICE_URL` | Used to build auth redirect paths | | `SERVICE_SHORT_NAME` | Used for auth hostname substitution | | `PG_USER`, `PG_PASS` | PostgreSQL credentials | | `REDIS_HOST` | Redis connection string | | `STORED_NOTICE` | Whether to persist notifications | | `SENDGRID_API_KEY` | SendGrid API token | | `SMTP_USER/PASS/PORT` | SMTP credentials | | `TWILIO_*`, `NETGSM_*` | SMS provider credentials | | `ONESIGNAL_API_KEY` | OneSignal Push key | --- ## Testing Strategy ### Unit Tests * Provider `.send()` methods * Templating with metadata * Validation schema boundaries ### Integration Tests * REST endpoint workflows * Kafka → Listener execution * gRPC request handling ### End-to-End (Optional) * Simulate a full pipeline: Send → Store → Fetch → Mark as Seen --- ## Observability & Logging * Each send call logs payload & result to console * Provider-specific errors include stack traces # EVENT GUIDE ## linkedin-networking-service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Networking` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Networking` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Networking` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Networking` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Networking` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent connection-created **Event topic**: `linkedin-networking-service-dbevent-connection-created` This event is triggered upon the creation of a `connection` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent connection-updated **Event topic**: `linkedin-networking-service-dbevent-connection-updated` Activation of this event follows the update of a `connection` data object. The payload contains the updated information under the `connection` attribute, along with the original data prior to update, labeled as `old_connection` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_connection:{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, connection:{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent connection-deleted **Event topic**: `linkedin-networking-service-dbevent-connection-deleted` This event announces the deletion of a `connection` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent connectionRequest-created **Event topic**: `linkedin-networking-service-dbevent-connectionrequest-created` This event is triggered upon the creation of a `connectionRequest` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent connectionRequest-updated **Event topic**: `linkedin-networking-service-dbevent-connectionrequest-updated` Activation of this event follows the update of a `connectionRequest` data object. The payload contains the updated information under the `connectionRequest` attribute, along with the original data prior to update, labeled as `old_connectionRequest` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_connectionRequest:{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, connectionRequest:{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent connectionRequest-deleted **Event topic**: `linkedin-networking-service-dbevent-connectionrequest-deleted` This event announces the deletion of a `connectionRequest` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Networking` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event connection-created **Event topic**: `elastic-index-linkedin_connection-created` **Event payload**: ```json {"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connection-updated **Event topic**: `elastic-index-linkedin_connection-created` **Event payload**: ```json {"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connection-deleted **Event topic**: `elastic-index-linkedin_connection-deleted` **Event payload**: ```json {"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connection-extended **Event topic**: `elastic-index-linkedin_connection-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event connection-created **Event topic** : `linkedin-networking-service-connection-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-deleted **Event topic** : `linkedin-networking-service-connectionrequest-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-updated **Event topic** : `linkedin-networking-service-connectionrequest-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connections-listed **Event topic** : `linkedin-networking-service-connections-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connections` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connections`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connections","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connections":[{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event connectionrequests-listed **Event topic** : `linkedin-networking-service-connectionrequests-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequests` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequests`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequests","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connectionRequests":[{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event connectionrequest-created **Event topic** : `linkedin-networking-service-connectionrequest-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connection-deleted **Event topic** : `linkedin-networking-service-connection-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-retrived **Event topic** : `linkedin-networking-service-connectionrequest-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connection-retrived **Event topic** : `linkedin-networking-service-connection-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Index Event connectionrequest-created **Event topic**: `elastic-index-linkedin_connectionrequest-created` **Event payload**: ```json {"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connectionrequest-updated **Event topic**: `elastic-index-linkedin_connectionrequest-created` **Event payload**: ```json {"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connectionrequest-deleted **Event topic**: `elastic-index-linkedin_connectionrequest-deleted` **Event payload**: ```json {"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event connectionrequest-extended **Event topic**: `elastic-index-linkedin_connectionrequest-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event connection-created **Event topic** : `linkedin-networking-service-connection-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-deleted **Event topic** : `linkedin-networking-service-connectionrequest-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-updated **Event topic** : `linkedin-networking-service-connectionrequest-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connections-listed **Event topic** : `linkedin-networking-service-connections-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connections` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connections`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connections","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connections":[{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event connectionrequests-listed **Event topic** : `linkedin-networking-service-connectionrequests-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequests` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequests`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequests","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connectionRequests":[{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event connectionrequest-created **Event topic** : `linkedin-networking-service-connectionrequest-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connection-deleted **Event topic** : `linkedin-networking-service-connection-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connectionrequest-retrived **Event topic** : `linkedin-networking-service-connectionrequest-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connectionRequest` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connectionRequest`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event connection-retrived **Event topic** : `linkedin-networking-service-connection-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `connection` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`connection`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-networking-service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Networking Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Networking Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Networking Service via HTTP requests for purposes such as creating, updating, deleting and querying Networking objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Networking Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Networking service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Networking service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Networking service. This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Networking service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Networking` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Networking` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Networking` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Networking service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### Connection resource *Resource Definition* : Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. *Connection Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **connectedSince** | Date | | | *Timestamp when connection was established.* | | **userId1** | ID | | | *FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order.* | | **userId2** | ID | | | *FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair.* | ### ConnectionRequest resource *Resource Definition* : Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. *ConnectionRequest Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **receiverUserId** | ID | | | *FK to auth:user.id — target of the request.* | | **senderUserId** | ID | | | *FK to auth:user.id — user sending the connection request.* | | **sentAt** | Date | | | *Timestamp when request was sent.* | | **status** | Enum | | | *Request status: pending/accepted/rejected.* | | **respondedAt** | Date | | | *Timestamp when receiver accepted/rejected.* | | **message** | String | | | *Optional introductory message from sender to receiver.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### status Enum Property *Property Definition* : Request status: pending/accepted/rejected.*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **pending** | `"pending""` | 0 | | **accepted** | `"accepted""` | 1 | | **rejected** | `"rejected""` | 2 | ## Business Api ### Create Connection API *API Definition* : Create Connection *API Crud Type* : create *Default access route* : *POST* `/v1/connections` #### Parameters The createConnection api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Connection](businessApi/createConnection). ### Delete Connectionrequest API *API Definition* : Sender or receiver may cancel/delete a connection request (soft-delete). *API Crud Type* : delete *Default access route* : *DELETE* `/v1/connectionrequests/:connectionRequestId` #### Parameters The deleteConnectionRequest api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Connectionrequest](businessApi/deleteConnectionRequest). ### Update Connectionrequest API *API Definition* : Allows receiver of a pending connection request to accept or reject request. *API Crud Type* : update *Default access route* : *PATCH* `/v1/connectionrequests/:connectionRequestId` #### Parameters The updateConnectionRequest api has got 3 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Connectionrequest](businessApi/updateConnectionRequest). ### List Connections API *API Definition* : List all active connections where session user is a participant. *API Crud Type* : list *Default access route* : *GET* `/v1/connections` The listConnections api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connections`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connections","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connections":[{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Connections](businessApi/listConnections). ### List Connectionrequests API *API Definition* : List connection requests involving current user, filterable by status (pending, accepted, rejected). *API Crud Type* : list *Default access route* : *GET* `/v1/connectionrequests` The listConnectionRequests api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequests`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequests","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","connectionRequests":[{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Connectionrequests](businessApi/listConnectionRequests). ### Create Connectionrequest API *API Definition* : Send a new connection request from logged-in user to another user. *API Crud Type* : create *Default access route* : *POST* `/v1/connectionrequests` #### Parameters The createConnectionRequest api has got 4 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"POST","action":"create","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Connectionrequest](businessApi/createConnectionRequest). ### Delete Connection API *API Definition* : Break (delete) the connection between two users. Either user may disconnect. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/connections/:connectionId` #### Parameters The deleteConnection api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Connection](businessApi/deleteConnection). ### Get Connectionrequest API *API Definition* : Get a specific connection request by ID if sender/receiver. *API Crud Type* : get *Default access route* : *GET* `/v1/connectionrequests/:connectionRequestId` #### Parameters The getConnectionRequest api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connectionRequest","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connectionRequest":{"id":"ID","receiverUserId":"ID","senderUserId":"ID","sentAt":"Date","status":"Enum","status_idx":"Integer","respondedAt":"Date","message":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Connectionrequest](businessApi/getConnectionRequest). ### Get Connection API *API Definition* : Get connection between session user and another user (if exists, not soft-deleted). *API Crud Type* : get *Default access route* : *GET* `/v1/connections/:connectionId` #### Parameters The getConnection api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"connection","method":"GET","action":"get","appVersion":"Version","rowCount":1,"connection":{"id":"ID","connectedSince":"Date","userId1":"ID","userId2":"ID","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Connection](businessApi/getConnection). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-networking-service** documentation -Version:**`1.0.9`** ## Scope This document provides a structured architectural overview of the `networking` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `Networking` Service Settings [**Edit**](networking/serviceSettings) Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Service Overview This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-networking-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-networking-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `connection` | Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. | accessPrivate | | `connectionRequest` | Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. | accessPrivate | ## connection Data Object ### Object Overview **Description:** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **uniqueUsersPair**: [userId1, userId2] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `connectedSince` | Date | Yes | Timestamp when connection was established. | | `userId1` | ID | Yes | FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. | | `userId2` | ID | Yes | FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **connectedSince**: new Date() - **userId1**: '00000000-0000-0000-0000-000000000000' - **userId2**: '00000000-0000-0000-0000-000000000000' ### Constant Properties `connectedSince` `userId1` `userId2` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Elastic Search Indexing `connectedSince` `userId1` `userId2` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `userId1` `userId2` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Cache Select Properties `userId1` `userId2` Cache select properties are used to collect data from Redis entity cache with a different key than the data object id. This allows you to cache data that is not directly related to the data object id, but a frequently used filter. ### Relation Properties `userId1` `userId2` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **userId1**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **userId2**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Formula Properties `connectedSince` Formula properties are used to define calculated fields that derive their values from other properties or external data. These properties are automatically calculated based on the defined formula and can be used for dynamic data retrieval. - **connectedSince**: Date - Formula: `new Date()` - Calculate After Instance: No ## connectionRequest Data Object ### Object Overview **Description:** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **uniqueConnectionRequestPair**: [senderUserId, receiverUserId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `receiverUserId` | ID | Yes | FK to auth:user.id — target of the request. | | `senderUserId` | ID | Yes | FK to auth:user.id — user sending the connection request. | | `sentAt` | Date | Yes | Timestamp when request was sent. | | `status` | Enum | Yes | Request status: pending/accepted/rejected. | | `respondedAt` | Date | No | Timestamp when receiver accepted/rejected. | | `message` | String | No | Optional introductory message from sender to receiver. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **receiverUserId**: '00000000-0000-0000-0000-000000000000' - **senderUserId**: '00000000-0000-0000-0000-000000000000' - **sentAt**: new Date() - **status**: pending ### Constant Properties `receiverUserId` `senderUserId` `sentAt` `message` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `status` `respondedAt` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **status**: [pending, accepted, rejected] ### Elastic Search Indexing `receiverUserId` `senderUserId` `sentAt` `status` `respondedAt` `message` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `receiverUserId` `senderUserId` `sentAt` `status` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Cache Select Properties `receiverUserId` `senderUserId` `status` Cache select properties are used to collect data from Redis entity cache with a different key than the data object id. This allows you to cache data that is not directly related to the data object id, but a frequently used filter. ### Relation Properties `receiverUserId` `senderUserId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **receiverUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **senderUserId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Session Data Properties `senderUserId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **senderUserId**: ID property will be mapped to the session parameter `userId`. ### Formula Properties `sentAt` Formula properties are used to define calculated fields that derive their values from other properties or external data. These properties are automatically calculated based on the defined formula and can be used for dynamic data retrieval. - **sentAt**: Date - Formula: `new Date()` - Calculate After Instance: No ### Filter Properties `status` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **status**: Enum has a filter named `status` ## Business Logic networking has got 9 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [Create Connection](/businessLogic/createconnection) * [Delete Connectionrequest](/businessLogic/deleteconnectionrequest) * [Update Connectionrequest](/businessLogic/updateconnectionrequest) * [List Connections](/businessLogic/listconnections) * [List Connectionrequests](/businessLogic/listconnectionrequests) * [Create Connectionrequest](/businessLogic/createconnectionrequest) * [Delete Connection](/businessLogic/deleteconnection) * [Get Connectionrequest](/businessLogic/getconnectionrequest) * [Get Connection](/businessLogic/getconnection) ## Edge Controllers ### helloWorld **Configuration:** - **Function Name**: `helloWorld` - **Login Required**: No **REST Settings:** - **Path**: `/helloworld` - **Method**: --- ### sendMail **Configuration:** - **Function Name**: `sendMail` - **Login Required**: Yes **REST Settings:** - **Path**: `/sendmail` - **Method**: --- --- ## Service Library ### Functions #### ensureNoDuplicateOrBlocked.js ```js // Throws if: sender or receiver are the same, already connected, active request exists between these users module.exports = async function ensureNoDuplicateOrBlocked(senderId, receiverId) { if (senderId === receiverId) throw new Error('Cannot connect to yourself.'); // Check for existing connection const existing = await this.sequelize.models.connection.findOne({ where: { isActive: true, [this.sequelize.Op.or]: [ { userId1: senderId, userId2: receiverId }, { userId1: receiverId, userId2: senderId } ] } }); if (existing) throw new Error('Users are already connected.'); // Check for pending requests either direction const req = await this.sequelize.models.connectionRequest.findOne({ where: { isActive: true, status: 0, [this.sequelize.Op.or]: [ { senderUserId: senderId, receiverUserId: receiverId }, { senderUserId: receiverId, receiverUserId: senderId } ] } }); if (req) throw new Error('Active connection request already exists.'); return true; } ``` #### ensureUpdateAllowed.js ```js // Throws if sessionUserId is not receiver or status is not 'pending'. module.exports = function ensureUpdateAllowed(sessionUserId, requestObject) { if (!requestObject) throw new Error('Request not found.'); if (requestObject.status !== 0) throw new Error('Request already responded to.'); if (requestObject.receiverUserId !== sessionUserId) throw new Error('Only the receiver can accept/reject this request.'); return true; }; ``` #### ensureDeleteAllowed.js ```js // Only sender or receiver may delete request. module.exports = function ensureDeleteAllowed(sessionUserId, requestObject) { if (!requestObject) throw new Error('Request not found.'); if (requestObject.senderUserId !== sessionUserId && requestObject.receiverUserId !== sessionUserId) { throw new Error('Unauthorized to delete this request.'); } return true; }; ``` #### ensureDisconnectAllowed.js ```js // User must be part of the connection (sessionUserId == userId1 or userId2) module.exports = function ensureDisconnectAllowed(sessionUserId, otherUserId) { if (!sessionUserId || !otherUserId) throw new Error('Both users required.'); if (sessionUserId === otherUserId) throw new Error('Cannot disconnect from yourself.'); return true; }; ``` ### Hook Functions No hook functions defined. ### Edge Functions #### helloWorld.js ```js module.exports = async (request) => { return { status: 200, message: "Hello from the networking edge function!", date: new Date().toISOString() }; } ``` #### sendMail.js ```js module.exports = async (request) => { throw new Error('Not Implemented: Use notification microservice for emails.'); } ``` ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3001` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* # API INTEGRATION PATTERNS ## Linkedin Admin Panel This document provides comprehensive information about API integration patterns used in the Linkedin Admin Panel, including HTTP client configuration, request/response handling, error management, and performance optimization strategies. ## Architectural Design Credit and Contact Information The architectural design of this API integration system is credited to Mindbricks Genesis Engine. We encourage open communication and welcome any questions or discussions related to the architectural aspects of this API integration system. ## Documentation Scope This guide covers the complete API integration patterns within the Linkedin Admin Panel. It includes HTTP client configuration, request/response handling, error management, caching strategies, and performance optimization techniques. **Intended Audience** This documentation is intended for frontend developers, API integrators, and system architects who need to understand, implement, or maintain API integration patterns within the admin panel. ## HTTP Client Architecture ### Service-Specific Axios Instances **JobApplication Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const jobApplicationAxiosInstance = axios.create({ baseURL: CONFIG.jobApplicationServiceUrl }); jobApplicationAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default jobApplicationAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await jobApplicationAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const jobApplicationEndpoints = { jobPosting: { updateJobPosting: '/v1/jobpostings/:jobPostingId' , deleteJobPosting: '/v1/jobpostings/:jobPostingId' , getJobPosting: '/v1/jobpostings/:jobPostingId' , listJobPostings: '/v1/jobpostings' , createJobPosting: '/v1/jobpostings' }, jobApplication: { deleteJobApplication: '/v1/jobapplications/:jobApplicationId' , getJobApplication: '/v1/jobapplications/:jobApplicationId' , updateJobApplication: '/v1/jobapplications/:jobApplicationId' , createJobApplication: '/v1/jobapplications' , listJobApplications: '/v1/jobapplications' } }; ``` **Networking Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const networkingAxiosInstance = axios.create({ baseURL: CONFIG.networkingServiceUrl }); networkingAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default networkingAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await networkingAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const networkingEndpoints = { connection: { createConnection: '/v1/connections' , listConnections: '/v1/connections' , deleteConnection: '/v1/connections/:connectionId' , getConnection: '/v1/connections/:connectionId' }, connectionRequest: { deleteConnectionRequest: '/v1/connectionrequests/:connectionRequestId' , updateConnectionRequest: '/v1/connectionrequests/:connectionRequestId' , listConnectionRequests: '/v1/connectionrequests' , createConnectionRequest: '/v1/connectionrequests' , getConnectionRequest: '/v1/connectionrequests/:connectionRequestId' } }; ``` **Company Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const companyAxiosInstance = axios.create({ baseURL: CONFIG.companyServiceUrl }); companyAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default companyAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await companyAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const companyEndpoints = { companyFollower: { followCompany: '/v1/followcompany' , unfollowCompany: '/v1/unfollowcompany/:companyFollowerId' , listCompanyFollowers: '/v1/companyfollowers' , getCompanyFollower: '/v1/companyfollowers/:companyFollowerId' }, companyUpdate: { getCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , createCompanyUpdate: '/v1/companyupdates' , updateCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , deleteCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , listCompanyUpdates: '/v1/companyupdates' }, company: { createCompany: '/v1/companies' , getCompany: '/v1/companies/:companyId' , listCompanies: '/v1/companies' , updateCompany: '/v1/companies/:companyId' , deleteCompany: '/v1/companies/:companyId' }, companyAdmin: { getCompanyAdmin: '/v1/companyadmins/:companyAdminId' , removeCompanyAdmin: '/v1/removecompanyadmin/:companyAdminId' , assignCompanyAdmin: '/v1/assigncompanyadmin' , listCompanyAdmins: '/v1/companyadmins' } }; ``` **Content Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const contentAxiosInstance = axios.create({ baseURL: CONFIG.contentServiceUrl }); contentAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default contentAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await contentAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const contentEndpoints = { post: { createPost: '/v1/posts' , listPosts: '/v1/posts' , getPost: '/v1/posts/:postId' , deletePost: '/v1/posts/:postId' , updatePost: '/v1/posts/:postId' , listUserPosts: '/v1/userposts' }, like: { likePost: '/v1/likepost' , listLikes: '/v1/likes' , unlikePost: '/v1/unlikepost/:likeId' }, comment: { updateComment: '/v1/comments/:commentId' , createComment: '/v1/comments' , listComments: '/v1/comments' , getComment: '/v1/comments/:commentId' , deleteComment: '/v1/comments/:commentId' } }; ``` **Messaging Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const messagingAxiosInstance = axios.create({ baseURL: CONFIG.messagingServiceUrl }); messagingAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default messagingAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await messagingAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const messagingEndpoints = { message: { listMessages: '/v1/messages' , getMessage: '/v1/messages/:messageId' , updateMessage: '/v1/messages/:messageId' , deleteMessage: '/v1/messages/:messageId' , createMessage: '/v1/messages' }, conversation: { updateConversation: '/v1/conversations/:conversationId' , getConversation: '/v1/conversations/:conversationId' , deleteConversation: '/v1/conversations/:conversationId' , listConversations: '/v1/conversations' , createConversation: '/v1/conversations' } }; ``` **Profile Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const profileAxiosInstance = axios.create({ baseURL: CONFIG.profileServiceUrl }); profileAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default profileAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await profileAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const profileEndpoints = { profile: { updateProfile: '/v1/profiles/:profileId' , deleteProfile: '/v1/profiles/:profileId' , listProfiles: '/v1/profiles' , createProfile: '/v1/profiles' , getProfile: '/v1/profiles/:profileId' }, premiumsubscription: { deletePremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , createPremuimSub: '/v1/premuimsub' , updatePremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , getPremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , listPremuimSub: '/v1/premuimsub' , startPremiumsubscriptionPayment: '/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId' , refreshPremiumsubscriptionPayment: '/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId' , callbackPremiumsubscriptionPayment: '/v1/callbackpremiumsubscriptionpayment' }, certification: { updateCertification: '/v1/certifications/:certificationId' , listCertifications: '/v1/certifications' , createCertification: '/v1/certifications' , getCertification: '/v1/certifications/:certificationId' , deleteCertification: '/v1/certifications/:certificationId' }, language: { deleteLanguage: '/v1/languages/:languageId' , updateLanguage: '/v1/languages/:languageId' , listLanguages: '/v1/languages' , getLanguage: '/v1/languages/:languageId' , createLanguage: '/v1/languages' }, sys_premiumsubscriptionPayment: { getPremiumsubscriptionPayment2: '/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId' , listPremiumsubscriptionPayments2: '/v1/premiumsubscriptionpayments2' , createPremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment' , updatePremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId' , deletePremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId' , listPremiumsubscriptionPayments2: '/v1/premiumsubscriptionpayments2' , getPremiumsubscriptionPaymentByOrderId: '/v1/premiumsubscriptionpaymentbyorderid/:orderId' , getPremiumsubscriptionPaymentByPaymentId: '/v1/premiumsubscriptionpaymentbypaymentid/:paymentId' , getPremiumsubscriptionPayment2: '/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId' }, sys_paymentCustomer: { getPaymentCustomerByUserId: '/v1/paymentcustomers/:userId' , listPaymentCustomers: '/v1/paymentcustomers' }, sys_paymentMethod: { listPaymentCustomerMethods: '/v1/paymentcustomermethods/:userId' } }; ``` **Auth Axios Configuration** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const authAxiosInstance = axios.create({ baseURL: CONFIG.authServiceUrl }); authAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default authAxiosInstance; ``` **Fetcher Utility** ```javascript export const fetcher = async (args) => { try { const [url, config] = Array.isArray(args) ? args : [args]; const res = await authAxiosInstance.get(url, { ...config }); return res.data; } catch (error) { console.error('Failed to fetch:', error); throw error; } }; ``` **Service Endpoints** ```javascript export const authEndpoints = { login: "/login", me: "/v1/users/:userId", logout: "/logout", user: { getUser: '/v1/users/:userId' , updateUser: '/v1/users/:userId' , updateProfile: '/v1/profile/:userId' , createUser: '/v1/users' , deleteUser: '/v1/users/:userId' , archiveProfile: '/v1/archiveprofile/:userId' , listUsers: '/v1/users' , searchUsers: '/v1/searchusers' , updateUserRole: '/v1/userrole/:userId' , updateUserPassword: '/v1/userpassword/:userId' , updateUserPasswordByAdmin: '/v1/userpasswordbyadmin/:userId' , getBriefUser: '/v1/briefuser/:userId' , registerUser: '/v1/registeruser' } }; ``` ### Service Integration **JobApplication Service Integration** The JobApplication service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `JobPosting` data object management - `JobApplication` data object management **Networking Service Integration** The Networking service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `Connection` data object management - `ConnectionRequest` data object management **Company Service Integration** The Company service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `CompanyFollower` data object management - `CompanyUpdate` data object management - `Company` data object management - `CompanyAdmin` data object management **Content Service Integration** The Content service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `Post` data object management - `Like` data object management - `Comment` data object management **Messaging Service Integration** The Messaging service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `Message` data object management - `Conversation` data object management **Profile Service Integration** The Profile service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `Profile` data object management - `Premiumsubscription` data object management - `Certification` data object management - `Language` data object management - `Sys_premiumsubscriptionPayment` data object management - `Sys_paymentCustomer` data object management - `Sys_paymentMethod` data object management **Auth Service Integration** The Auth service is integrated using: - Service-specific Axios instance with base URL configuration - Dynamic endpoint generation based on business logic - Error handling through response interceptors - Fetcher utility for data retrieval **Available Endpoints:** - `User` data object management ## Request/Response Patterns ### Standard Request Format **Request Structure** ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await jobApplicationAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await networkingAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await companyAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await contentAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await messagingAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await profileAxiosInstance.post('/endpoint', data); ``` ```javascript // Simple GET request const response = await fetcher('/endpoint'); // GET request with parameters const response = await fetcher(['/endpoint', { params: { id: 1 } }]); // POST request const response = await authAxiosInstance.post('/endpoint', data); ``` ### Response Handling **Standard Response Format** ```javascript // Success response const response = await fetcher('/endpoint'); // response contains the data directly // Error handling try { const response = await fetcher('/endpoint'); } catch (error) { console.error('API Error:', error); // Error is already processed by the interceptor } ``` ### Pagination Handling **Pagination Implementation** ```javascript // Pagination is handled by the data grid component // The MUI DataGrid handles pagination automatically ``` ## Error Handling Patterns ### Error Classification **Error Types** ```javascript // Basic error handling through Axios interceptors // Errors are processed and simplified before reaching components ``` ### Error Handler **Centralized Error Handling** ```javascript class APIErrorHandler { handleError(error) { if (error.response) { // Server responded with error status return this.handleServerError(error); } else if (error.request) { // Network error return this.handleNetworkError(error); } else { // Other error return this.handleUnknownError(error); } } handleServerError(error) { const { status, data } = error.response; switch (status) { case 400: return new ValidationError( data.message || 'Validation failed', data.errors || [] ); case 401: return new AuthenticationError( data.message || 'Authentication required' ); case 403: return new AuthorizationError( data.message || 'Access denied' ); case 404: return new APIError( data.message || 'Resource not found', 404, 'NOT_FOUND' ); case 429: return new APIError( data.message || 'Rate limit exceeded', 429, 'RATE_LIMIT' ); case 500: return new APIError( data.message || 'Internal server error', 500, 'SERVER_ERROR' ); default: return new APIError( data.message || 'Unknown server error', status, 'UNKNOWN_ERROR' ); } } handleNetworkError(error) { return new NetworkError( 'Network error occurred', error ); } handleUnknownError(error) { return new APIError( error.message || 'Unknown error occurred', 0, 'UNKNOWN_ERROR' ); } } ``` ### Retry Mechanisms **Exponential Backoff Retry** ```javascript class RetryManager { constructor(options = {}) { this.maxRetries = options.maxRetries || 3; this.baseDelay = options.baseDelay || 1000; this.maxDelay = options.maxDelay || 10000; this.retryableStatusCodes = options.retryableStatusCodes || [408, 429, 500, 502, 503, 504]; } async executeWithRetry(operation, context = {}) { let lastError; for (let attempt = 0; attempt <= this.maxRetries; attempt++) { try { return await operation(); } catch (error) { lastError = error; if (attempt === this.maxRetries || !this.shouldRetry(error)) { break; } const delay = this.calculateDelay(attempt); await this.sleep(delay); } } throw lastError; } shouldRetry(error) { return false; } calculateDelay(attempt) { return 0; } sleep(ms) { return Promise.resolve(); } } ``` ## Performance Optimization ### Request Batching **Batch Request Manager** ```javascript class BatchRequestManager { constructor(apiClient) { this.apiClient = apiClient; this.pendingRequests = new Map(); this.batchTimeout = 100; // 100ms } async batchRequest(endpoint, data, options = {}) { const batchKey = this.generateBatchKey(endpoint, options); if (!this.pendingRequests.has(batchKey)) { this.pendingRequests.set(batchKey, []); } const request = { data: data, resolve: null, reject: null, timestamp: Date.now() }; const promise = new Promise((resolve, reject) => { request.resolve = resolve; request.reject = reject; }); this.pendingRequests.get(batchKey).push(request); // Process batch after timeout setTimeout(() => this.processBatch(batchKey), this.batchTimeout); return promise; } async processBatch(batchKey) { const requests = this.pendingRequests.get(batchKey); if (!requests || requests.length === 0) return; this.pendingRequests.delete(batchKey); try { const [serviceName, endpoint] = batchKey.split(':'); const batchData = requests.map(req => req.data); const response = await this.apiClient.post(`/${endpoint}/batch`, { requests: batchData }); requests.forEach((request, index) => { if (response.data.results[index].success) { request.resolve(response.data.results[index].data); } else { request.reject(new Error(response.data.results[index].error)); } }); } catch (error) { requests.forEach(request => { request.reject(error); }); } } } ``` # AUTHENTICATION FLOW ## Linkedin Admin Panel This document provides comprehensive information about the authentication system implemented in the Linkedin Admin Panel, including login flows, token management, session handling, and security considerations. ## Architectural Design Credit and Contact Information The architectural design of this authentication system is credited to Mindbricks Genesis Engine. We encourage open communication and welcome any questions or discussions related to the architectural aspects of this authentication system. ## Documentation Scope This guide covers the complete authentication flow within the Linkedin Admin Panel. It includes login processes, token management, session handling, multi-tenant support, and security best practices. **Intended Audience** This documentation is intended for frontend developers, security engineers, and system administrators who need to understand, implement, or maintain the authentication system within the admin panel. ## Authentication Architecture ### Overview The admin panel implements a comprehensive authentication system that integrates with the project's authentication service. It supports JWT-based authentication, session management, and cross-domain authentication. ### Authentication Components **Core Components** - **Auth Service Integration**: Communication with backend authentication service - **Token Management**: JWT token storage and validation - **Session Management**: User session state and persistence - **Route Protection**: Authentication guards for protected routes - **Cross-Domain Authentication**: Support for cross-domain cookie authentication ## Login Flow ### Standard Login Process **Step 1: Login Form Display** The login form uses React Hook Form with Zod validation for username and password fields. **Step 2: Credential Submission** ```javascript const onSubmit = handleSubmit(async (data) => { try { await signInWithPassword({ username: data.username, password: data.password }); await checkUserSession?.(); router.push("/panel"); } catch (error) { const feedbackMessage = getErrorMessage(error); setErrorMessage(feedbackMessage); } }); ``` **Step 3: Session Establishment** The session is established through the `setSession` utility which stores the JWT token in sessionStorage and sets up cross-tab communication. ### Cross-Domain Authentication The admin panel supports cross-domain authentication through cookie-based token sharing: **Cross-Domain Token Detection** ```javascript export function getCrossDomainAuthToken() { const projectCodename = 'linkedin'; const cookieName = `${projectCodename}-access-token`; return getCookie(cookieName); } ``` **Cross-Domain Session Validation** ```javascript export async function validateCrossDomainSession(accessToken) { try { if (!accessToken || !isValidToken(accessToken)) { return null; } const decodedToken = jwtDecode(accessToken); if (!decodedToken?.userId) { return null; } const res = await authAxios.get(`/v1/users/${decodedToken.userId}`, { headers: { 'Authorization': `Bearer ${accessToken}` } }); return res.data?.user || null; } catch (error) { console.error('Error validating cross-domain session:', error); return null; } } ``` ## Token Management ### JWT Token Handling **Token Storage** ```javascript export async function setSession(accessToken) { try { if (accessToken) { sessionStorage.setItem(JWT_STORAGE_KEY, accessToken); // Trigger custom event for cross-tab communication window.dispatchEvent(new CustomEvent('auth-session-changed', { detail: { action: 'login', token: accessToken } })); // Set authorization headers for all service clients jobApplicationAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; networkingAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; companyAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; contentAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; messagingAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; profileAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; authAxios.defaults.headers.common.Authorization = `Bearer ${accessToken}`; const decodedToken = jwtDecode(accessToken); if (!decodedToken) { throw new Error("Invalid access token!"); } return decodedToken; } else { // Clear session sessionStorage.removeItem(JWT_STORAGE_KEY); window.dispatchEvent(new CustomEvent('auth-session-changed', { detail: { action: 'logout', token: null } })); delete jobApplicationAxios.defaults.headers.common.Authorization; delete networkingAxios.defaults.headers.common.Authorization; delete companyAxios.defaults.headers.common.Authorization; delete contentAxios.defaults.headers.common.Authorization; delete messagingAxios.defaults.headers.common.Authorization; delete profileAxios.defaults.headers.common.Authorization; delete authAxios.defaults.headers.common.Authorization; return null; } } catch (error) { console.error('Error during set session:', error); throw error; } } ``` **Token Validation** ```javascript export function isValidToken(accessToken) { if (!accessToken) { return false; } try { return jwtDecode(accessToken); } catch (error) { console.error('Error during token validation:', error); return false; } } ``` ### Session Management **AuthProvider Implementation** ```javascript export function AuthProvider({ children }) { const { state, setState } = useSetState({ user: null, loading: true }); const checkUserSession = useCallback(async () => { try { // First, check for existing session in sessionStorage let accessToken = sessionStorage.getItem(JWT_STORAGE_KEY); let user = null; if (accessToken && isValidToken(accessToken)) { // Validate existing session const decodedToken = await setSession(accessToken); const res = await authAxios.get(`${authEndpoints.me.replace(":userId",decodedToken?.userId)}`); user = res.data?.user; } else if (canAccessCrossDomainCookies()) { // Check for cross-domain authentication cookie const crossDomainToken = getCrossDomainAuthToken(); if (crossDomainToken) { user = await validateCrossDomainSession(crossDomainToken); if (user) { await setSession(crossDomainToken); accessToken = crossDomainToken; } } } if (user && accessToken) { setState({ user: { ...user, accessToken }, loading: false }); } else { setState({ user: null, loading: false }); } } catch (error) { console.error('Error checking user session:', error); setState({ user: null, loading: false }); } }, []); // ... rest of implementation } ``` ### Role-Based Access Control **RoleBasedGuard Implementation** ```javascript export function RoleBasedGuard({ sx, children, hasContent, currentRole, acceptRoles }) { if (typeof acceptRoles !== 'undefined' && !acceptRoles.includes(currentRole)) { return hasContent ? ( Permission denied You do not have permission to access this page. ) : null; } return <> {children} ; } ``` ## Logout Flow ### Logout Process **Logout Implementation** ```javascript export const signOut = async () => { try { await authAxios.post(authEndpoints.logout); await setSession(null); } catch (error) { console.error("Error during sign out:", error); throw error; } }; ``` **Session Cleanup** The `setSession(null)` function handles all cleanup: - Removes JWT token from sessionStorage - Triggers cross-tab logout event - Clears authorization headers from all service clients - Returns null to indicate no active session ## Security Considerations ### Token Security **JWT Token Validation** ```javascript export function jwtDecode(token) { try { if (!token) return null; const parts = token.split('.'); if (parts.length < 2) { throw new Error('Invalid token!'); } const base64Url = parts[1]; const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); const decoded = JSON.parse(atob(base64)); return decoded; } catch (error) { console.error('Error decoding token:', error); throw error; } } ``` ### Input Validation **Login Form Validation** The login form uses Zod schema validation: ```javascript export const LoginSchema = zod.object({ username: zod.string().min(1, { message: 'User name is required!' }), password: zod.string().min(1, { message: 'Password is required!' }), }); ``` ## Error Handling ### Authentication Errors **Error Message Handling** ```javascript // Error messages are displayed to users // Basic error handling is implemented ``` The admin panel uses a centralized error message utility (`getErrorMessage`) to handle authentication errors and display user-friendly messages. # DATA OBJECT MANAGEMENT ## Linkedin Admin Panel This document provides comprehensive information about how the Linkedin Admin Panel manages data objects, including CRUD operations, validation, relationships, and user interface generation. ## Architectural Design Credit and Contact Information The architectural design of this data object management system is credited to Mindbricks Genesis Engine. We encourage open communication and welcome any questions or discussions related to the architectural aspects of this data object management system. ## Documentation Scope This guide covers the complete data object management system within the Linkedin Admin Panel. It includes dynamic UI generation, CRUD operations, data validation, relationship management, and user experience patterns. **Intended Audience** This documentation is intended for frontend developers, UI/UX designers, and system administrators who need to understand how data objects are managed, displayed, and manipulated within the admin panel. ## Data Object Architecture ### Overview The admin panel implements a basic data object management system that generates simple CRUD interfaces for data objects defined in the backend services. Each data object is represented by a data grid for listing and basic modal components for create/update/delete operations. ### Data Object Structure **Core Data Object Properties** - **Name**: Unique identifier for the data object - **Display Name**: Human-readable name for UI display - **Component Name**: React component name for rendering - **Properties**: Array of data object properties with types ### Dynamic UI Generation **Component Generation Pattern** ```javascript // Data object component structure JobApplication jobPosting const DataObjectComponentJobApplicationJobPosting = { // List view for displaying multiple records ListView: { component: 'JobApplicationJobPostingAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'JobApplicationJobPostingAppPageCreateModal', lazy: true }, UpdateModal: { component: 'JobApplicationJobPostingAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'JobApplicationJobPostingAppPageDeleteModal', lazy: true } }; // Data object component structure JobApplication jobApplication const DataObjectComponentJobApplicationJobApplication = { // List view for displaying multiple records ListView: { component: 'JobApplicationJobApplicationAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'JobApplicationJobApplicationAppPageCreateModal', lazy: true }, UpdateModal: { component: 'JobApplicationJobApplicationAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'JobApplicationJobApplicationAppPageDeleteModal', lazy: true } }; // Data object component structure Networking connection const DataObjectComponentNetworkingConnection = { // List view for displaying multiple records ListView: { component: 'NetworkingConnectionAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'NetworkingConnectionAppPageCreateModal', lazy: true }, UpdateModal: { component: 'NetworkingConnectionAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'NetworkingConnectionAppPageDeleteModal', lazy: true } }; // Data object component structure Networking connectionRequest const DataObjectComponentNetworkingConnectionRequest = { // List view for displaying multiple records ListView: { component: 'NetworkingConnectionRequestAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'NetworkingConnectionRequestAppPageCreateModal', lazy: true }, UpdateModal: { component: 'NetworkingConnectionRequestAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'NetworkingConnectionRequestAppPageDeleteModal', lazy: true } }; // Data object component structure Company companyFollower const DataObjectComponentCompanyCompanyFollower = { // List view for displaying multiple records ListView: { component: 'CompanyCompanyFollowerAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'CompanyCompanyFollowerAppPageCreateModal', lazy: true }, UpdateModal: { component: 'CompanyCompanyFollowerAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'CompanyCompanyFollowerAppPageDeleteModal', lazy: true } }; // Data object component structure Company companyUpdate const DataObjectComponentCompanyCompanyUpdate = { // List view for displaying multiple records ListView: { component: 'CompanyCompanyUpdateAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'CompanyCompanyUpdateAppPageCreateModal', lazy: true }, UpdateModal: { component: 'CompanyCompanyUpdateAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'CompanyCompanyUpdateAppPageDeleteModal', lazy: true } }; // Data object component structure Company company const DataObjectComponentCompanyCompany = { // List view for displaying multiple records ListView: { component: 'CompanyCompanyAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'CompanyCompanyAppPageCreateModal', lazy: true }, UpdateModal: { component: 'CompanyCompanyAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'CompanyCompanyAppPageDeleteModal', lazy: true } }; // Data object component structure Company companyAdmin const DataObjectComponentCompanyCompanyAdmin = { // List view for displaying multiple records ListView: { component: 'CompanyCompanyAdminAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'CompanyCompanyAdminAppPageCreateModal', lazy: true }, UpdateModal: { component: 'CompanyCompanyAdminAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'CompanyCompanyAdminAppPageDeleteModal', lazy: true } }; // Data object component structure Content post const DataObjectComponentContentPost = { // List view for displaying multiple records ListView: { component: 'ContentPostAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ContentPostAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ContentPostAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ContentPostAppPageDeleteModal', lazy: true } }; // Data object component structure Content like const DataObjectComponentContentLike = { // List view for displaying multiple records ListView: { component: 'ContentLikeAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ContentLikeAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ContentLikeAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ContentLikeAppPageDeleteModal', lazy: true } }; // Data object component structure Content comment const DataObjectComponentContentComment = { // List view for displaying multiple records ListView: { component: 'ContentCommentAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ContentCommentAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ContentCommentAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ContentCommentAppPageDeleteModal', lazy: true } }; // Data object component structure Messaging message const DataObjectComponentMessagingMessage = { // List view for displaying multiple records ListView: { component: 'MessagingMessageAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'MessagingMessageAppPageCreateModal', lazy: true }, UpdateModal: { component: 'MessagingMessageAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'MessagingMessageAppPageDeleteModal', lazy: true } }; // Data object component structure Messaging conversation const DataObjectComponentMessagingConversation = { // List view for displaying multiple records ListView: { component: 'MessagingConversationAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'MessagingConversationAppPageCreateModal', lazy: true }, UpdateModal: { component: 'MessagingConversationAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'MessagingConversationAppPageDeleteModal', lazy: true } }; // Data object component structure Profile profile const DataObjectComponentProfileProfile = { // List view for displaying multiple records ListView: { component: 'ProfileProfileAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileProfileAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileProfileAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileProfileAppPageDeleteModal', lazy: true } }; // Data object component structure Profile premiumsubscription const DataObjectComponentProfilePremiumsubscription = { // List view for displaying multiple records ListView: { component: 'ProfilePremiumsubscriptionAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfilePremiumsubscriptionAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfilePremiumsubscriptionAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfilePremiumsubscriptionAppPageDeleteModal', lazy: true } }; // Data object component structure Profile certification const DataObjectComponentProfileCertification = { // List view for displaying multiple records ListView: { component: 'ProfileCertificationAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileCertificationAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileCertificationAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileCertificationAppPageDeleteModal', lazy: true } }; // Data object component structure Profile language const DataObjectComponentProfileLanguage = { // List view for displaying multiple records ListView: { component: 'ProfileLanguageAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileLanguageAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileLanguageAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileLanguageAppPageDeleteModal', lazy: true } }; // Data object component structure Profile sys_premiumsubscriptionPayment const DataObjectComponentProfileSys_premiumsubscriptionPayment = { // List view for displaying multiple records ListView: { component: 'ProfileSys_premiumsubscriptionPaymentAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileSys_premiumsubscriptionPaymentAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileSys_premiumsubscriptionPaymentAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileSys_premiumsubscriptionPaymentAppPageDeleteModal', lazy: true } }; // Data object component structure Profile sys_paymentCustomer const DataObjectComponentProfileSys_paymentCustomer = { // List view for displaying multiple records ListView: { component: 'ProfileSys_paymentCustomerAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileSys_paymentCustomerAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileSys_paymentCustomerAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileSys_paymentCustomerAppPageDeleteModal', lazy: true } }; // Data object component structure Profile sys_paymentMethod const DataObjectComponentProfileSys_paymentMethod = { // List view for displaying multiple records ListView: { component: 'ProfileSys_paymentMethodAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'ProfileSys_paymentMethodAppPageCreateModal', lazy: true }, UpdateModal: { component: 'ProfileSys_paymentMethodAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'ProfileSys_paymentMethodAppPageDeleteModal', lazy: true } }; // Data object component structure Auth user const DataObjectComponentAuthUser = { // List view for displaying multiple records ListView: { component: 'AuthUserAppPage', features: ['data-grid', 'export', 'filtering', 'search'] }, // Modal components for data manipulation CreateModal: { component: 'AuthUserAppPageCreateModal', lazy: true }, UpdateModal: { component: 'AuthUserAppPageUpdateModal', lazy: true }, // Action components DeleteModal: { component: 'AuthUserAppPageDeleteModal', lazy: true } }; ``` ## Service Data Objects ### JobApplication Service Data Objects **Service Overview** - **Service Name**: `jobApplication` - **Service Display Name**: `JobApplication` - **Total Data Objects**: 2 **Data Objects** #### JobPosting Data Object **Basic Information** - **Object Name**: `jobPosting` - **Display Name**: `JobPosting` - **Component Name**: `JobApplicationJobPostingAppPage` - **Description**: Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **description** | Text | | N/A | *Detailed description of the job posting.* | | **title** | String | | N/A | *Job title/position name.* | | **applicationDeadline** | Date | | N/A | *Last date for accepting applications. Checked during apply.* | | **companyId** | ID | | N/A | *Company offering the job. FK to company:company* | | **employmentType** | Enum | | N/A | *Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other).* | | **postedByUserId** | ID | | N/A | *User (admin/recruiter) who posted the job. FK to auth:user; used for ownership.* | | **salaryRange** | String | | N/A | *Human-readable salary range (free-form for v1; can be refined later).* | | **location** | String | | N/A | *Primary job location (city, country, etc.)* | | **visibility** | Enum | | N/A | *Controls who can see/apply to this job: public (all) or private (admins only).* | | **workplaceType** | Enum | | N/A | *Workplace type (on-site,remote,hybrid).* | | **status** | Enum | | N/A | *status : active or closed* | | **companyName** | String | | N/A | *company name* | **Enum Properties** ##### employmentType Enum Property *Property Definition*: Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). *Enum Options* | Name | Value | Index | |------|-------|-------| | **full_time** | `"full_time"` | 0 | | **part_time** | `"part_time"` | 1 | | **contract** | `"contract"` | 2 | | **internship** | `"internship"` | 3 | | **volunteer** | `"volunteer"` | 4 | | **other** | `"other"` | 5 | | **temporary** | `"temporary"` | 6 | ##### visibility Enum Property *Property Definition*: Controls who can see/apply to this job: public (all) or private (admins only). *Enum Options* | Name | Value | Index | |------|-------|-------| | **public** | `"public"` | 0 | | **private** | `"private"` | 1 | ##### workplaceType Enum Property *Property Definition*: Workplace type (on-site,remote,hybrid). *Enum Options* | Name | Value | Index | |------|-------|-------| | **on_site** | `"on_site"` | 0 | | **remote** | `"remote"` | 1 | | **hybrid** | `"hybrid"` | 2 | ##### status Enum Property *Property Definition*: status : active or closed *Enum Options* | Name | Value | Index | |------|-------|-------| | **active** | `"active"` | 0 | | **closed** | `"closed"` | 1 | **Generated UI Components** - **List Component**: `JobApplicationJobPostingAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `JobApplicationJobPostingAppPageCreateModal` - Form for creating new records - **Update Modal**: `JobApplicationJobPostingAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `JobApplicationJobPostingAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /jobPosting/list` - Retrieve paginated list of records - **Get**: `GET /jobPosting/get` - Retrieve single record by ID - **Create**: `POST /jobPosting/create` - Create new record - **Update**: `PUT /jobPosting/update` - Update existing record - **Delete**: `DELETE /jobPosting/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/jobApplication/jobPosting` - **Create Route**: `/dashboard/jobApplication/jobPosting/create` - **Update Route**: `/dashboard/jobApplication/jobPosting/update/:id` - **Delete Route**: `/dashboard/jobApplication/jobPosting/delete/:id` #### JobApplication Data Object **Basic Information** - **Object Name**: `jobApplication` - **Display Name**: `JobApplication` - **Component Name**: `JobApplicationJobApplicationAppPage` - **Description**: Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **jobPostingId** | ID | | N/A | *FK to jobPosting: job applied for.* | | **applicantUserId** | ID | | N/A | *User who submitted the application. FK to auth:user.id; used for ownership.* | | **coverLetter** | Text | | N/A | *User's (optional) cover letter/body with application.* | | **resumeUrl** | String | | N/A | *URL/path to user resume/doc to share with recruiter/admin. User-provided.* | | **lastStatusUpdateAt** | Date | | N/A | *Timestamp of latest status change (set when status is updated).* | | **status** | Enum | | N/A | *Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job.* | | **appliedAt** | Date | | N/A | *Timestamp when application was submitted. Set automatically on create.* | **Enum Properties** ##### status Enum Property *Property Definition*: Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. *Enum Options* | Name | Value | Index | |------|-------|-------| | **submitted** | `"submitted"` | 0 | | **in_review** | `"in_review"` | 1 | | **accepted** | `"accepted"` | 2 | | **rejected** | `"rejected"` | 3 | **Generated UI Components** - **List Component**: `JobApplicationJobApplicationAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `JobApplicationJobApplicationAppPageCreateModal` - Form for creating new records - **Update Modal**: `JobApplicationJobApplicationAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `JobApplicationJobApplicationAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /jobApplication/list` - Retrieve paginated list of records - **Get**: `GET /jobApplication/get` - Retrieve single record by ID - **Create**: `POST /jobApplication/create` - Create new record - **Update**: `PUT /jobApplication/update` - Update existing record - **Delete**: `DELETE /jobApplication/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/jobApplication/jobApplication` - **Create Route**: `/dashboard/jobApplication/jobApplication/create` - **Update Route**: `/dashboard/jobApplication/jobApplication/update/:id` - **Delete Route**: `/dashboard/jobApplication/jobApplication/delete/:id` ### Networking Service Data Objects **Service Overview** - **Service Name**: `networking` - **Service Display Name**: `Networking` - **Total Data Objects**: 2 **Data Objects** #### Connection Data Object **Basic Information** - **Object Name**: `connection` - **Display Name**: `Connection` - **Component Name**: `NetworkingConnectionAppPage` - **Description**: Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **connectedSince** | Date | | N/A | *Timestamp when connection was established.* | | **userId1** | ID | | N/A | *FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order.* | | **userId2** | ID | | N/A | *FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair.* | **Generated UI Components** - **List Component**: `NetworkingConnectionAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `NetworkingConnectionAppPageCreateModal` - Form for creating new records - **Update Modal**: `NetworkingConnectionAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `NetworkingConnectionAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /connection/list` - Retrieve paginated list of records - **Get**: `GET /connection/get` - Retrieve single record by ID - **Create**: `POST /connection/create` - Create new record - **Update**: `PUT /connection/update` - Update existing record - **Delete**: `DELETE /connection/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/networking/connection` - **Create Route**: `/dashboard/networking/connection/create` - **Update Route**: `/dashboard/networking/connection/update/:id` - **Delete Route**: `/dashboard/networking/connection/delete/:id` #### ConnectionRequest Data Object **Basic Information** - **Object Name**: `connectionRequest` - **Display Name**: `ConnectionRequest` - **Component Name**: `NetworkingConnectionRequestAppPage` - **Description**: Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **receiverUserId** | ID | | N/A | *FK to auth:user.id — target of the request.* | | **senderUserId** | ID | | N/A | *FK to auth:user.id — user sending the connection request.* | | **sentAt** | Date | | N/A | *Timestamp when request was sent.* | | **status** | Enum | | N/A | *Request status: pending/accepted/rejected.* | | **respondedAt** | Date | | N/A | *Timestamp when receiver accepted/rejected.* | | **message** | String | | N/A | *Optional introductory message from sender to receiver.* | **Enum Properties** ##### status Enum Property *Property Definition*: Request status: pending/accepted/rejected. *Enum Options* | Name | Value | Index | |------|-------|-------| | **pending** | `"pending"` | 0 | | **accepted** | `"accepted"` | 1 | | **rejected** | `"rejected"` | 2 | **Generated UI Components** - **List Component**: `NetworkingConnectionRequestAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `NetworkingConnectionRequestAppPageCreateModal` - Form for creating new records - **Update Modal**: `NetworkingConnectionRequestAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `NetworkingConnectionRequestAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /connectionRequest/list` - Retrieve paginated list of records - **Get**: `GET /connectionRequest/get` - Retrieve single record by ID - **Create**: `POST /connectionRequest/create` - Create new record - **Update**: `PUT /connectionRequest/update` - Update existing record - **Delete**: `DELETE /connectionRequest/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/networking/connectionRequest` - **Create Route**: `/dashboard/networking/connectionRequest/create` - **Update Route**: `/dashboard/networking/connectionRequest/update/:id` - **Delete Route**: `/dashboard/networking/connectionRequest/delete/:id` ### Company Service Data Objects **Service Overview** - **Service Name**: `company` - **Service Display Name**: `Company` - **Total Data Objects**: 4 **Data Objects** #### CompanyFollower Data Object **Basic Information** - **Object Name**: `companyFollower` - **Display Name**: `CompanyFollower` - **Component Name**: `CompanyCompanyFollowerAppPage` - **Description**: Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **userId** | ID | | N/A | *FK to auth:user who follows the company.* | | **companyId** | ID | | N/A | *FK to company:company being followed.* | | **followedAt** | Date | | N/A | *Timestamp when user followed company.* | **Generated UI Components** - **List Component**: `CompanyCompanyFollowerAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `CompanyCompanyFollowerAppPageCreateModal` - Form for creating new records - **Update Modal**: `CompanyCompanyFollowerAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `CompanyCompanyFollowerAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /companyFollower/list` - Retrieve paginated list of records - **Get**: `GET /companyFollower/get` - Retrieve single record by ID - **Create**: `POST /companyFollower/create` - Create new record - **Update**: `PUT /companyFollower/update` - Update existing record - **Delete**: `DELETE /companyFollower/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/company/companyFollower` - **Create Route**: `/dashboard/company/companyFollower/create` - **Update Route**: `/dashboard/company/companyFollower/update/:id` - **Delete Route**: `/dashboard/company/companyFollower/delete/:id` #### CompanyUpdate Data Object **Basic Information** - **Object Name**: `companyUpdate` - **Display Name**: `CompanyUpdate` - **Component Name**: `CompanyCompanyUpdateAppPage` - **Description**: A post/news update created by company admin and visible to followers depending on visibility. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **companyId** | ID | | N/A | *FK to company whose update this is.* | | **content** | Text | | N/A | *Body/content of the update/news item.* | | **authorUserId** | ID | | N/A | *FK to auth:user who authored the update (must be active admin at time of post).* | | **attachmentUrls** | String | | N/A | *Array of URLs for update attachments (files, images, links).* | | **visibility** | Enum | | N/A | *Update visibility: public (all) or private (followers only).* | **Enum Properties** ##### visibility Enum Property *Property Definition*: Update visibility: public (all) or private (followers only). *Enum Options* | Name | Value | Index | |------|-------|-------| | **public** | `"public"` | 0 | | **private** | `"private"` | 1 | **Generated UI Components** - **List Component**: `CompanyCompanyUpdateAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `CompanyCompanyUpdateAppPageCreateModal` - Form for creating new records - **Update Modal**: `CompanyCompanyUpdateAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `CompanyCompanyUpdateAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /companyUpdate/list` - Retrieve paginated list of records - **Get**: `GET /companyUpdate/get` - Retrieve single record by ID - **Create**: `POST /companyUpdate/create` - Create new record - **Update**: `PUT /companyUpdate/update` - Update existing record - **Delete**: `DELETE /companyUpdate/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/company/companyUpdate` - **Create Route**: `/dashboard/company/companyUpdate/create` - **Update Route**: `/dashboard/company/companyUpdate/update/:id` - **Delete Route**: `/dashboard/company/companyUpdate/delete/:id` #### Company Data Object **Basic Information** - **Object Name**: `company` - **Display Name**: `Company` - **Component Name**: `CompanyCompanyAppPage` - **Description**: Represents a company profile and brand presence/pages on the network. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **name** | String | | N/A | *Company brand name. Displayed and searchable. Unique per company.* | | **website** | String | | N/A | *Official company website link.* | | **location** | String | | N/A | *Company HQ/main location string (e.g. city, country).* | | **logoUrl** | String | | N/A | *Uploaded image URL for company logo/branding.* | | **pageVisibility** | Enum | | N/A | *Visibility of the company page (public/private).* | | **createdByUserId** | ID | | N/A | ** | | **description** | Text | | N/A | *Company description / about section.* | | **industry** | String | | N/A | *Industry sector or market.* | **Enum Properties** ##### pageVisibility Enum Property *Property Definition*: Visibility of the company page (public/private). *Enum Options* | Name | Value | Index | |------|-------|-------| | **public** | `"public"` | 0 | | **private** | `"private"` | 1 | **Generated UI Components** - **List Component**: `CompanyCompanyAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `CompanyCompanyAppPageCreateModal` - Form for creating new records - **Update Modal**: `CompanyCompanyAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `CompanyCompanyAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /company/list` - Retrieve paginated list of records - **Get**: `GET /company/get` - Retrieve single record by ID - **Create**: `POST /company/create` - Create new record - **Update**: `PUT /company/update` - Update existing record - **Delete**: `DELETE /company/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/company/company` - **Create Route**: `/dashboard/company/company/create` - **Update Route**: `/dashboard/company/company/update/:id` - **Delete Route**: `/dashboard/company/company/delete/:id` #### CompanyAdmin Data Object **Basic Information** - **Object Name**: `companyAdmin` - **Display Name**: `CompanyAdmin` - **Component Name**: `CompanyCompanyAdminAppPage` - **Description**: Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **assignedAt** | Date | | N/A | *Timestamp when admin assigned.* | | **userId** | ID | | N/A | *FK to auth:user who is admin of this company.* | | **companyId** | ID | | N/A | *FK to company.* | | **assignedBy** | ID | | N/A | *User who assigned this admin (for audit).* | **Generated UI Components** - **List Component**: `CompanyCompanyAdminAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `CompanyCompanyAdminAppPageCreateModal` - Form for creating new records - **Update Modal**: `CompanyCompanyAdminAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `CompanyCompanyAdminAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /companyAdmin/list` - Retrieve paginated list of records - **Get**: `GET /companyAdmin/get` - Retrieve single record by ID - **Create**: `POST /companyAdmin/create` - Create new record - **Update**: `PUT /companyAdmin/update` - Update existing record - **Delete**: `DELETE /companyAdmin/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/company/companyAdmin` - **Create Route**: `/dashboard/company/companyAdmin/create` - **Update Route**: `/dashboard/company/companyAdmin/update/:id` - **Delete Route**: `/dashboard/company/companyAdmin/delete/:id` ### Content Service Data Objects **Service Overview** - **Service Name**: `content` - **Service Display Name**: `Content` - **Total Data Objects**: 3 **Data Objects** #### Post Data Object **Basic Information** - **Object Name**: `post` - **Display Name**: `Post` - **Component Name**: `ContentPostAppPage` - **Description**: A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **content** | Text | | N/A | *Main post content/body text* | | **companyId** | ID | | N/A | *Optional. FK to company:company - if set, post is from company context (by admin).* | | **authorUserId** | ID | | N/A | *FK to auth:user - the user who created the post. Required.* | | **visibility** | Enum | | N/A | *Post-level visibility: public or private.* | | **attachmentUrls** | String | | N/A | *Array of attachment URLs (e.g. images, docs, links). Optional.* | **Enum Properties** ##### visibility Enum Property *Property Definition*: Post-level visibility: public or private. *Enum Options* | Name | Value | Index | |------|-------|-------| | **public** | `"public"` | 0 | | **private** | `"private"` | 1 | **Generated UI Components** - **List Component**: `ContentPostAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ContentPostAppPageCreateModal` - Form for creating new records - **Update Modal**: `ContentPostAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ContentPostAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /post/list` - Retrieve paginated list of records - **Get**: `GET /post/get` - Retrieve single record by ID - **Create**: `POST /post/create` - Create new record - **Update**: `PUT /post/update` - Update existing record - **Delete**: `DELETE /post/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/content/post` - **Create Route**: `/dashboard/content/post/create` - **Update Route**: `/dashboard/content/post/update/:id` - **Delete Route**: `/dashboard/content/post/delete/:id` #### Like Data Object **Basic Information** - **Object Name**: `like` - **Display Name**: `Like` - **Component Name**: `ContentLikeAppPage` - **Description**: A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **likedAt** | Date | | N/A | *Timestamp when the like was made.* | | **postId** | ID | | N/A | *FK to content:post - the post that was liked. Required.* | | **userId** | ID | | N/A | *FK to auth:user - owner of the like entry (who liked). Required.* | **Generated UI Components** - **List Component**: `ContentLikeAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ContentLikeAppPageCreateModal` - Form for creating new records - **Update Modal**: `ContentLikeAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ContentLikeAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /like/list` - Retrieve paginated list of records - **Get**: `GET /like/get` - Retrieve single record by ID - **Create**: `POST /like/create` - Create new record - **Update**: `PUT /like/update` - Update existing record - **Delete**: `DELETE /like/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/content/like` - **Create Route**: `/dashboard/content/like/create` - **Update Route**: `/dashboard/content/like/update/:id` - **Delete Route**: `/dashboard/content/like/delete/:id` #### Comment Data Object **Basic Information** - **Object Name**: `comment` - **Display Name**: `Comment` - **Component Name**: `ContentCommentAppPage` - **Description**: A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **authorUserId** | ID | | N/A | *FK to auth:user - user who authored comment.* | | **postId** | ID | | N/A | *FK to content:post - the post this comment is for. Required.* | | **content** | Text | | N/A | *Comment body/content.* | | **parentCommentId** | ID | | N/A | *Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment.* | **Generated UI Components** - **List Component**: `ContentCommentAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ContentCommentAppPageCreateModal` - Form for creating new records - **Update Modal**: `ContentCommentAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ContentCommentAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /comment/list` - Retrieve paginated list of records - **Get**: `GET /comment/get` - Retrieve single record by ID - **Create**: `POST /comment/create` - Create new record - **Update**: `PUT /comment/update` - Update existing record - **Delete**: `DELETE /comment/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/content/comment` - **Create Route**: `/dashboard/content/comment/create` - **Update Route**: `/dashboard/content/comment/update/:id` - **Delete Route**: `/dashboard/content/comment/delete/:id` ### Messaging Service Data Objects **Service Overview** - **Service Name**: `messaging` - **Service Display Name**: `Messaging` - **Total Data Objects**: 2 **Data Objects** #### Message Data Object **Basic Information** - **Object Name**: `message` - **Display Name**: `Message` - **Component Name**: `MessagingMessageAppPage` - **Description**: Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **content** | Text | | N/A | *Raw message body/content.* | | **senderUserId** | ID | | N/A | *auth:user.id of message sender.* | | **deletedFor** | ID | | N/A | *Array of userIds who have deleted/hid this message (soft/hide).* | | **readBy** | ID | | N/A | *Array of userIds who have read this message. Used for read receipts.* | | **conversationId** | ID | | N/A | *Conversation this message belongs to (messaging:conversation).* | | **sentAt** | Date | | N/A | *Timestamp when message is sent (defaults to now on create).* | **Generated UI Components** - **List Component**: `MessagingMessageAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `MessagingMessageAppPageCreateModal` - Form for creating new records - **Update Modal**: `MessagingMessageAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `MessagingMessageAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /message/list` - Retrieve paginated list of records - **Get**: `GET /message/get` - Retrieve single record by ID - **Create**: `POST /message/create` - Create new record - **Update**: `PUT /message/update` - Update existing record - **Delete**: `DELETE /message/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/messaging/message` - **Create Route**: `/dashboard/messaging/message/create` - **Update Route**: `/dashboard/messaging/message/update/:id` - **Delete Route**: `/dashboard/messaging/message/delete/:id` #### Conversation Data Object **Basic Information** - **Object Name**: `conversation` - **Display Name**: `Conversation` - **Component Name**: `MessagingConversationAppPage` - **Description**: Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **isGroup** | Boolean | | N/A | *True for group; false for one-to-one conversation (default false).* | | **participantIds** | ID | | N/A | *Array of user IDs (auth:user) participating in the conversation (min 2).* | | **lastMessageAt** | Date | | N/A | *Timestamp of most recent message sent in this conversation.* | **Generated UI Components** - **List Component**: `MessagingConversationAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `MessagingConversationAppPageCreateModal` - Form for creating new records - **Update Modal**: `MessagingConversationAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `MessagingConversationAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /conversation/list` - Retrieve paginated list of records - **Get**: `GET /conversation/get` - Retrieve single record by ID - **Create**: `POST /conversation/create` - Create new record - **Update**: `PUT /conversation/update` - Update existing record - **Delete**: `DELETE /conversation/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/messaging/conversation` - **Create Route**: `/dashboard/messaging/conversation/create` - **Update Route**: `/dashboard/messaging/conversation/update/:id` - **Delete Route**: `/dashboard/messaging/conversation/delete/:id` ### Profile Service Data Objects **Service Overview** - **Service Name**: `profile` - **Service Display Name**: `Profile` - **Total Data Objects**: 7 **Data Objects** #### Profile Data Object **Basic Information** - **Object Name**: `profile` - **Display Name**: `Profile` - **Component Name**: `ProfileProfileAppPage` - **Description**: Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **summary** | Text | | N/A | *Profile summary (bio/description).* | | **headline** | String | | N/A | *Short tagline or headline for profile.* | | **profilePhotoUrl** | String | | N/A | *URL for profile photo/avatar.* | | **userId** | ID | | N/A | *Foreign key to auth:user. Owner of the profile. Single profile per user.* | | **fullName** | String | | N/A | *Full name for display/search.* | | **currentCompany** | String | | N/A | *Current employer/company, free text for now.* | | **industry** | String | | N/A | *Industry sector name for profile.* | | **languages** | String | | N/A | *Array of language names as string, links to language object (lookup/filter only).* | | **skills** | String | | N/A | *List of professional skills (free-form tags).* | | **location** | String | | N/A | *Location information (city, country, etc.)* | | **experience** | Object | | N/A | *Array of experienceItem objects (job history).* | | **profileVisibility** | Enum | | N/A | *Controls who can view profile: public or private. Used in search/list visibility.* | | **education** | Object | | N/A | *Array of educationItem objects (degrees/certificates).* | | **certifications** | String | | N/A | *Professional certifications by name, links to certification object.* | **Enum Properties** ##### profileVisibility Enum Property *Property Definition*: Controls who can view profile: public or private. Used in search/list visibility. *Enum Options* | Name | Value | Index | |------|-------|-------| | **public** | `"public"` | 0 | | **private** | `"private"` | 1 | **Generated UI Components** - **List Component**: `ProfileProfileAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileProfileAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileProfileAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileProfileAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /profile/list` - Retrieve paginated list of records - **Get**: `GET /profile/get` - Retrieve single record by ID - **Create**: `POST /profile/create` - Create new record - **Update**: `PUT /profile/update` - Update existing record - **Delete**: `DELETE /profile/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/profile` - **Create Route**: `/dashboard/profile/profile/create` - **Update Route**: `/dashboard/profile/profile/update/:id` - **Delete Route**: `/dashboard/profile/profile/delete/:id` #### Premiumsubscription Data Object **Basic Information** - **Object Name**: `premiumsubscription` - **Display Name**: `Premiumsubscription` - **Component Name**: `ProfilePremiumsubscriptionAppPage` - **Description**: premium subscription for a user **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **profileId** | ID | | N/A | *the profile id of the subscription* | | **currency** | String | | N/A | *currency * | | **status** | String | | N/A | ** | | **price** | Double | | N/A | *the price of the subscription* | | **userId** | ID | | N/A | *the userid of the subscription* | | **_paymentConfirmation** | Enum | | N/A | *An automatic property that is used to check the confirmed status of the payment set by webhooks.* | **Enum Properties** ##### _paymentConfirmation Enum Property *Property Definition*: An automatic property that is used to check the confirmed status of the payment set by webhooks. *Enum Options* | Name | Value | Index | |------|-------|-------| | **pending** | `"pending"` | 0 | | **processing** | `"processing"` | 1 | | **paid** | `"paid"` | 2 | | **canceled** | `"canceled"` | 3 | **Generated UI Components** - **List Component**: `ProfilePremiumsubscriptionAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfilePremiumsubscriptionAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfilePremiumsubscriptionAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfilePremiumsubscriptionAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /premiumsubscription/list` - Retrieve paginated list of records - **Get**: `GET /premiumsubscription/get` - Retrieve single record by ID - **Create**: `POST /premiumsubscription/create` - Create new record - **Update**: `PUT /premiumsubscription/update` - Update existing record - **Delete**: `DELETE /premiumsubscription/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/premiumsubscription` - **Create Route**: `/dashboard/profile/premiumsubscription/create` - **Update Route**: `/dashboard/profile/premiumsubscription/update/:id` - **Delete Route**: `/dashboard/profile/premiumsubscription/delete/:id` #### Certification Data Object **Basic Information** - **Object Name**: `certification` - **Display Name**: `Certification` - **Component Name**: `ProfileCertificationAppPage` - **Description**: Official certification available for selection in user profile (dictionary only, not user relation). **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **name** | String | | N/A | *Unique certification name (e.g. PMP, CFA, AWS Certified).* | **Generated UI Components** - **List Component**: `ProfileCertificationAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileCertificationAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileCertificationAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileCertificationAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /certification/list` - Retrieve paginated list of records - **Get**: `GET /certification/get` - Retrieve single record by ID - **Create**: `POST /certification/create` - Create new record - **Update**: `PUT /certification/update` - Update existing record - **Delete**: `DELETE /certification/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/certification` - **Create Route**: `/dashboard/profile/certification/create` - **Update Route**: `/dashboard/profile/certification/update/:id` - **Delete Route**: `/dashboard/profile/certification/delete/:id` #### Language Data Object **Basic Information** - **Object Name**: `language` - **Display Name**: `Language` - **Component Name**: `ProfileLanguageAppPage` - **Description**: Official language available for selection in user profile (dictionary only, not user relation). **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **name** | String | | N/A | *Unique language name (e.g. English, Spanish).* | **Generated UI Components** - **List Component**: `ProfileLanguageAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileLanguageAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileLanguageAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileLanguageAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /language/list` - Retrieve paginated list of records - **Get**: `GET /language/get` - Retrieve single record by ID - **Create**: `POST /language/create` - Create new record - **Update**: `PUT /language/update` - Update existing record - **Delete**: `DELETE /language/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/language` - **Create Route**: `/dashboard/profile/language/create` - **Update Route**: `/dashboard/profile/language/update/:id` - **Delete Route**: `/dashboard/profile/language/delete/:id` #### Sys_premiumsubscriptionPayment Data Object **Basic Information** - **Object Name**: `sys_premiumsubscriptionPayment` - **Display Name**: `Sys_premiumsubscriptionPayment` - **Component Name**: `ProfileSys_premiumsubscriptionPaymentAppPage` - **Description**: A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **ownerId** | ID | | N/A | * An ID value to represent owner user who created the order* | | **orderId** | ID | | N/A | *an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object* | | **paymentId** | String | | N/A | *A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type* | | **paymentStatus** | String | | N/A | *A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.* | | **statusLiteral** | String | | N/A | *A string value to represent the logical payment status which belongs to the application lifecycle itself.* | | **redirectUrl** | String | | N/A | *A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.* | **Generated UI Components** - **List Component**: `ProfileSys_premiumsubscriptionPaymentAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileSys_premiumsubscriptionPaymentAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileSys_premiumsubscriptionPaymentAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileSys_premiumsubscriptionPaymentAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /sys_premiumsubscriptionPayment/list` - Retrieve paginated list of records - **Get**: `GET /sys_premiumsubscriptionPayment/get` - Retrieve single record by ID - **Create**: `POST /sys_premiumsubscriptionPayment/create` - Create new record - **Update**: `PUT /sys_premiumsubscriptionPayment/update` - Update existing record - **Delete**: `DELETE /sys_premiumsubscriptionPayment/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/sys_premiumsubscriptionPayment` - **Create Route**: `/dashboard/profile/sys_premiumsubscriptionPayment/create` - **Update Route**: `/dashboard/profile/sys_premiumsubscriptionPayment/update/:id` - **Delete Route**: `/dashboard/profile/sys_premiumsubscriptionPayment/delete/:id` #### Sys_paymentCustomer Data Object **Basic Information** - **Object Name**: `sys_paymentCustomer` - **Display Name**: `Sys_paymentCustomer` - **Component Name**: `ProfileSys_paymentCustomerAppPage` - **Description**: A payment storage object to store the customer values of the payment platform **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **userId** | ID | | N/A | * An ID value to represent the user who is created as a stripe customer* | | **customerId** | String | | N/A | *A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway* | | **platform** | String | | N/A | *A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future.* | **Generated UI Components** - **List Component**: `ProfileSys_paymentCustomerAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileSys_paymentCustomerAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileSys_paymentCustomerAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileSys_paymentCustomerAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /sys_paymentCustomer/list` - Retrieve paginated list of records - **Get**: `GET /sys_paymentCustomer/get` - Retrieve single record by ID - **Create**: `POST /sys_paymentCustomer/create` - Create new record - **Update**: `PUT /sys_paymentCustomer/update` - Update existing record - **Delete**: `DELETE /sys_paymentCustomer/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/sys_paymentCustomer` - **Create Route**: `/dashboard/profile/sys_paymentCustomer/create` - **Update Route**: `/dashboard/profile/sys_paymentCustomer/update/:id` - **Delete Route**: `/dashboard/profile/sys_paymentCustomer/delete/:id` #### Sys_paymentMethod Data Object **Basic Information** - **Object Name**: `sys_paymentMethod` - **Display Name**: `Sys_paymentMethod` - **Component Name**: `ProfileSys_paymentMethodAppPage` - **Description**: A payment storage object to store the payment methods of the platform customers **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **paymentMethodId** | String | | N/A | *A string value to represent the id of the payment method on the payment platform.* | | **userId** | ID | | N/A | * An ID value to represent the user who owns the payment method* | | **customerId** | String | | N/A | *A string value to represent the customer id which is generated on the payment gateway.* | | **cardHolderName** | String | | N/A | *A string value to represent the name of the card holder. It can be different than the registered customer.* | | **cardHolderZip** | String | | N/A | *A string value to represent the zip code of the card holder. It is used for address verification in specific countries.* | | **platform** | String | | N/A | *A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future.* | | **cardInfo** | Object | | N/A | *A Json value to store the card details of the payment method.* | **Generated UI Components** - **List Component**: `ProfileSys_paymentMethodAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `ProfileSys_paymentMethodAppPageCreateModal` - Form for creating new records - **Update Modal**: `ProfileSys_paymentMethodAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `ProfileSys_paymentMethodAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /sys_paymentMethod/list` - Retrieve paginated list of records - **Get**: `GET /sys_paymentMethod/get` - Retrieve single record by ID - **Create**: `POST /sys_paymentMethod/create` - Create new record - **Update**: `PUT /sys_paymentMethod/update` - Update existing record - **Delete**: `DELETE /sys_paymentMethod/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/profile/sys_paymentMethod` - **Create Route**: `/dashboard/profile/sys_paymentMethod/create` - **Update Route**: `/dashboard/profile/sys_paymentMethod/update/:id` - **Delete Route**: `/dashboard/profile/sys_paymentMethod/delete/:id` ### Auth Service Data Objects **Service Overview** - **Service Name**: `auth` - **Service Display Name**: `Auth` - **Total Data Objects**: 1 **Data Objects** #### User Data Object **Basic Information** - **Object Name**: `user` - **Display Name**: `User` - **Component Name**: `AuthUserAppPage` - **Description**: A data object that stores the user information and handles login settings. **Object Properties** | Property Name | Type | Required | Default | Definition | |---------------|------|----------|---------|------------| | **email** | String | | N/A | * A string value to represent the user's email.* | | **password** | String | | N/A | * A string value to represent the user's password. It will be stored as hashed.* | | **fullname** | String | | N/A | *A string value to represent the fullname of the user* | | **avatar** | String | | N/A | *The avatar url of the user. A random avatar will be generated if not provided* | | **roleId** | String | | N/A | *A string value to represent the roleId of the user.* | | **emailVerified** | Boolean | | N/A | *A boolean value to represent the email verification status of the user.* | **Generated UI Components** - **List Component**: `AuthUserAppPageList` - Displays paginated data with filtering and sorting - **Create Modal**: `AuthUserAppPageCreateModal` - Form for creating new records - **Update Modal**: `AuthUserAppPageUpdateModal` - Form for editing existing records - **Delete Modal**: `AuthUserAppPageDeleteModal` - Confirmation dialog for deletion **API Endpoints** - **List**: `GET /user/list` - Retrieve paginated list of records - **Get**: `GET /user/get` - Retrieve single record by ID - **Create**: `POST /user/create` - Create new record - **Update**: `PUT /user/update` - Update existing record - **Delete**: `DELETE /user/delete` - Delete record by ID **Route Configuration** - **List Route**: `/dashboard/auth/user` - **Create Route**: `/dashboard/auth/user/create` - **Update Route**: `/dashboard/auth/user/update/:id` - **Delete Route**: `/dashboard/auth/user/delete/:id` ## CRUD Operations ### Create Operations **Create Form Implementation** ```javascript // Create forms are generated as lazy-loaded modal components // Basic form fields are rendered based on data object properties ``` **Create API Integration** ```javascript // Create operations are handled through service-specific API calls // Basic validation is performed client-side ``` ### Read Operations **List View Implementation** ```javascript // List views are implemented using MUI DataGrid // Data is fetched through service-specific API calls ``` ### Update Operations **Update Form Implementation** ```javascript // Update forms are generated as lazy-loaded modal components // Basic form fields are pre-populated with existing data ``` **Update API Integration** ```javascript // Update operations are handled through service-specific API calls // Basic validation is performed client-side ``` ### Delete Operations **Delete Implementation** ```javascript // Delete operations are handled through service-specific API calls // Confirmation dialogs are implemented as modal components ``` ## Data Validation ### Client-Side Validation **Validation Implementation** ```javascript // Basic validation is performed on form fields // Required fields are validated before submission ``` ### Server-Side Validation Integration **API Error Handling** ```javascript // Server validation errors are displayed to users // Error messages are shown in the UI components ``` ## Data Relationships ### Relationship Management **Relationship Implementation** ```javascript // Basic data relationships are handled through form fields // Related data is displayed in select components ``` ## User Experience Patterns ### Loading States **Loading Implementation** ```javascript // Loading states are handled by MUI DataGrid // Skeleton loading is provided by the data grid component ``` ### Error States **Error Handling UI** ```javascript // Error states are displayed through UI components // Error messages are shown to users ``` ### Empty States **Empty State UI** ```javascript // Empty states are handled by MUI DataGrid // Empty content is displayed when no data is available ``` ## Performance Optimization ### Data Pagination **Pagination Implementation** ```javascript // Pagination is handled by MUI DataGrid // Data is loaded in pages as needed ``` # MCP Chat Integration for Linkedin Admin Panel This module provides AI-powered chat functionality for the Linkedin admin panel using the Model Context Protocol (MCP) to communicate with Anthropic Claude. ## 🚀 Features - **Intercom-style floating chat widget** - Bottom-right corner, collapsible interface - **Real-time AI conversations** - Powered by Anthropic Claude via MCP protocol - **Full Linkedin API access** - AI can perform CRUD operations on all services - **JWT authentication** - Seamlessly integrated with existing auth system - **Responsive design** - Works on desktop and mobile devices - **Material-UI styling** - Consistent with admin panel design ## 📁 File Structure ``` src/ ├── lib/ │ └── mcp-client.js # MCP protocol client ├── components/ │ └── mcp-chat/ │ ├── mcp-chat-widget.jsx # Main floating chat widget │ ├── mcp-message-list.jsx # Message display components │ ├── mcp-input.jsx # Message input component │ ├── mcp-client-context.jsx # React context provider │ └── index.js # Component exports ├── hooks/ │ └── use-mcp-chat.js # Custom hook for chat logic └── layouts/ └── dashboard/ └── layout.jsx.ejs # Dashboard layout with chat integration ``` ## 🔧 Configuration ### Environment Variables Add to your `.env` files: ```bash # MCP Server URL - Points to the nodeJs2 service MCP endpoint VITE_MCP_SERVER_URL=http://localhost:3000/mcp # For staging: # VITE_MCP_SERVER_URL=https://your-nodejs2-service.staging.mindbricks.com/mcp # For production: # VITE_MCP_SERVER_URL=https://your-nodejs2-service.prod.mindbricks.com/mcp ``` ### Backend Configuration Ensure your backend (nodeJs2 service) has: ```bash # Anthropic API key (handled on backend) ANTHROPIC_API_KEY=your_anthropic_api_key_here ``` ## 🏗️ Architecture ### Data Flow ``` User Input → MCPInput → MCPClient → MCP Server (/mcp) → Anthropic Claude ↓ MCPMessageList ← MCPClientContext ← MCP Response ← MCP Tools → Linkedin APIs ``` ### Component Hierarchy ``` DashboardLayout ├── MCPChatProvider (Context) │ ├── LayoutSection (Main content) │ └── MCPChatWidget (Floating chat) │ ├── MCPMessageList │ └── MCPInput ``` ## 🔌 Integration The chat widget is automatically integrated into the dashboard layout and appears on all dashboard pages. It: 1. **Initializes automatically** when a user is authenticated 2. **Connects to MCP server** using JWT token authentication 3. **Provides AI assistance** for all Linkedin service operations 4. **Maintains conversation state** during the session ## 🎨 UI Components ### MCPChatWidget - Floating chat button (bottom-right corner) - Collapsible chat panel - Responsive design for mobile/desktop ### MCPMessageList - Displays conversation history - User and assistant message bubbles - Loading indicators and timestamps ### MCPInput - Text input with send button - Enter to send, Shift+Enter for new line - Loading states and error handling ## 🔐 Security - **JWT Authentication** - All MCP requests include user's access token - **Backend API Key Handling** - Anthropic API key never exposed to frontend - **Session Management** - MCP sessions are properly managed and cleaned up - **Error Handling** - Graceful fallbacks for connection issues ## 🚀 Usage The chat widget is automatically available to all authenticated users. Simply: 1. **Click the chat button** in the bottom-right corner 2. **Type your message** and press Enter 3. **Get AI assistance** for Linkedin service operations 4. **Use natural language** to manage your data ## 🛠️ Development ### Adding New Features 1. **Extend MCPClient** - Add new methods for additional MCP operations 2. **Update Context** - Modify MCPChatProvider for new state management 3. **Enhance UI** - Add new components following Material-UI patterns 4. **Test Integration** - Verify MCP server communication ### Debugging - Check browser console for MCP connection logs - Verify JWT token is properly passed to MCP server - Ensure backend MCP server is running and accessible - Check Anthropic API key configuration on backend ## 📝 Service Integration The MCP chat has access to all Linkedin services: ### JobApplication Service - **Service Name**: `jobApplication` - **Service URL**: `VITE_JOBAPPLICATION_SERVICE_URL` - **Data Objects**: 2 objects - JobPosting, JobApplication ### Networking Service - **Service Name**: `networking` - **Service URL**: `VITE_NETWORKING_SERVICE_URL` - **Data Objects**: 2 objects - Connection, ConnectionRequest ### Company Service - **Service Name**: `company` - **Service URL**: `VITE_COMPANY_SERVICE_URL` - **Data Objects**: 4 objects - CompanyFollower, CompanyUpdate, Company, CompanyAdmin ### Content Service - **Service Name**: `content` - **Service URL**: `VITE_CONTENT_SERVICE_URL` - **Data Objects**: 3 objects - Post, Like, Comment ### Messaging Service - **Service Name**: `messaging` - **Service URL**: `VITE_MESSAGING_SERVICE_URL` - **Data Objects**: 2 objects - Message, Conversation ### Profile Service - **Service Name**: `profile` - **Service URL**: `VITE_PROFILE_SERVICE_URL` - **Data Objects**: 7 objects - Profile, Premiumsubscription, Certification, Language, Sys_premiumsubscriptionPayment, Sys_paymentCustomer, Sys_paymentMethod ### Auth Service - **Service Name**: `auth` - **Service URL**: `VITE_AUTH_SERVICE_URL` - **Data Objects**: 1 objects - User ## 🔄 Root Generation Integration The MCP chat components are fully integrated into the Genesis project's generation system: ``` Root Generation Flow: ├── src/root-gen.js (Main generator) │ ├── ComponentsRootGenerator │ │ └── MCPChatRootGenerator │ ├── LibRootGenerator │ │ └── mcp-client.js.ejs │ └── HooksRootGenerator │ └── use-mcp-chat.js.ejs ``` ### Generation Process When the Linkedin project is built, the root generation system will: 1. **Generate MCP Client** - Creates `src/lib/mcp-client.js` from template 2. **Generate MCP Components** - Creates all chat components in `src/components/mcp-chat/` 3. **Generate Custom Hook** - Creates `src/hooks/use-mcp-chat.js` from template 4. **Integrate with Dashboard** - Chat widget automatically appears in dashboard layout ## 📋 EJS Template Structure All components follow the same EJS template pattern as other Linkedin components: ``` src/components/mcp-chat/ ├── root-gen.js # Root generator ├── mcp-chat-widget.jsx.ejs # Main widget template ├── mcp-message-list.jsx.ejs # Message components template ├── mcp-input.jsx.ejs # Input component template ├── mcp-client-context.jsx.ejs # Context provider template └── index.js.ejs # Exports template ``` ## 🎯 Benefits of EJS Integration - **✅ Consistent with project patterns** - Follows exact same structure as other components - **✅ Automatic generation** - Components generated during build process - **✅ Template-based** - Easy to modify and customize - **✅ Root generation system** - Integrated with Linkedin build pipeline - **✅ No manual file management** - All files generated automatically ## 🚀 Ready for Build The MCP chat integration is now fully integrated into the Linkedin project's build system. When you run the project generation, all MCP chat components will be automatically created from the EJS templates, following the same patterns as all other components in the project. **The implementation is now complete and follows the exact same patterns as the rest of the Linkedin project!** 🚀 --- ## 📞 Support For questions or support regarding the MCP chat integration, please contact: - **Architect**: Mindbricks Genesis Engine - **Email**: support@mindbricks.com - **Organization**: Mindbricks Inc. - **Website**: https://mindbricks.com # PANEL SERVICE GUIDE ## Linkedin Admin Panel The Linkedin Admin Panel is a dynamic, auto-generated frontend application that provides a comprehensive management interface for all backend services and data objects within the Linkedin ecosystem. Built using React and Vite, it automatically adapts to the project's service architecture, providing intuitive CRUD operations and real-time data management capabilities. ## Architectural Design Credit and Contact Information The architectural design of this admin panel is credited to Mindbricks Genesis Engine. We encourage open communication and welcome any questions or discussions related to the architectural aspects of this admin panel. ## Documentation Scope Welcome to the official documentation for the Linkedin Admin Panel. This document is designed to provide a comprehensive guide to understanding, configuring, and extending the admin panel's functionality. **Intended Audience** This documentation is intended for frontend developers, system administrators, and integrators who need to understand how the admin panel works, how to configure it for different environments, and how to extend its functionality for custom requirements. **Overview** Within these pages, you will find detailed information on the panel's architecture, service integration patterns, authentication flows, data object management, and API integration methods. The admin panel serves as a unified interface for managing all aspects of the Linkedin microservices ecosystem. ## Panel Architecture Overview The Linkedin Admin Panel is built on a dynamic, pattern-driven architecture that automatically generates user interfaces based on the project's service definitions and data object schemas. ### Core Components **Dynamic Service Integration** - Automatically discovers and integrates with all backend services defined in the project - Generates service-specific navigation and routing structures - Provides unified authentication and session management across all services **Data Object Management** - Dynamically creates CRUD interfaces for each data object within services - Supports complex data relationships and validation rules - Provides real-time data synchronization with backend services **Modular UI Framework** - Built on React with Material-UI components for consistent user experience - Responsive design that works across desktop and mobile devices - Extensible component system for custom functionality ### Service Integration Architecture The admin panel integrates with backend services through a standardized API communication layer: **JobApplication Service Integration** - **Service Name**: `jobApplication` - **Service URL**: `VITE_JOBAPPLICATION_SERVICE_URL` - **Data Objects**: 2 objects - JobPosting, JobApplication **Networking Service Integration** - **Service Name**: `networking` - **Service URL**: `VITE_NETWORKING_SERVICE_URL` - **Data Objects**: 2 objects - Connection, ConnectionRequest **Company Service Integration** - **Service Name**: `company` - **Service URL**: `VITE_COMPANY_SERVICE_URL` - **Data Objects**: 4 objects - CompanyFollower, CompanyUpdate, Company, CompanyAdmin **Content Service Integration** - **Service Name**: `content` - **Service URL**: `VITE_CONTENT_SERVICE_URL` - **Data Objects**: 3 objects - Post, Like, Comment **Messaging Service Integration** - **Service Name**: `messaging` - **Service URL**: `VITE_MESSAGING_SERVICE_URL` - **Data Objects**: 2 objects - Message, Conversation **Profile Service Integration** - **Service Name**: `profile` - **Service URL**: `VITE_PROFILE_SERVICE_URL` - **Data Objects**: 7 objects - Profile, Premiumsubscription, Certification, Language, Sys_premiumsubscriptionPayment, Sys_paymentCustomer, Sys_paymentMethod **Auth Service Integration** - **Service Name**: `auth` - **Service URL**: `VITE_AUTH_SERVICE_URL` - **Data Objects**: 1 objects - User ## Authentication and Authorization The admin panel implements a comprehensive authentication system that integrates with the project's authentication service. ### Authentication Flow **Login Process** 1. User accesses the admin panel login page 2. Credentials are validated against the authentication service 3. JWT access token is received and stored securely 4. Session is established with proper permissions and tenant context **Token Management** - Access tokens are stored in secure HTTP-only cookies - Automatic token refresh mechanisms prevent session expiration - Multi-tenant support with tenant-specific token handling ### Authorization Levels **Role-Based Access Control** - Admin users have full access to all services and data objects - Service-specific permissions control access to individual modules - Data object permissions control CRUD operations on specific entities **Permission Structure** - `adminPanel.access` - Basic admin panel access - `linkedin.jobApplication.manage` - Service management permissions - `linkedin.jobApplication.jobPosting.crud` - Data object CRUD permissions - `linkedin.jobApplication.jobApplication.crud` - Data object CRUD permissions - `linkedin.networking.manage` - Service management permissions - `linkedin.networking.connection.crud` - Data object CRUD permissions - `linkedin.networking.connectionRequest.crud` - Data object CRUD permissions - `linkedin.company.manage` - Service management permissions - `linkedin.company.companyFollower.crud` - Data object CRUD permissions - `linkedin.company.companyUpdate.crud` - Data object CRUD permissions - `linkedin.company.company.crud` - Data object CRUD permissions - `linkedin.company.companyAdmin.crud` - Data object CRUD permissions - `linkedin.content.manage` - Service management permissions - `linkedin.content.post.crud` - Data object CRUD permissions - `linkedin.content.like.crud` - Data object CRUD permissions - `linkedin.content.comment.crud` - Data object CRUD permissions - `linkedin.messaging.manage` - Service management permissions - `linkedin.messaging.message.crud` - Data object CRUD permissions - `linkedin.messaging.conversation.crud` - Data object CRUD permissions - `linkedin.profile.manage` - Service management permissions - `linkedin.profile.profile.crud` - Data object CRUD permissions - `linkedin.profile.premiumsubscription.crud` - Data object CRUD permissions - `linkedin.profile.certification.crud` - Data object CRUD permissions - `linkedin.profile.language.crud` - Data object CRUD permissions - `linkedin.profile.sys_premiumsubscriptionPayment.crud` - Data object CRUD permissions - `linkedin.profile.sys_paymentCustomer.crud` - Data object CRUD permissions - `linkedin.profile.sys_paymentMethod.crud` - Data object CRUD permissions - `linkedin.auth.manage` - Service management permissions - `linkedin.auth.user.crud` - Data object CRUD permissions ## Service Integration Guide ### Environment Configuration The admin panel connects to backend services through environment-specific configuration: **Development Environment** ```javascript VITE_AUTH_SERVICE_URL=http://localhost:3001 VITE_USER_SERVICE_URL=http://localhost:3002 VITE_PRODUCT_SERVICE_URL=http://localhost:3003 ``` **Staging Environment** ```javascript VITE_AUTH_SERVICE_URL=https://auth-api.linkedin.staging.mindbricks.com VITE_USER_SERVICE_URL=https://user-api.linkedin.staging.mindbricks.com VITE_PRODUCT_SERVICE_URL=https://product-api.linkedin.staging.mindbricks.com ``` **Production Environment** ```javascript VITE_AUTH_SERVICE_URL=https://auth-api.linkedin.prod.mindbricks.com VITE_USER_SERVICE_URL=https://user-api.linkedin.prod.mindbricks.com VITE_PRODUCT_SERVICE_URL=https://product-api.linkedin.prod.mindbricks.com ``` ### API Communication Layer **Axios Configuration** ```javascript // Base configuration for all service communications const apiClient = axios.create({ baseURL: serviceUrl, timeout: 10000, headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${accessToken}` } }); ``` **Request Interceptors** - Automatic token attachment to all requests - Error handling and retry logic for failed requests - Request/response logging for debugging **Response Interceptors** - Automatic token refresh on 401 responses - Error message standardization - Loading state management ## Data Object Management ### Dynamic CRUD Interface Generation The admin panel automatically generates complete CRUD interfaces for each data object based on the service definitions: **JobApplication Service Data Objects** **JobPosting Management** - **Object Name**: `jobPosting` - **Component Name**: `JobApplicationJobPostingAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/jobApplication/jobPosting` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new jobPosting records - Update Modal: Form for editing existing jobPosting records - Delete Confirmation: Safe deletion with confirmation dialogs **JobApplication Management** - **Object Name**: `jobApplication` - **Component Name**: `JobApplicationJobApplicationAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/jobApplication/jobApplication` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new jobApplication records - Update Modal: Form for editing existing jobApplication records - Delete Confirmation: Safe deletion with confirmation dialogs **Networking Service Data Objects** **Connection Management** - **Object Name**: `connection` - **Component Name**: `NetworkingConnectionAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/networking/connection` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new connection records - Update Modal: Form for editing existing connection records - Delete Confirmation: Safe deletion with confirmation dialogs **ConnectionRequest Management** - **Object Name**: `connectionRequest` - **Component Name**: `NetworkingConnectionRequestAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/networking/connectionRequest` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new connectionRequest records - Update Modal: Form for editing existing connectionRequest records - Delete Confirmation: Safe deletion with confirmation dialogs **Company Service Data Objects** **CompanyFollower Management** - **Object Name**: `companyFollower` - **Component Name**: `CompanyCompanyFollowerAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/company/companyFollower` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new companyFollower records - Update Modal: Form for editing existing companyFollower records - Delete Confirmation: Safe deletion with confirmation dialogs **CompanyUpdate Management** - **Object Name**: `companyUpdate` - **Component Name**: `CompanyCompanyUpdateAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/company/companyUpdate` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new companyUpdate records - Update Modal: Form for editing existing companyUpdate records - Delete Confirmation: Safe deletion with confirmation dialogs **Company Management** - **Object Name**: `company` - **Component Name**: `CompanyCompanyAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/company/company` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new company records - Update Modal: Form for editing existing company records - Delete Confirmation: Safe deletion with confirmation dialogs **CompanyAdmin Management** - **Object Name**: `companyAdmin` - **Component Name**: `CompanyCompanyAdminAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/company/companyAdmin` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new companyAdmin records - Update Modal: Form for editing existing companyAdmin records - Delete Confirmation: Safe deletion with confirmation dialogs **Content Service Data Objects** **Post Management** - **Object Name**: `post` - **Component Name**: `ContentPostAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/content/post` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new post records - Update Modal: Form for editing existing post records - Delete Confirmation: Safe deletion with confirmation dialogs **Like Management** - **Object Name**: `like` - **Component Name**: `ContentLikeAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/content/like` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new like records - Update Modal: Form for editing existing like records - Delete Confirmation: Safe deletion with confirmation dialogs **Comment Management** - **Object Name**: `comment` - **Component Name**: `ContentCommentAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/content/comment` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new comment records - Update Modal: Form for editing existing comment records - Delete Confirmation: Safe deletion with confirmation dialogs **Messaging Service Data Objects** **Message Management** - **Object Name**: `message` - **Component Name**: `MessagingMessageAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/messaging/message` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new message records - Update Modal: Form for editing existing message records - Delete Confirmation: Safe deletion with confirmation dialogs **Conversation Management** - **Object Name**: `conversation` - **Component Name**: `MessagingConversationAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/messaging/conversation` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new conversation records - Update Modal: Form for editing existing conversation records - Delete Confirmation: Safe deletion with confirmation dialogs **Profile Service Data Objects** **Profile Management** - **Object Name**: `profile` - **Component Name**: `ProfileProfileAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/profile` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new profile records - Update Modal: Form for editing existing profile records - Delete Confirmation: Safe deletion with confirmation dialogs **Premiumsubscription Management** - **Object Name**: `premiumsubscription` - **Component Name**: `ProfilePremiumsubscriptionAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/premiumsubscription` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new premiumsubscription records - Update Modal: Form for editing existing premiumsubscription records - Delete Confirmation: Safe deletion with confirmation dialogs **Certification Management** - **Object Name**: `certification` - **Component Name**: `ProfileCertificationAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/certification` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new certification records - Update Modal: Form for editing existing certification records - Delete Confirmation: Safe deletion with confirmation dialogs **Language Management** - **Object Name**: `language` - **Component Name**: `ProfileLanguageAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/language` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new language records - Update Modal: Form for editing existing language records - Delete Confirmation: Safe deletion with confirmation dialogs **Sys_premiumsubscriptionPayment Management** - **Object Name**: `sys_premiumsubscriptionPayment` - **Component Name**: `ProfileSys_premiumsubscriptionPaymentAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/sys_premiumsubscriptionPayment` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new sys_premiumsubscriptionPayment records - Update Modal: Form for editing existing sys_premiumsubscriptionPayment records - Delete Confirmation: Safe deletion with confirmation dialogs **Sys_paymentCustomer Management** - **Object Name**: `sys_paymentCustomer` - **Component Name**: `ProfileSys_paymentCustomerAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/sys_paymentCustomer` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new sys_paymentCustomer records - Update Modal: Form for editing existing sys_paymentCustomer records - Delete Confirmation: Safe deletion with confirmation dialogs **Sys_paymentMethod Management** - **Object Name**: `sys_paymentMethod` - **Component Name**: `ProfileSys_paymentMethodAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/profile/sys_paymentMethod` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new sys_paymentMethod records - Update Modal: Form for editing existing sys_paymentMethod records - Delete Confirmation: Safe deletion with confirmation dialogs **Auth Service Data Objects** **User Management** - **Object Name**: `user` - **Component Name**: `AuthUserAppPage` - **Available Operations**: Create, Read, Update, Delete, List - **Route Path**: `/dashboard/auth/user` **Generated Components** - List View: Displays paginated data with filtering and sorting - Create Modal: Form for creating new user records - Update Modal: Form for editing existing user records - Delete Confirmation: Safe deletion with confirmation dialogs ### Data Validation and Error Handling **Client-Side Validation** - Real-time validation based on data object property definitions - Type checking and format validation - Required field validation **Server-Side Integration** - API error response handling - Validation error display - Success/error notification system ## API Integration Patterns ### Standard CRUD Operations **List Operations** ```javascript // Get paginated list of data objects const response = await apiClient.get(`/${dataObjectName}/list`, { params: { pageNumber: 1, pageRowCount: 25, getJoins: true, caching: true } }); ``` **Create Operations** ```javascript // Create new data object const response = await apiClient.post(`/${dataObjectName}/create`, { // Data object properties }); ``` **Update Operations** ```javascript // Update existing data object const response = await apiClient.put(`/${dataObjectName}/update`, { id: objectId, // Updated properties }); ``` **Delete Operations** ```javascript // Delete data object const response = await apiClient.delete(`/${dataObjectName}/delete`, { params: { id: objectId } }); ``` ### Advanced Query Features **Filtering and Search** - Dynamic filter generation based on data object properties - Full-text search capabilities - Date range filtering - Multi-select filters for enum properties **Sorting and Pagination** - Multi-column sorting support - Configurable page sizes - Total count and page navigation - Infinite scroll option **Data Relationships** - Automatic join handling for related data objects - Lazy loading for performance optimization - Relationship visualization in forms ## Navigation and Routing ### Dynamic Route Generation The admin panel automatically generates routes based on the service and data object structure: **Main Routes** - `/` - Login page - `/dashboard` - Main dashboard - `/dashboard/jobApplication` - Service overview - `/dashboard/jobApplication/jobPosting` - Data object management - `/dashboard/jobApplication/jobApplication` - Data object management - `/dashboard/networking` - Service overview - `/dashboard/networking/connection` - Data object management - `/dashboard/networking/connectionRequest` - Data object management - `/dashboard/company` - Service overview - `/dashboard/company/companyFollower` - Data object management - `/dashboard/company/companyUpdate` - Data object management - `/dashboard/company/company` - Data object management - `/dashboard/company/companyAdmin` - Data object management - `/dashboard/content` - Service overview - `/dashboard/content/post` - Data object management - `/dashboard/content/like` - Data object management - `/dashboard/content/comment` - Data object management - `/dashboard/messaging` - Service overview - `/dashboard/messaging/message` - Data object management - `/dashboard/messaging/conversation` - Data object management - `/dashboard/profile` - Service overview - `/dashboard/profile/profile` - Data object management - `/dashboard/profile/premiumsubscription` - Data object management - `/dashboard/profile/certification` - Data object management - `/dashboard/profile/language` - Data object management - `/dashboard/profile/sys_premiumsubscriptionPayment` - Data object management - `/dashboard/profile/sys_paymentCustomer` - Data object management - `/dashboard/profile/sys_paymentMethod` - Data object management - `/dashboard/auth` - Service overview - `/dashboard/auth/user` - Data object management **Route Configuration** ```javascript // Automatically generated route structure const dashboardRoutes = [ { path: 'dashboard', element: , children: [ { index: true, element: }, { path: 'jobApplication', element: , children: [ { path: 'jobPosting', element: }, { path: 'jobApplication', element: } ] }, { path: 'networking', element: , children: [ { path: 'connection', element: }, { path: 'connectionRequest', element: } ] }, { path: 'company', element: , children: [ { path: 'companyFollower', element: }, { path: 'companyUpdate', element: }, { path: 'company', element: }, { path: 'companyAdmin', element: } ] }, { path: 'content', element: , children: [ { path: 'post', element: }, { path: 'like', element: }, { path: 'comment', element: } ] }, { path: 'messaging', element: , children: [ { path: 'message', element: }, { path: 'conversation', element: } ] }, { path: 'profile', element: , children: [ { path: 'profile', element: }, { path: 'premiumsubscription', element: }, { path: 'certification', element: }, { path: 'language', element: }, { path: 'sys_premiumsubscriptionPayment', element: }, { path: 'sys_paymentCustomer', element: }, { path: 'sys_paymentMethod', element: } ] }, { path: 'auth', element: , children: [ { path: 'user', element: } ] } ] } ]; ``` ### Navigation Structure **Main Navigation** - Dashboard overview - Service modules (dynamically generated) - User profile and settings - Logout functionality **Service Navigation** - Service-specific data object management - Service configuration and settings - Service health and monitoring ## Error Handling and User Experience ### Error Management System **API Error Handling** - Standardized error response processing - User-friendly error message display - Automatic retry mechanisms for transient failures - Offline detection and handling **Validation Error Display** - Field-specific error highlighting - Inline error messages - Form validation summary **Loading States** - Skeleton loading for data tables - Progress indicators for long operations - Optimistic updates for better UX ### Notification System **Success Notifications** - Operation completion confirmations - Data synchronization status - System health updates **Error Notifications** - API error alerts - Validation error summaries - Network connectivity issues **Warning Notifications** - Data loss prevention warnings - Permission change alerts - System maintenance notifications ## Deployment and Configuration ### Build Configuration **Environment-Specific Builds** - Development builds with debugging enabled - Staging builds with production-like settings - Production builds with optimization and minification **Docker Support** - Multi-stage Docker builds for different environments - Environment variable injection - Health check endpoints ### Performance Optimization **Code Splitting** - Route-based code splitting - Component lazy loading - Dynamic imports for heavy components **Caching Strategies** - API response caching - Static asset caching - Browser cache optimization **Bundle Optimization** - Tree shaking for unused code - Asset compression - CDN integration support ## Security Considerations ### Authentication Security - Secure token storage and transmission - Automatic token refresh - Session timeout handling - Multi-factor authentication support ### Data Protection - Input sanitization and validation - XSS prevention - CSRF protection - Secure API communication ### Access Control - Role-based permission enforcement - Tenant isolation in multi-tenant setups - Audit logging for sensitive operations - Secure logout and session cleanup ## Troubleshooting and Support ### Common Issues **Authentication Problems** - Token expiration handling - Session restoration after page refresh - Multi-tenant login issues **API Integration Issues** - Service connectivity problems - Data synchronization errors - Permission-related access denials **UI/UX Issues** - Component rendering problems - Navigation routing issues - Form validation errors ### Debugging Tools **Development Tools** - React Developer Tools integration - Network request monitoring - State management debugging - Performance profiling **Logging and Monitoring** - Client-side error logging - API request/response logging - User interaction tracking - Performance metrics collection # SERVICE INTEGRATION GUIDE ## Linkedin Admin Panel This document provides detailed information about how the Linkedin Admin Panel integrates with backend services, including configuration, API communication patterns, and service-specific implementation details. ## Architectural Design Credit and Contact Information The architectural design of this service integration is credited to Mindbricks Genesis Engine. We encourage open communication and welcome any questions or discussions related to the architectural aspects of this service integration. ## Documentation Scope This guide covers the complete integration architecture between the Linkedin Admin Panel and its backend services. It includes configuration management, API communication patterns, authentication flows, and service-specific implementation details. **Intended Audience** This documentation is intended for frontend developers, DevOps engineers, and system integrators who need to understand, configure, or extend the admin panel's service integration capabilities. ## Service Integration Architecture ### Overview The admin panel integrates with backend services through service-specific HTTP clients. Each service is configured via environment variables and uses its own Axios instance for API communication. ### Integration Components **Service Configuration** - Service URLs configured via environment variables - Service-specific Axios instances for API communication **API Communication** - Basic HTTP client instances per service - Simple error handling through response interceptors ## Service Configuration ### Environment Variables The admin panel uses environment variables to configure service endpoints and integration settings: **Core Configuration** ```bash # Application Configuration VITE_APP_NAME="Linkedin Admin Panel" VITE_APP_VERSION="1.1.43" VITE_ASSETS_DIR="/assets" **Service Endpoints** ```bash # JobApplication Service VITE_JOBAPPLICATION_SERVICE_URL="https://jobApplication-api.linkedin.prod.mindbricks.com" ```bash # Networking Service VITE_NETWORKING_SERVICE_URL="https://networking-api.linkedin.prod.mindbricks.com" ```bash # Company Service VITE_COMPANY_SERVICE_URL="https://company-api.linkedin.prod.mindbricks.com" ```bash # Content Service VITE_CONTENT_SERVICE_URL="https://content-api.linkedin.prod.mindbricks.com" ```bash # Messaging Service VITE_MESSAGING_SERVICE_URL="https://messaging-api.linkedin.prod.mindbricks.com" ```bash # Profile Service VITE_PROFILE_SERVICE_URL="https://profile-api.linkedin.prod.mindbricks.com" ```bash # Auth Service VITE_AUTH_SERVICE_URL="https://auth-api.linkedin.prod.mindbricks.com" ``` ## API Communication Patterns ### HTTP Client Configuration **Service-Specific Axios Instances** ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const jobApplicationAxiosInstance = axios.create({ baseURL: CONFIG.jobApplicationServiceUrl }); jobApplicationAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default jobApplicationAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const networkingAxiosInstance = axios.create({ baseURL: CONFIG.networkingServiceUrl }); networkingAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default networkingAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const companyAxiosInstance = axios.create({ baseURL: CONFIG.companyServiceUrl }); companyAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default companyAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const contentAxiosInstance = axios.create({ baseURL: CONFIG.contentServiceUrl }); contentAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default contentAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const messagingAxiosInstance = axios.create({ baseURL: CONFIG.messagingServiceUrl }); messagingAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default messagingAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const profileAxiosInstance = axios.create({ baseURL: CONFIG.profileServiceUrl }); profileAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default profileAxiosInstance; ``` ```javascript import axios from 'axios'; import { CONFIG } from 'src/global-config'; const authAxiosInstance = axios.create({ baseURL: CONFIG.authServiceUrl }); authAxiosInstance.interceptors.response.use( (response) => response, (error) => Promise.reject((error.response && error.response.data) || 'Something went wrong!') ); export default authAxiosInstance; ``` ### Service Endpoints **JobApplication Service Endpoints** ```javascript export const jobApplicationEndpoints = { jobPosting: { updateJobPosting: '/v1/jobpostings/:jobPostingId' , deleteJobPosting: '/v1/jobpostings/:jobPostingId' , getJobPosting: '/v1/jobpostings/:jobPostingId' , listJobPostings: '/v1/jobpostings' , createJobPosting: '/v1/jobpostings' }, jobApplication: { deleteJobApplication: '/v1/jobapplications/:jobApplicationId' , getJobApplication: '/v1/jobapplications/:jobApplicationId' , updateJobApplication: '/v1/jobapplications/:jobApplicationId' , createJobApplication: '/v1/jobapplications' , listJobApplications: '/v1/jobapplications' } }; ``` **Networking Service Endpoints** ```javascript export const networkingEndpoints = { connection: { createConnection: '/v1/connections' , listConnections: '/v1/connections' , deleteConnection: '/v1/connections/:connectionId' , getConnection: '/v1/connections/:connectionId' }, connectionRequest: { deleteConnectionRequest: '/v1/connectionrequests/:connectionRequestId' , updateConnectionRequest: '/v1/connectionrequests/:connectionRequestId' , listConnectionRequests: '/v1/connectionrequests' , createConnectionRequest: '/v1/connectionrequests' , getConnectionRequest: '/v1/connectionrequests/:connectionRequestId' } }; ``` **Company Service Endpoints** ```javascript export const companyEndpoints = { companyFollower: { followCompany: '/v1/followcompany' , unfollowCompany: '/v1/unfollowcompany/:companyFollowerId' , listCompanyFollowers: '/v1/companyfollowers' , getCompanyFollower: '/v1/companyfollowers/:companyFollowerId' }, companyUpdate: { getCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , createCompanyUpdate: '/v1/companyupdates' , updateCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , deleteCompanyUpdate: '/v1/companyupdates/:companyUpdateId' , listCompanyUpdates: '/v1/companyupdates' }, company: { createCompany: '/v1/companies' , getCompany: '/v1/companies/:companyId' , listCompanies: '/v1/companies' , updateCompany: '/v1/companies/:companyId' , deleteCompany: '/v1/companies/:companyId' }, companyAdmin: { getCompanyAdmin: '/v1/companyadmins/:companyAdminId' , removeCompanyAdmin: '/v1/removecompanyadmin/:companyAdminId' , assignCompanyAdmin: '/v1/assigncompanyadmin' , listCompanyAdmins: '/v1/companyadmins' } }; ``` **Content Service Endpoints** ```javascript export const contentEndpoints = { post: { createPost: '/v1/posts' , listPosts: '/v1/posts' , getPost: '/v1/posts/:postId' , deletePost: '/v1/posts/:postId' , updatePost: '/v1/posts/:postId' , listUserPosts: '/v1/userposts' }, like: { likePost: '/v1/likepost' , listLikes: '/v1/likes' , unlikePost: '/v1/unlikepost/:likeId' }, comment: { updateComment: '/v1/comments/:commentId' , createComment: '/v1/comments' , listComments: '/v1/comments' , getComment: '/v1/comments/:commentId' , deleteComment: '/v1/comments/:commentId' } }; ``` **Messaging Service Endpoints** ```javascript export const messagingEndpoints = { message: { listMessages: '/v1/messages' , getMessage: '/v1/messages/:messageId' , updateMessage: '/v1/messages/:messageId' , deleteMessage: '/v1/messages/:messageId' , createMessage: '/v1/messages' }, conversation: { updateConversation: '/v1/conversations/:conversationId' , getConversation: '/v1/conversations/:conversationId' , deleteConversation: '/v1/conversations/:conversationId' , listConversations: '/v1/conversations' , createConversation: '/v1/conversations' } }; ``` **Profile Service Endpoints** ```javascript export const profileEndpoints = { profile: { updateProfile: '/v1/profiles/:profileId' , deleteProfile: '/v1/profiles/:profileId' , listProfiles: '/v1/profiles' , createProfile: '/v1/profiles' , getProfile: '/v1/profiles/:profileId' }, premiumsubscription: { deletePremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , createPremuimSub: '/v1/premuimsub' , updatePremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , getPremuimSub: '/v1/premuimsub/:premiumsubscriptionId' , listPremuimSub: '/v1/premuimsub' , startPremiumsubscriptionPayment: '/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId' , refreshPremiumsubscriptionPayment: '/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId' , callbackPremiumsubscriptionPayment: '/v1/callbackpremiumsubscriptionpayment' }, certification: { updateCertification: '/v1/certifications/:certificationId' , listCertifications: '/v1/certifications' , createCertification: '/v1/certifications' , getCertification: '/v1/certifications/:certificationId' , deleteCertification: '/v1/certifications/:certificationId' }, language: { deleteLanguage: '/v1/languages/:languageId' , updateLanguage: '/v1/languages/:languageId' , listLanguages: '/v1/languages' , getLanguage: '/v1/languages/:languageId' , createLanguage: '/v1/languages' }, sys_premiumsubscriptionPayment: { getPremiumsubscriptionPayment2: '/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId' , listPremiumsubscriptionPayments2: '/v1/premiumsubscriptionpayments2' , createPremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment' , updatePremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId' , deletePremiumsubscriptionPayment: '/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId' , listPremiumsubscriptionPayments2: '/v1/premiumsubscriptionpayments2' , getPremiumsubscriptionPaymentByOrderId: '/v1/premiumsubscriptionpaymentbyorderid/:orderId' , getPremiumsubscriptionPaymentByPaymentId: '/v1/premiumsubscriptionpaymentbypaymentid/:paymentId' , getPremiumsubscriptionPayment2: '/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId' }, sys_paymentCustomer: { getPaymentCustomerByUserId: '/v1/paymentcustomers/:userId' , listPaymentCustomers: '/v1/paymentcustomers' }, sys_paymentMethod: { listPaymentCustomerMethods: '/v1/paymentcustomermethods/:userId' } }; ``` **Auth Service Endpoints** ```javascript export const authEndpoints = { login: "/login", me: "/v1/users/:userId", logout: "/logout", user: { getUser: '/v1/users/:userId' , updateUser: '/v1/users/:userId' , updateProfile: '/v1/profile/:userId' , createUser: '/v1/users' , deleteUser: '/v1/users/:userId' , archiveProfile: '/v1/archiveprofile/:userId' , listUsers: '/v1/users' , searchUsers: '/v1/searchusers' , updateUserRole: '/v1/userrole/:userId' , updateUserPassword: '/v1/userpassword/:userId' , updateUserPasswordByAdmin: '/v1/userpasswordbyadmin/:userId' , getBriefUser: '/v1/briefuser/:userId' , registerUser: '/v1/registeruser' } }; ``` ## Authentication Integration ### JWT Token Management **Basic Token Handling** ```javascript // Authentication is handled through the AuthProvider context // Tokens are managed by the JWT authentication system ``` ### Multi-Service Authentication **Service Authentication Implementation** ```javascript // Basic JWT authentication is used across all services // Authentication context is shared between services ``` ## Data Synchronization ### Real-Time Updates **Data Synchronization Implementation** ```javascript // Data is fetched on-demand through API calls // No real-time synchronization is required ``` ### Optimistic Updates **Update Strategy Implementation** ```javascript // Data is updated directly through API calls // Changes are reflected immediately after successful API response ``` ## Error Handling and Resilience ### Error Handling **Error Handling Implementation** ```javascript // Basic error handling through Axios response interceptors // Errors are logged and simplified for display ``` ### Retry Mechanisms **Retry Implementation** ```javascript // Basic error handling through Axios interceptors // Errors are logged and displayed to users ``` ## Service-Specific Integration Details ### JobApplication Service Integration **Service Overview** - **Service Name**: `jobApplication` - **Display Name**: `JobApplication` - **Primary Purpose**: Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **JobPosting**: Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. - **JobApplication**: Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_JOBAPPLICATION_SERVICE_URL=https://jobApplication-api.linkedin.prod.mindbricks.com ``` ### Networking Service Integration **Service Overview** - **Service Name**: `networking` - **Display Name**: `Networking` - **Primary Purpose**: Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **Connection**: Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. - **ConnectionRequest**: Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_NETWORKING_SERVICE_URL=https://networking-api.linkedin.prod.mindbricks.com ``` ### Company Service Integration **Service Overview** - **Service Name**: `company` - **Display Name**: `Company` - **Primary Purpose**: Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **CompanyFollower**: Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. - **CompanyUpdate**: A post/news update created by company admin and visible to followers depending on visibility. - **Company**: Represents a company profile and brand presence/pages on the network. - **CompanyAdmin**: Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_COMPANY_SERVICE_URL=https://company-api.linkedin.prod.mindbricks.com ``` ### Content Service Integration **Service Overview** - **Service Name**: `content` - **Display Name**: `Content` - **Primary Purpose**: Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **Post**: A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. - **Like**: A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. - **Comment**: A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_CONTENT_SERVICE_URL=https://content-api.linkedin.prod.mindbricks.com ``` ### Messaging Service Integration **Service Overview** - **Service Name**: `messaging` - **Display Name**: `Messaging` - **Primary Purpose**: Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **Message**: Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. - **Conversation**: Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_MESSAGING_SERVICE_URL=https://messaging-api.linkedin.prod.mindbricks.com ``` ### Profile Service Integration **Service Overview** - **Service Name**: `profile` - **Display Name**: `Profile` - **Primary Purpose**: Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **Profile**: Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... - **Premiumsubscription**: premium subscription for a user - **Certification**: Official certification available for selection in user profile (dictionary only, not user relation). - **Language**: Official language available for selection in user profile (dictionary only, not user relation). - **Sys_premiumsubscriptionPayment**: A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config - **Sys_paymentCustomer**: A payment storage object to store the customer values of the payment platform - **Sys_paymentMethod**: A payment storage object to store the payment methods of the platform customers **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_PROFILE_SERVICE_URL=https://profile-api.linkedin.prod.mindbricks.com ``` ### Auth Service Integration **Service Overview** - **Service Name**: `auth` - **Display Name**: `Auth` - **Primary Purpose**: Authentication service for the project **Integration Features** - Basic CRUD operations for data objects - Simple error handling **Data Object Management** - **User**: A data object that stores the user information and handles login settings. **API Endpoints** - Data Operations: Service-specific CRUD endpoints based on business logic **Configuration Requirements** ```bash VITE_AUTH_SERVICE_URL=https://auth-api.linkedin.prod.mindbricks.com ``` ## Performance Optimization ### Caching Strategies **Caching Implementation** ```javascript // Data is fetched on-demand through API calls // No caching is required for current use cases ``` ### Request Batching **Request Batching Implementation** ```javascript // Individual API calls are made as needed // Each operation is handled independently ``` ## Monitoring and Logging ### Service Monitoring **Monitoring Implementation** ```javascript // Basic error logging through console.error // Service health is monitored through API responses ``` ### Error Logging **Error Logging Implementation** ```javascript // Basic error logging through console.error // Errors are displayed to users through UI components ``` # EVENT GUIDE ## linkedin-profile-service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. # Documentation Scope Welcome to the official documentation for the `Profile` Service Event descriptions. This guide is dedicated to detailing how to subscribe to and listen for state changes within the `Profile` Service, offering an exclusive focus on event subscription mechanisms. **Intended Audience** This documentation is aimed at developers and integrators looking to monitor `Profile` Service state changes. It is especially relevant for those wishing to implement or enhance business logic based on interactions with `Profile` objects. **Overview** This section provides detailed instructions on monitoring service events, covering payload structures and demonstrating typical use cases through examples. # Authentication and Authorization Access to the `Profile` service's events is facilitated through the project's Kafka server, which is not accessible to the public. Subscription to a Kafka topic requires being on the same network and possessing valid Kafka user credentials. This document presupposes that readers have existing access to the Kafka server. Additionally, the service offers a public subscription option via REST for real-time data management in frontend applications, secured through REST API authentication and authorization mechanisms. To subscribe to service events via the REST API, please consult the Realtime REST API Guide. # Database Events Database events are triggered at the database layer, automatically and atomically, in response to any modifications at the data level. These events serve to notify subscribers about the creation, update, or deletion of objects within the database, distinct from any overarching business logic. Listening to database events is particularly beneficial for those focused on tracking changes at the database level. A typical use case for subscribing to database events is to replicate the data store of one service within another service's scope, ensuring data consistency and syncronization across services. For example, while a business operation such as "approve membership" might generate a high-level business event like `membership-approved`, the underlying database changes could involve multiple state updates to different entities. These might be published as separate events, such as `dbevent-member-updated` and `dbevent-user-updated`, reflecting the granular changes at the database level. Such detailed eventing provides a robust foundation for building responsive, data-driven applications, enabling fine-grained observability and reaction to the dynamics of the data landscape. It also facilitates the architectural pattern of event sourcing, where state changes are captured as a sequence of events, allowing for high-fidelity data replication and history replay for analytical or auditing purposes. ## DbEvent profile-created **Event topic**: `linkedin-profile-service-dbevent-profile-created` This event is triggered upon the creation of a `profile` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent profile-updated **Event topic**: `linkedin-profile-service-dbevent-profile-updated` Activation of this event follows the update of a `profile` data object. The payload contains the updated information under the `profile` attribute, along with the original data prior to update, labeled as `old_profile` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_profile:{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, profile:{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent profile-deleted **Event topic**: `linkedin-profile-service-dbevent-profile-deleted` This event announces the deletion of a `profile` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent premiumsubscription-created **Event topic**: `linkedin-profile-service-dbevent-premiumsubscription-created` This event is triggered upon the creation of a `premiumsubscription` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent premiumsubscription-updated **Event topic**: `linkedin-profile-service-dbevent-premiumsubscription-updated` Activation of this event follows the update of a `premiumsubscription` data object. The payload contains the updated information under the `premiumsubscription` attribute, along with the original data prior to update, labeled as `old_premiumsubscription` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_premiumsubscription:{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, premiumsubscription:{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent premiumsubscription-deleted **Event topic**: `linkedin-profile-service-dbevent-premiumsubscription-deleted` This event announces the deletion of a `premiumsubscription` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent certification-created **Event topic**: `linkedin-profile-service-dbevent-certification-created` This event is triggered upon the creation of a `certification` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent certification-updated **Event topic**: `linkedin-profile-service-dbevent-certification-updated` Activation of this event follows the update of a `certification` data object. The payload contains the updated information under the `certification` attribute, along with the original data prior to update, labeled as `old_certification` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_certification:{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, certification:{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent certification-deleted **Event topic**: `linkedin-profile-service-dbevent-certification-deleted` This event announces the deletion of a `certification` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent language-created **Event topic**: `linkedin-profile-service-dbevent-language-created` This event is triggered upon the creation of a `language` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent language-updated **Event topic**: `linkedin-profile-service-dbevent-language-updated` Activation of this event follows the update of a `language` data object. The payload contains the updated information under the `language` attribute, along with the original data prior to update, labeled as `old_language` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_language:{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, language:{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent language-deleted **Event topic**: `linkedin-profile-service-dbevent-language-deleted` This event announces the deletion of a `language` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_premiumsubscriptionPayment-created **Event topic**: `linkedin-profile-service-dbevent-sys_premiumsubscriptionpayment-created` This event is triggered upon the creation of a `sys_premiumsubscriptionPayment` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_premiumsubscriptionPayment-updated **Event topic**: `linkedin-profile-service-dbevent-sys_premiumsubscriptionpayment-updated` Activation of this event follows the update of a `sys_premiumsubscriptionPayment` data object. The payload contains the updated information under the `sys_premiumsubscriptionPayment` attribute, along with the original data prior to update, labeled as `old_sys_premiumsubscriptionPayment` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_sys_premiumsubscriptionPayment:{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, sys_premiumsubscriptionPayment:{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent sys_premiumsubscriptionPayment-deleted **Event topic**: `linkedin-profile-service-dbevent-sys_premiumsubscriptionpayment-deleted` This event announces the deletion of a `sys_premiumsubscriptionPayment` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_paymentCustomer-created **Event topic**: `linkedin-profile-service-dbevent-sys_paymentcustomer-created` This event is triggered upon the creation of a `sys_paymentCustomer` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_paymentCustomer-updated **Event topic**: `linkedin-profile-service-dbevent-sys_paymentcustomer-updated` Activation of this event follows the update of a `sys_paymentCustomer` data object. The payload contains the updated information under the `sys_paymentCustomer` attribute, along with the original data prior to update, labeled as `old_sys_paymentCustomer` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_sys_paymentCustomer:{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, sys_paymentCustomer:{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent sys_paymentCustomer-deleted **Event topic**: `linkedin-profile-service-dbevent-sys_paymentcustomer-deleted` This event announces the deletion of a `sys_paymentCustomer` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_paymentMethod-created **Event topic**: `linkedin-profile-service-dbevent-sys_paymentmethod-created` This event is triggered upon the creation of a `sys_paymentMethod` data object in the database. The event payload encompasses the newly created data, encapsulated within the root of the paylod. **Event payload**: ```json {"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## DbEvent sys_paymentMethod-updated **Event topic**: `linkedin-profile-service-dbevent-sys_paymentmethod-updated` Activation of this event follows the update of a `sys_paymentMethod` data object. The payload contains the updated information under the `sys_paymentMethod` attribute, along with the original data prior to update, labeled as `old_sys_paymentMethod` and also you can find the old and new versions of updated-only portion of the data.. **Event payload**: ```json { old_sys_paymentMethod:{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, sys_paymentMethod:{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}, oldDataValues, newDataValues } ``` ## DbEvent sys_paymentMethod-deleted **Event topic**: `linkedin-profile-service-dbevent-sys_paymentmethod-deleted` This event announces the deletion of a `sys_paymentMethod` data object, covering both hard deletions (permanent removal) and soft deletions (where the `isActive` attribute is set to false). Regardless of the deletion type, the event payload will present the data as it was immediately before deletion, highlighting an `isActive` status of false for soft deletions. **Event payload**: ```json {"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` # ElasticSearch Index Events Within the `Profile` service, most data objects are mirrored in ElasticSearch indices, ensuring these indices remain syncronized with their database counterparts through creation, updates, and deletions. These indices serve dual purposes: they act as a data source for external services and furnish aggregated data tailored to enhance frontend user experiences. Consequently, an ElasticSearch index might encapsulate data in its original form or aggregate additional information from other data objects. These aggregations can include both one-to-one and one-to-many relationships not only with database objects within the same service but also across different services. This capability allows developers to access comprehensive, aggregated data efficiently. By subscribing to ElasticSearch index events, developers are notified when an index is updated and can directly obtain the aggregated entity within the event payload, bypassing the need for separate ElasticSearch queries. It's noteworthy that some services may augment another service's index by appending to the entity’s `extends` object. In such scenarios, an `*-extended` event will contain only the newly added data. Should you require the complete dataset, you would need to retrieve the full ElasticSearch index entity using the provided ID. This approach to indexing and event handling facilitates a modular, interconnected architecture where services can seamlessly integrate and react to changes, enriching the overall data ecosystem and enabling more dynamic, responsive applications. ## Index Event profile-created **Event topic**: `elastic-index-linkedin_profile-created` **Event payload**: ```json {"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event profile-updated **Event topic**: `elastic-index-linkedin_profile-created` **Event payload**: ```json {"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event profile-deleted **Event topic**: `elastic-index-linkedin_profile-deleted` **Event payload**: ```json {"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event profile-extended **Event topic**: `elastic-index-linkedin_profile-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event premiumsubscription-created **Event topic**: `elastic-index-linkedin_premiumsubscription-created` **Event payload**: ```json {"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event premiumsubscription-updated **Event topic**: `elastic-index-linkedin_premiumsubscription-created` **Event payload**: ```json {"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event premiumsubscription-deleted **Event topic**: `elastic-index-linkedin_premiumsubscription-deleted` **Event payload**: ```json {"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event premiumsubscription-extended **Event topic**: `elastic-index-linkedin_premiumsubscription-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event certification-created **Event topic**: `elastic-index-linkedin_certification-created` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event certification-updated **Event topic**: `elastic-index-linkedin_certification-created` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event certification-deleted **Event topic**: `elastic-index-linkedin_certification-deleted` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event certification-extended **Event topic**: `elastic-index-linkedin_certification-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event language-created **Event topic**: `elastic-index-linkedin_language-created` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event language-updated **Event topic**: `elastic-index-linkedin_language-created` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event language-deleted **Event topic**: `elastic-index-linkedin_language-deleted` **Event payload**: ```json {"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event language-extended **Event topic**: `elastic-index-linkedin_language-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event sys_premiumsubscriptionpayment-created **Event topic**: `elastic-index-linkedin_sys_premiumsubscriptionpayment-created` **Event payload**: ```json {"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_premiumsubscriptionpayment-updated **Event topic**: `elastic-index-linkedin_sys_premiumsubscriptionpayment-created` **Event payload**: ```json {"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_premiumsubscriptionpayment-deleted **Event topic**: `elastic-index-linkedin_sys_premiumsubscriptionpayment-deleted` **Event payload**: ```json {"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_premiumsubscriptionpayment-extended **Event topic**: `elastic-index-linkedin_sys_premiumsubscriptionpayment-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event sys_paymentcustomer-created **Event topic**: `elastic-index-linkedin_sys_paymentcustomer-created` **Event payload**: ```json {"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentcustomer-updated **Event topic**: `elastic-index-linkedin_sys_paymentcustomer-created` **Event payload**: ```json {"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentcustomer-deleted **Event topic**: `elastic-index-linkedin_sys_paymentcustomer-deleted` **Event payload**: ```json {"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentcustomer-extended **Event topic**: `elastic-index-linkedin_sys_paymentcustomer-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Index Event sys_paymentmethod-created **Event topic**: `elastic-index-linkedin_sys_paymentmethod-created` **Event payload**: ```json {"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentmethod-updated **Event topic**: `elastic-index-linkedin_sys_paymentmethod-created` **Event payload**: ```json {"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentmethod-deleted **Event topic**: `elastic-index-linkedin_sys_paymentmethod-deleted` **Event payload**: ```json {"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"} ``` ## Index Event sys_paymentmethod-extended **Event topic**: `elastic-index-linkedin_sys_paymentmethod-extended` **Event payload**: ```js { id: id, extends: { [extendName]: "Object", [extendName + "_count"]: "Number", }, } ``` # Route Events Route events are emitted following the successful execution of a route. While most routes perform CRUD (Create, Read, Update, Delete) operations on data objects, resulting in route events that closely resemble database events, there are distinctions worth noting. A single route execution might trigger multiple CRUD actions and ElasticSearch indexing operations. However, for those primarily concerned with the overarching business logic and its outcomes, listening to the consolidated route event, published once at the conclusion of the route's execution, is more pertinent. Moreover, routes often deliver aggregated data beyond the primary database object, catering to specific client needs. For instance, creating a data object via a route might not only return the entity's data but also route-specific metrics, such as the executing user's permissions related to the entity. Alternatively, a route might automatically generate default child entities following the creation of a parent object. Consequently, the route event encapsulates a unified dataset encompassing both the parent and its children, in contrast to individual events triggered for each entity created. Therefore, subscribing to route events can offer a richer, more contextually relevant set of information aligned with business logic. The payload of a route event mirrors the REST response JSON of the route, providing a direct and comprehensive reflection of the data and metadata communicated to the client. This ensures that subscribers to route events receive a payload that encapsulates both the primary data involved and any additional information deemed significant at the business level, facilitating a deeper understanding and integration of the service's functional outcomes. ## Route Event profile-updated **Event topic** : `linkedin-profile-service-profile-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-deleted **Event topic** : `linkedin-profile-service-profile-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-deleted **Event topic** : `linkedin-profile-service-language-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-updated **Event topic** : `linkedin-profile-service-language-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profiles-listed **Event topic** : `linkedin-profile-service-profiles-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profiles` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profiles`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event languages-listed **Event topic** : `linkedin-profile-service-languages-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `languages` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`languages`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event language-retrived **Event topic** : `linkedin-profile-service-language-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event language-created **Event topic** : `linkedin-profile-service-language-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `language` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`language`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-created **Event topic** : `linkedin-profile-service-profile-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event profile-retrived **Event topic** : `linkedin-profile-service-profile-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `profile` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`profile`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-deleted **Event topic** : `linkedin-profile-service-premuimsub-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-updated **Event topic** : `linkedin-profile-service-certification-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-created **Event topic** : `linkedin-profile-service-premuimsub-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certifications-listed **Event topic** : `linkedin-profile-service-certifications-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certifications` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certifications`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premuimsub-updated **Event topic** : `linkedin-profile-service-premuimsub-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-retrived **Event topic** : `linkedin-profile-service-premuimsub-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-created **Event topic** : `linkedin-profile-service-certification-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event certification-retrived **Event topic** : `linkedin-profile-service-certification-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premuimsub-listed **Event topic** : `linkedin-profile-service-premuimsub-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscriptions` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscriptions`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event certification-deleted **Event topic** : `linkedin-profile-service-certification-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `certification` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`certification`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpayment-created **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-created` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-updated **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-updated` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-deleted **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-deleted` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayments2-listed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayments2-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayments` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayments`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event premiumsubscriptionpaymentbyorderid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbyorderid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpaymentbypaymentid-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpaymentbypaymentid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment2-retrived **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment2-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_premiumsubscriptionPayment` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_premiumsubscriptionPayment`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event premiumsubscriptionpayment-started **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-started` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-refreshed **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-refreshed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event premiumsubscriptionpayment-calledback **Event topic** : `linkedin-profile-service-premiumsubscriptionpayment-calledback` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `premiumsubscription` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`premiumsubscription`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` ## Route Event paymentcustomerbyuserid-retrived **Event topic** : `linkedin-profile-service-paymentcustomerbyuserid-retrived` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomer` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomer`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` ## Route Event paymentcustomers-listed **Event topic** : `linkedin-profile-service-paymentcustomers-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentCustomers` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentCustomers`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` ## Route Event paymentcustomermethods-listed **Event topic** : `linkedin-profile-service-paymentcustomermethods-listed` **Event payload**: The event payload, mirroring the REST API response, is structured as an encapsulated JSON. It includes metadata related to the API as well as the `sys_paymentMethods` data object itself. The following JSON included in the payload illustrates the fullest representation of the **`sys_paymentMethods`** object. Note, however, that certain properties might be excluded in accordance with the object's inherent logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` # Copyright All sources, documents and other digital materials are copyright of . # About Us For more information please visit our website: . . . # **LINKEDIN** FRONTEND GUIDE FOR AI CODING AGENTS This document is a rest api guide for the linkedin project. The document is designed for AI agents who will generate frontend code that will consume the project backend. The project has got 1 auth service, 1 notification service, 1 bff service and business services. Each service is a separate microservice application and listens the HTTP request from different service urls. The services may be in preview server, staging server or real production server. So each service have got 3 acess urls. Frontend application should support all deployemnt servers in the development phase, and user should be able to select the target api server in the login page. ## Project Introduction This project's structure and ideas are the same as he real linkedIn webiste ## API Structure ### Object Structure of a Successfull Response When the service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3, "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. ### Additional Data Each api may have include addtional data other than the main data object according to the business logic of the API. They will be given in each API's response signature. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication token , login required - **403 Forbidden Error** Curent token provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ## Accessing the backend Each service of the backend has got its own url according to the deployment environement. User may want to test the frontend in one of the 3 deployments of the application, preview, staging and production. Please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. The base url of the application in each environment is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com` * **Staging:** `https://linkedin-stage.mindbricks.co` * **Production:** `https://linkedin.mindbricks.co` For the auth service the base url is as follows: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` For each other service, the service base url will be given in service sections. Any login requied request to the backend should have a valid token, when a user makes a successfull login, the ressponse JSON includes a JWT access token in the `accessToken`fields. In normal conditions, this token is also set to the cookie and then consumed automatically, but since AI coding agents preview options may fail to use cookies, please ensure that in each request include the access token in the bearer auth header. ## Registration Management First of all please ensure that register and login pages do have a deployemnt server selection option, so as the frontned coding agent you can arrange the base url path of all services. Start with a landing page and arranging register, verification and login flow. So at the first step, you need a general knowledge of the application to make a good landing page and the authetication flow. ### How To Register Using `registeruser` route of auth api, send the required fields to the backend in your registration page. The registerUser api in in `auth` service, is described with request and response structure below. Note that since `registerUser` api is a business api, it has a version control, so please call it with the given version like `/v1/registeruser` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` After a successful registration, frontend code should handle the verification needs. The registration response will have a `user` object in the root envelope, this object will have user information with an `id` parameter. ### Email Verification In the registration response, you should check the property `emailVerificationNeeded` in the reponse root, and if this property is true you should start the email verification flow. After login process, if you get an HTTP error status, and if there is an `errCode` property in the response with `EmailVerificationNeeded` value, you should start the email verification flow. 1. Call the email verification `start` route of the backend (described below) with the user email, backend will send a secret code to the given email adresss. **Backend can send the email message if the architect defined a real mail service or smtp server, so during the development time backend will send the secret code also to the frontend. You can get this secret code from the response within the `secretCode` property**. 2. The secret code in the sent email message will be a 6 digits code , and you should arrange an input page so that the user can paste this code to the frontend application. Please navigate to this input page after you start the verification process. **If the secretCode is sent to the frontend for test purposes, then you should show it as info in the input page, so that user can copy and paste it**. 3. There is a `codeIndex` property in the start response, please show it's value on the input page, so that user can match the index in the message with the one on the screen. 4. When the user submits the code, please complete the email verification using the `complete` route of the backend (described below) with the user email and the secret code. 5. After you get a successful response from email verification, you can navigate to the login page. Here is the `start`and `complete` routes of email verification. These are system routes , so they dont have a version control. #### `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- #### `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ## Login Management After a successfull login and completing required verifications, user can now login. Please make a fancy minimal login page where user can enter his email and password. ## Bucket Management This application has a bucket service and is used to store user or other objects related files. Bucket service is login agnostic, so when accessing for write or private read, you should insert a bucket token (given by services) to your request authorization header as bearer token. **User Bucket** This bucket is used to store public user files for each user. When a user logs in, or in /currentuser response there is `userBucketToken` to be used when sending user related public files to the bucket service. To upload `POST {baseUrl}/bucket/upload` Request body is form data which includes the bucketId and the file as binary in `files` property. ```js { bucketId: "{userId}-public-user-bucket", files: {binary} } ``` Response status is 200 on succesfull result, eg body: ```json { "success": true, "data": [ { "fileId": "9da03f6d-0409-41ad-bb06-225a244ae408", "originalName": "test (10).png", "mimeType": "image/png", "size": 604063, "status": "uploaded", "bucketName": "f7103b85-fcda-4dec-92c6-c336f71fd3a2-public-user-bucket", "isPublic": true, "downloadUrl": "https://babilcom.mindbricks.co/bucket/download/9da03f6d-0409-41ad-bb06-225a244ae408" } ] } ``` To download a file from the bucket, you should know its fileId, so if youupload an avatar or something else, be sure that the download url or the fileId is stored in backend. Bucket is mostly used, in object creations where alos demands an addtional file like a product image or user avatar. So after you upload your image to the bucket, insert the returned download url to the related property in the related object creation. **Application Bucket** This Linkedin application alos has common public bucket which everybody has a read access, but only users who have `superAdmin`, `admin` or `saasAdmin` roles can write (upload) to the bucket. The common public project bucket id is `"linkedin-public-common-bucket"` and in certain areas like product image uploads, since the user will already have the admin bucket token, he will be able to upload realted object images. Please make your UI arrangements as able to upload files to the bucket using these bucket tokens. **Object Buckets** Some objects may return also a bucket token, to upload or access related files with object. For example, when you get a project's data in a project management application, if there is a public or private bucket token, this is provided mostly for uploading project related files or downloading them with the token. These buckets will be used according to the descriptions given along with the object definitions. ## Role Management This Linkedin may have different role names defined fro different business logic. But unless another case is asked by the user, respect to the admin roles which may be `superAdmin`, `admin` or `saasAdmin` in the currentuser or login response given with the `roleId`property. ```json { // ... "roleId":"superAdmin", // ... } ``` If the application needs an admin panel, or any admin related page, please use these roleId's to decide if the user can access those pages or not. ## 1. Authentication Routes ### 1.1 `POST /login` — User Login **Purpose:** Verifies user credentials and creates an authenticated session with a JWT access token. **Access Routes:** * `GET /login`: Returns a minimal HTML login page (for browser-based testing). * `POST /login`: Authenticates user credentials and returns an access token and session. #### Request Parameters | Parameter | Type | Required | Source | | ---------- | ------ | -------- | ----------------------- | | `username` | String | Yes | `request.body.username` | | `password` | String | Yes | `request.body.password` | #### Behavior * Authenticates credentials and returns a session object. * Sets cookie: `projectname-access-token[-tenantCodename]` * Adds the same token in response headers. * Accepts either `username` or `email` fields (if both exist, `username` is prioritized). #### Example ```js axios.post("/login", { username: "user@example.com", password: "securePassword" }); ``` #### Success Response ```json { "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", //... } ``` #### Error Responses * `401 Unauthorized`: Invalid credentials * `403 Forbidden`: Email/mobile verification or 2FA pending * `400 Bad Request`: Missing parameters --- ### 1.2 `POST /logout` — User Logout **Purpose:** Terminates the current session and clears associated authentication tokens. #### Behavior * Invalidates session (if exists). * Clears cookie `projectname-access-token[-tenantCodename]`. * Returns a confirmation response (always `200 OK`). #### Example ```js axios.post("/logout", {}, { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` #### Notes * Can be called without a session (idempotent behavior). * Works for both cookie-based and token-based sessions. #### Success Response ```json { "status": "OK", "message": "User logged out successfully" } ``` --- ## 2. Verification Services Overview All verification routes are grouped under the `/verification-services` base path. They follow a **two-step verification pattern**: `start` → `complete`. --- ## 3. Email Verification ### 3.1 Trigger Scenarios * After registration (`emailVerificationRequiredForLogin` = true) * When updating email address * When login fails due to unverified email ### 3.2 Flow Summary 1. `/start` → Generate & send code via email. 2. `/complete` → Verify code and mark email as verified. ** PLEASE NOTE ** Email verification is a frontend triiggered process. After user registers, the frontend should start the email verification process and navigate to its code input page. --- ### 3.3 `POST /verification-services/email-verification/start` **Purpose:** Starts the email verification by generating and sending a secret code. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------ | | `email` | String | Yes | User’s email address to verify | **Example Request** ```json { "email": "user@example.com" } ``` **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ In production, `secretCode` is **not** returned — only sent via email. **Error Responses** * `400 Bad Request`: Already verified * `403 Forbidden`: Too many attempts (rate limit) --- ### 3.4 `POST /verification-services/email-verification/complete` **Purpose:** Completes the verification using the received code. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------- | | `email` | String | Yes | User’s email | | `secretCode` | String | Yes | Verification code | **Success Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` **Error Responses** * `403 Forbidden`: Code expired or mismatched * `404 Not Found`: No verification in progress --- ### 3.5 Behavioral Notes * **Resend Cooldown:** `resendTimeWindow` (e.g. 60s) * **Expiration:** Codes expire after `expireTimeWindow` (e.g. 1 day) * **Single Active Session:** One verification per user --- ## 4. Mobile Verification ### 4.1 Trigger Scenarios * After registration (`mobileVerificationRequiredForLogin` = true) * When updating phone number * On login requiring mobile verification ### 4.2 Flow 1. `/start` → Sends verification code via SMS 2. `/complete` → Validates code and confirms number --- ### 4.3 `POST /verification-services/mobile-verification/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------ | | `email` | String | Yes | User’s email to locate mobile record | **Success Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 180, "verificationType": "byCode", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` > ⚠️ `secretCode` returned only in development. **Errors** * `400 Bad Request`: Already verified * `403 Forbidden`: Rate-limited --- ### 4.4 `POST /verification-services/mobile-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code received via SMS | **Success Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 333 ...", // in testMode "userId": "user-uuid", } ``` --- ### 4.5 Behavioral Notes * **Cooldown:** One code per minute * **Expiration:** Codes valid for 1 day * **One Session Per User** --- ## 5. Two-Factor Authentication (2FA) ### 5.1 Email 2FA **Flow** 1. `/start` → Generates and sends email code 2. `/complete` → Verifies code and updates session --- #### `POST /verification-services/email-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Current session | | `client` | String | No | Optional context | | `reason` | String | No | Reason for 2FA | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/email-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code from email | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.2 Mobile 2FA **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and finalizes session --- #### `POST /verification-services/mobile-2factor-verification/start` | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------- | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `client` | String | No | Context | | `reason` | String | No | Reason | **Response** ```json { "status": "OK", "sessionId": "user session id UUID", "userId": "user-uuid", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", } ``` --- #### `POST /verification-services/mobile-2factor-verification/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------ | | `userId` | String | Yes | User ID | | `sessionId` | String | Yes | Session ID | | `secretCode` | String | Yes | Code via SMS | **Response** ```json { // user session data "sessionId": "session-uuid", // ... } ``` --- ### 5.3 2FA Behavioral Notes * One active code per session * Cooldown: `resendTimeWindow` (e.g., 60s) * Expiration: `expireTimeWindow` (e.g., 5m) --- ## 6. Password Reset ### 6.1 By Email **Flow** 1. `/start` → Sends verification code via email 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-email/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | `email` | String | Yes | User email | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-email/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ------------- | | `email` | String | Yes | User email | | `secretCode` | String | Yes | Code received | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "email": "user@email.com", // in testMode "userId": "user-uuid", } ``` --- ### 6.2 By Mobile **Flow** 1. `/start` → Sends SMS code 2. `/complete` → Validates and resets password --- #### `POST /verification-services/password-reset-by-mobile/start` | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------- | | `mobile` | String | Yes | Mobile number | **Response** ```json { "status": "OK", "codeIndex": 1, // timeStamp : Milliseconds since Jan 1, 1970, 00:00:00.000 GMT "timeStamp": 1784578660000, "date": "Mon Jul 20 2026 23:17:40 GMT+0300 (GMT+03:00)", // expireTime: in seconds "expireTime": 86400, "verificationType": "byLink", // in testMode "secretCode": "123456", "userId": "user-uuid", } ``` #### `POST /verification-services/password-reset-by-mobile/complete` | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ---------------- | | `email` | String | Yes | Associated email | | `secretCode` | String | Yes | Code via SMS | | `password` | String | Yes | New password | **Response** ```json { "status": "OK", "isVerified": true, "mobile": "+1 444 ....", // in testMode "userId": "user-uuid", } ``` --- ### 6.3 Behavioral Notes * Cooldown: 60s resend * Expiration: 24h * One session per user * Works without an active login session --- ## 7. Verification Method Types ### 7.1 `byCode` User manually enters the 6-digit code in frontend. ### 7.2 `byLink` Frontend handles a one-click verification via email/SMS link containing code parameters. ## 8) `GET /currentuser` — Current Session **Purpose** Return the currently authenticated user’s session. **Route Type** `sessionInfo` **Authentication** Requires a valid access token (header or cookie). ### Request *No parameters.* ### Example ```js axios.get("/currentuser", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Returns the session object (identity, tenancy, token metadata): ```json { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", "...": "..." } ``` ### Errors * **401 Unauthorized** — No active session/token ```json { "status": "ERR", "message": "No login found" } ``` **Notes** * Commonly called by web/mobile clients after login to hydrate session state. * Includes key identity/tenant fields and a token reference (if applicable). * Ensure a valid token is supplied to receive a 200 response. --- ## 9) `GET /permissions` — List Effective Permissions **Purpose** Return all effective permission grants for the current user. **Route Type** `permissionFetch` **Authentication** Requires a valid access token. ### Request *No parameters.* ### Example ```js axios.get("/permissions", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) Array of permission grants (aligned with `givenPermissions`): ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` **Field meanings (per item):** * `permissionName`: Granted permission key. * `roleId`: Present if granted via role. * `subjectUserId`: Present if granted directly to the user. * `subjectUserGroupId`: Present if granted via group. * `objectId`: Present if scoped to a specific object (OBAC). * `canDo`: `true` if enabled, `false` if restricted. ### Errors * **401 Unauthorized** — No active session ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error** — Unexpected failure **Notes** * Available on all Mindbricks-generated services (not only Auth). * **Auth service:** Reads live `givenPermissions` from DB. * **Other services:** Typically respond from a cached/projected view (e.g., ElasticSearch) for faster checks. > **Tip:** Cache permission results client-side/server-side and refresh after login or permission updates. --- ## 10) `GET /permissions/:permissionName` — Check Permission Scope **Purpose** Check whether the current user has a specific permission and return any scoped object exceptions/inclusions. **Route Type** `permissionScopeCheck` **Authentication** Requires a valid access token. ### Path Parameters | Name | Type | Required | Source | | ---------------- | ------ | -------- | ------------------------------- | | `permissionName` | String | Yes | `request.params.permissionName` | ### Example ```js axios.get("/permissions/orders.manage", { headers: { Authorization: "Bearer " } }); ``` ### Success (200) ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` **Interpretation** * If `canDo: true`: permission is generally granted **except** the listed `exceptions` (restrictions). * If `canDo: false`: permission is generally **not** granted, **only** allowed for the listed `exceptions` (selective overrides). * `exceptions` contains object IDs (UUID strings) from the relevant domain model. ### Errors * **401 Unauthorized** — No active session/token. ## Services And Data Object ## Auth Service Authentication service for the project ### Auth Service Data Objects **User** A data object that stores the user information and handles login settings. ### Auth Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/auth-api` * **Staging:** `https://linkedin-stage.mindbricks.co/auth-api` * **Production:** `https://linkedin.mindbricks.co/auth-api` ### `Get User` API This api is used by admin roles or the users themselves to get the user profile information. **Rest Route** The `getUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `getUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update User` API This route is used by admins to update user profiles. **Rest Route** The `updateUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `updateUser` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Profile` API This route is used by users to update their profiles. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profile/:userId` **Rest Request Parameters** The `updateProfile` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | **userId** : This id paremeter is used to select the required data object that will be updated **fullname** : A string value to represent the fullname of the user **avatar** : The avatar url of the user. A random avatar will be generated if not provided **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create User` API This api is used by admin roles to create a new user manually from admin panels **Rest Route** The `createUser` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `createUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **email** : A string value to represent the user's email. **password** : A string value to represent the user's password. It will be stored as hashed. **fullname** : A string value to represent the fullname of the user **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete User` API This api is used by admins to delete user profiles. **Rest Route** The `deleteUser` API REST controller can be triggered via the following route: `/v1/users/:userId` **Rest Request Parameters** The `deleteUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Archive Profile` API This api is used by users to archive their profiles. **Rest Route** The `archiveProfile` API REST controller can be triggered via the following route: `/v1/archiveprofile/:userId` **Rest Request Parameters** The `archiveProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Users` API The list of users is filtered by the tenantId. **Rest Route** The `listUsers` API REST controller can be triggered via the following route: `/v1/users` **Rest Request Parameters** The `listUsers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Search Users` API The list of users is filtered by the tenantId. **Rest Route** The `searchUsers` API REST controller can be triggered via the following route: `/v1/searchusers` **Rest Request Parameters** The `searchUsers` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | **keyword** : **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Userrole` API This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin **Rest Route** The `updateUserRole` API REST controller can be triggered via the following route: `/v1/userrole/:userId` **Rest Request Parameters** The `updateUserRole` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | **userId** : This id paremeter is used to select the required data object that will be updated **roleId** : The new roleId of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpassword` API This route is used to update the password of users in the profile page by users themselves **Rest Route** The `updateUserPassword` API REST controller can be triggered via the following route: `/v1/userpassword/:userId` **Rest Request Parameters** The `updateUserPassword` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | **userId** : This id paremeter is used to select the required data object that will be updated **oldPassword** : The old password of the user that will be overridden bu the new one. Send for double check. **newPassword** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Userpasswordbyadmin` API This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords **Rest Route** The `updateUserPasswordByAdmin` API REST controller can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` **Rest Request Parameters** The `updateUserPasswordByAdmin` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | **userId** : This id paremeter is used to select the required data object that will be updated **password** : The new password of the user to be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Briefuser` API This route is used by public to get simple user profile information. **Rest Route** The `getBriefUser` API REST controller can be triggered via the following route: `/v1/briefuser/:userId` **Rest Request Parameters** The `getBriefUser` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | **userId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` **REST Response** This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` ### `Register User` API This api is used by public users to register themselves **Rest Route** The `registerUser` API REST controller can be triggered via the following route: `/v1/registeruser` **Rest Request Parameters** The `registerUser` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | **avatar** : The avatar url of the user. If not sent, a default random one will be generated. **password** : The password defined by the the user that is being registered. **fullname** : The fullname defined by the the user that is being registered. **email** : The email defined by the the user that is being registered. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## JobApplication Service Microservice handling job postings (created by recruiters/company admins), job applications (created by users), allowing job search, application submission, and status update workflows. Enforces business rules around application status, admin controls, and lets professionals apply and track job applications .within the network. ### JobApplication Service Data Objects **JobPosting** Job posting entity representing an open position with a company. Created/managed by company admins or recruiters. Fields include companyId, postedByUserId, title, details, requirements, employment type, salary, deadline, etc. **JobApplication** Record of a user applying for a specific jobPosting (tracks application/resume/status/audit). Each application is unique per user x jobPosting. ### JobApplication Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/jobapplication-api` * **Staging:** `https://linkedin-stage.mindbricks.co/jobapplication-api` * **Production:** `https://linkedin.mindbricks.co/jobapplication-api` ### `Delete Jobapplication` API Delete (soft) job application. Only applicant or admin for the job's company may delete. **Rest Route** The `deleteJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `deleteJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobapplication` API Get job application record. Only applicant or admin of company may view. **Rest Route** The `getJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `getJobApplication` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | **jobApplicationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobposting` API Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. **Rest Route** The `updateJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `updateJobPosting` api has got 12 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **jobPostingId** : This id paremeter is used to select the required data object that will be updated **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Jobposting` API Delete (soft) a job posting. Only admin for companyId may delete. **Rest Route** The `deleteJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `deleteJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Jobposting` API Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. **Rest Route** The `getJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings/:jobPostingId` **Rest Request Parameters** The `getJobPosting` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | **jobPostingId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Jobapplication` API Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. **Rest Route** The `updateJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` **Rest Request Parameters** The `updateJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobApplicationId** : This id paremeter is used to select the required data object that will be updated **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Jobapplication` API Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. **Rest Route** The `createJobApplication` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `createJobApplication` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | **jobPostingId** : FK to jobPosting: job applied for. **coverLetter** : User's (optional) cover letter/body with application. **resumeUrl** : URL/path to user resume/doc to share with recruiter/admin. User-provided. **status** : Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Jobpostings` API List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. **Rest Route** The `listJobPostings` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `listJobPostings` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Jobapplications` API List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. **Rest Route** The `listJobApplications` API REST controller can be triggered via the following route: `/v1/jobapplications` **Rest Request Parameters** The `listJobApplications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Jobposting` API Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. **Rest Route** The `createJobPosting` API REST controller can be triggered via the following route: `/v1/jobpostings` **Rest Request Parameters** The `createJobPosting` api has got 11 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | **description** : Detailed description of the job posting. **title** : Job title/position name. **applicationDeadline** : Last date for accepting applications. Checked during apply. **companyId** : Company offering the job. FK to company:company **employmentType** : Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). **salaryRange** : Human-readable salary range (free-form for v1; can be refined later). **location** : Primary job location (city, country, etc.) **visibility** : Controls who can see/apply to this job: public (all) or private (admins only). **workplaceType** : Workplace type (on-site,remote,hybrid). **status** : status : active or closed **companyName** : company name **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Networking Service Handles professional networking logic for user-to-user connections: manages connection requests, accepted relationships, listing/removal, permissions, and state transitions. Publishes connection lifecycle events for notification... ### Networking Service Data Objects **Connection** Represents a single established user-to-user professional relationship (mutual connection). One record per unordered user pair, deleted on disconnect.. **ConnectionRequest** Tracks a user's request to connect with another user, supporting request/accept/reject/cancel, with audit timestamps. ### Networking Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/networking-api` * **Staging:** `https://linkedin-stage.mindbricks.co/networking-api` * **Production:** `https://linkedin.mindbricks.co/networking-api` ### `Create Connection` API Create Connection **Rest Route** The `createConnection` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `createConnection` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | **userId1** : FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. **userId2** : FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connectionrequest` API Sender or receiver may cancel/delete a connection request (soft-delete). **Rest Route** The `deleteConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `deleteConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Connectionrequest` API Allows receiver of a pending connection request to accept or reject request. **Rest Route** The `updateConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `updateConnectionRequest` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | **connectionRequestId** : This id paremeter is used to select the required data object that will be updated **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Connections` API List all active connections where session user is a participant. **Rest Route** The `listConnections` API REST controller can be triggered via the following route: `/v1/connections` **Rest Request Parameters** The `listConnections` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Connectionrequests` API List connection requests involving current user, filterable by status (pending, accepted, rejected). **Rest Route** The `listConnectionRequests` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `listConnectionRequests` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Connectionrequest` API Send a new connection request from logged-in user to another user. **Rest Route** The `createConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests` **Rest Request Parameters** The `createConnectionRequest` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | **receiverUserId** : FK to auth:user.id — target of the request. **status** : Request status: pending/accepted/rejected. **respondedAt** : Timestamp when receiver accepted/rejected. **message** : Optional introductory message from sender to receiver. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Connection` API Break (delete) the connection between two users. Either user may disconnect. **Rest Route** The `deleteConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `deleteConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connectionrequest` API Get a specific connection request by ID if sender/receiver. **Rest Route** The `getConnectionRequest` API REST controller can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` **Rest Request Parameters** The `getConnectionRequest` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | **connectionRequestId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Connection` API Get connection between session user and another user (if exists, not soft-deleted). **Rest Route** The `getConnection` API REST controller can be triggered via the following route: `/v1/connections/:connectionId` **Rest Request Parameters** The `getConnection` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | **connectionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Company Service Handles company profiles, company admin assignments, company following, and posting company updates/news. Enables professionals to follow companies, get updates, and enables admins to manage company presence.. ### Company Service Data Objects **CompanyFollower** Tracks when a user follows a company to receive updates. Append-only, deletes for unfollow. **CompanyUpdate** A post/news update created by company admin and visible to followers depending on visibility. **Company** Represents a company profile and brand presence/pages on the network. **CompanyAdmin** Tracks which users are assigned as admins for a company, allowing them to manage the company page and edits. ### Company Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/company-api` * **Staging:** `https://linkedin-stage.mindbricks.co/company-api` * **Production:** `https://linkedin.mindbricks.co/company-api` ### `Get Companyadmin` API Get company admin record by ID. Only admins can query of their company. **Rest Route** The `getCompanyAdmin` API REST controller can be triggered via the following route: `/v1/companyadmins/:companyAdminId` **Rest Request Parameters** The `getCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Follow Company` API Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. **Rest Route** The `followCompany` API REST controller can be triggered via the following route: `/v1/followcompany` **Rest Request Parameters** The `followCompany` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | **userId** : FK to auth:user who follows the company. **companyId** : FK to company:company being followed. **followedAt** : Timestamp when user followed company. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Remove Companyadmin` API Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? **Rest Route** The `removeCompanyAdmin` API REST controller can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` **Rest Request Parameters** The `removeCompanyAdmin` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | **companyAdminId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Company` API Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). **Rest Route** The `createCompany` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `createCompany` api has got 8 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Company` API Get a company page by ID. If public, anyone can view. If private, only admin/followers. **Rest Route** The `getCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `getCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companies` API List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. **Rest Route** The `listCompanies` API REST controller can be triggered via the following route: `/v1/companies` **Rest Request Parameters** The `listCompanies` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Company` API Updates fields of a company page/profile. Only current company admin can update. **Rest Route** The `updateCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `updateCompany` api has got 9 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | **companyId** : This id paremeter is used to select the required data object that will be updated **name** : Company brand name. Displayed and searchable. Unique per company. **website** : Official company website link. **location** : Company HQ/main location string (e.g. city, country). **logoUrl** : Uploaded image URL for company logo/branding. **pageVisibility** : Visibility of the company page (public/private). **createdByUserId** : **description** : Company description / about section. **industry** : Industry sector or market. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Company` API Deletes (soft-delete) a company page. Only current admin may delete. **Rest Route** The `deleteCompany` API REST controller can be triggered via the following route: `/v1/companies/:companyId` **Rest Request Parameters** The `deleteCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | **companyId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Assign Companyadmin` API Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. **Rest Route** The `assignCompanyAdmin` API REST controller can be triggered via the following route: `/v1/assigncompanyadmin` **Rest Request Parameters** The `assignCompanyAdmin` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | **assignedAt** : Timestamp when admin assigned. **userId** : FK to auth:user who is admin of this company. **companyId** : FK to company. **assignedBy** : User who assigned this admin (for audit). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyadmins` API List all current admins for a given company. Only admins can query their company admin list. **Rest Route** The `listCompanyAdmins` API REST controller can be triggered via the following route: `/v1/companyadmins` **Rest Request Parameters** The `listCompanyAdmins` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Companyupdate` API Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. **Rest Route** The `getCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `getCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Unfollow Company` API Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. **Rest Route** The `unfollowCompany` API REST controller can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` **Rest Request Parameters** The `unfollowCompany` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyfollowers` API List all followers of a company. Only company admin can see list of all followers. **Rest Route** The `listCompanyFollowers` API REST controller can be triggered via the following route: `/v1/companyfollowers` **Rest Request Parameters** The `listCompanyFollowers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Companyupdate` API Posts a company update/news. Only active admin of company may post on that company's behalf. **Rest Route** The `createCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `createCompanyUpdate` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | **companyId** : FK to company whose update this is. **content** : Body/content of the update/news item. **authorUserId** : FK to auth:user who authored the update (must be active admin at time of post). **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Companyupdate` API Update company update post/news. Only author or company admins may update. **Rest Route** The `updateCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `updateCompanyUpdate` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | **companyUpdateId** : This id paremeter is used to select the required data object that will be updated **content** : Body/content of the update/news item. **attachmentUrls** : Array of URLs for update attachments (files, images, links). **visibility** : Update visibility: public (all) or private (followers only). **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Companyfollower` API Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. **Rest Route** The `getCompanyFollower` API REST controller can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` **Rest Request Parameters** The `getCompanyFollower` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | **companyFollowerId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Companyupdate` API Delete (soft delete) a company update/news. Only author or current admin may delete. **Rest Route** The `deleteCompanyUpdate` API REST controller can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` **Rest Request Parameters** The `deleteCompanyUpdate` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | **companyUpdateId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Companyupdates` API List company updates/news for a company. Public updates are visible to all, private to followers/admins. **Rest Route** The `listCompanyUpdates` API REST controller can be triggered via the following route: `/v1/companyupdates` **Rest Request Parameters** The `listCompanyUpdates` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ## Content Service Handles creation, editing, and deletion of user posts (with attachments and visibility), user post feed aggregation, and post engagement (likes, comments). All with post-level visibility control (public/private).. ### Content Service Data Objects **Post** A user or company-authored post in the feed, with content, optional attachments, and public/private visibility. Belongs to a user (author) and optionally a company. **Like** A record of a user liking a specific post. Each user can like a post only once. Used for engagement counts and activity feeds. **Comment** A comment on a post. Can be a top-level or a reply to another comment (via parentCommentId). ### Content Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/content-api` * **Staging:** `https://linkedin-stage.mindbricks.co/content-api` * **Production:** `https://linkedin.mindbricks.co/content-api` ### `Create Post` API Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. **Rest Route** The `createPost` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `createPost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **authorUserId** : FK to auth:user - the user who created the post. Required. **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Comment` API Update an existing comment. Only the author can update. **Rest Route** The `updateComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `updateComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **commentId** : This id paremeter is used to select the required data object that will be updated **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Posts` API List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. **Rest Route** The `listPosts` API REST controller can be triggered via the following route: `/v1/posts` **Rest Request Parameters** The `listPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Like Post` API Like a post. User can like a post only once; duplicate likes prevented. **Rest Route** The `likePost` API REST controller can be triggered via the following route: `/v1/likepost` **Rest Request Parameters** The `likePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | **postId** : FK to content:post - the post that was liked. Required. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Post` API Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). **Rest Route** The `getPost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `getPost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Comment` API Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. **Rest Route** The `createComment` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `createComment` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | **postId** : FK to content:post - the post this comment is for. Required. **content** : Comment body/content. **parentCommentId** : Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Post` API Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. **Rest Route** The `deletePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `deletePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | **postId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Post` API Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). **Rest Route** The `updatePost` API REST controller can be triggered via the following route: `/v1/posts/:postId` **Rest Request Parameters** The `updatePost` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | **postId** : This id paremeter is used to select the required data object that will be updated **content** : Main post content/body text **companyId** : Optional. FK to company:company - if set, post is from company context (by admin). **visibility** : Post-level visibility: public or private. **attachmentUrls** : Array of attachment URLs (e.g. images, docs, links). Optional. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Likes` API List likes on a given post (or by user). Supports filtering by postId and userId. **Rest Route** The `listLikes` API REST controller can be triggered via the following route: `/v1/likes` **Rest Request Parameters** The `listLikes` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Unlike Post` API Undo a like by user for a given post. Soft-deletes the like record. **Rest Route** The `unlikePost` API REST controller can be triggered via the following route: `/v1/unlikepost/:likeId` **Rest Request Parameters** The `unlikePost` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | **likeId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Comments` API List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. **Rest Route** The `listComments` API REST controller can be triggered via the following route: `/v1/comments` **Rest Request Parameters** The `listComments` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Comment` API Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. **Rest Route** The `getComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `getComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Userposts` API list all posts of a user **Rest Route** The `listUserPosts` API REST controller can be triggered via the following route: `/v1/userposts` **Rest Request Parameters** The `listUserPosts` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Comment` API Delete (soft-delete) a comment. Only the author may delete. **Rest Route** The `deleteComment` API REST controller can be triggered via the following route: `/v1/comments/:commentId` **Rest Request Parameters** The `deleteComment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | **commentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Messaging Service Handles direct, private 1:1 and group messaging between users, conversation management, and message history/storage.. ### Messaging Service Data Objects **Message** Message posted within a conversation. Tracks content, sender, readBy, and deletedFor status per user. **Conversation** Messaging thread among users supporting 1:1 and group. Tracks participants, group status, and last message time. ### Messaging Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/messaging-api` * **Staging:** `https://linkedin-stage.mindbricks.co/messaging-api` * **Production:** `https://linkedin.mindbricks.co/messaging-api` ### `List Messages` API List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. **Rest Route** The `listMessages` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `listMessages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Conversation` API Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. **Rest Route** The `updateConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `updateConversation` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **conversationId** : This id paremeter is used to select the required data object that will be updated **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Message` API Fetch a specific message if the requesting user is a participant in the conversation. **Rest Route** The `getMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `getMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Conversation` API Fetch details for a conversation thread. Only participants may view. **Rest Route** The `getConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `getConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Message` API Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. **Rest Route** The `updateMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `updateMessage` api has got 4 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | **messageId** : This id paremeter is used to select the required data object that will be updated **content** : Raw message body/content. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Conversation` API Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). **Rest Route** The `deleteConversation` API REST controller can be triggered via the following route: `/v1/conversations/:conversationId` **Rest Request Parameters** The `deleteConversation` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | **conversationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Conversations` API List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). **Rest Route** The `listConversations` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `listConversations` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Message` API Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). **Rest Route** The `deleteMessage` API REST controller can be triggered via the following route: `/v1/messages/:messageId` **Rest Request Parameters** The `deleteMessage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | **messageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Message` API Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. **Rest Route** The `createMessage` API REST controller can be triggered via the following route: `/v1/messages` **Rest Request Parameters** The `createMessage` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | **content** : Raw message body/content. **senderUserId** : auth:user.id of message sender. **deletedFor** : Array of userIds who have deleted/hid this message (soft/hide). **readBy** : Array of userIds who have read this message. Used for read receipts. **conversationId** : Conversation this message belongs to (messaging:conversation). **sentAt** : Timestamp when message is sent (defaults to now on create). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Conversation` API Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. **Rest Route** The `createConversation` API REST controller can be triggered via the following route: `/v1/conversations` **Rest Request Parameters** The `createConversation` api has got 3 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | **isGroup** : True for group; false for one-to-one conversation (default false). **participantIds** : Array of user IDs (auth:user) participating in the conversation (min 2). **lastMessageAt** : Timestamp of most recent message sent in this conversation. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ## Profile Service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Profile Service Data Objects **Profile** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... **Premiumsubscription** premium subscription for a user **Certification** Official certification available for selection in user profile (dictionary only, not user relation). **Language** Official language available for selection in user profile (dictionary only, not user relation). **Sys_premiumsubscriptionPayment** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config **Sys_paymentCustomer** A payment storage object to store the customer values of the payment platform **Sys_paymentMethod** A payment storage object to store the payment methods of the platform customers ### Profile Service Access urls This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### `Update Profile` API Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. **Rest Route** The `updateProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `updateProfile` api has got 14 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **profileId** : This id paremeter is used to select the required data object that will be updated **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Profile` API Deletes the profile of the authenticated user (soft delete). **Rest Route** The `deleteProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `deleteProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Language` API Deletes a language entry from the dictionary. **Rest Route** The `deleteLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `deleteLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Language` API Edit an existing language entry. **Rest Route** The `updateLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `updateLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Profiles` API Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. **Rest Route** The `listProfiles` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `listProfiles` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Languages` API Lists all available languages for profile selection. **Rest Route** The `listLanguages` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `listLanguages` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Language` API Retrieves a language entry by ID. **Rest Route** The `getLanguage` API REST controller can be triggered via the following route: `/v1/languages/:languageId` **Rest Request Parameters** The `getLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | **languageId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Language` API Add a new language to the dictionary for user profiles. Must be unique by name. **Rest Route** The `createLanguage` API REST controller can be triggered via the following route: `/v1/languages` **Rest Request Parameters** The `createLanguage` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique language name (e.g. English, Spanish). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Profile` API Creates a new professional profile for the authenticated user. Each user can create only one profile. **Rest Route** The `createProfile` API REST controller can be triggered via the following route: `/v1/profiles` **Rest Request Parameters** The `createProfile` api has got 13 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | **summary** : Profile summary (bio/description). **headline** : Short tagline or headline for profile. **profilePhotoUrl** : URL for profile photo/avatar. **fullName** : Full name for display/search. **currentCompany** : Current employer/company, free text for now. **industry** : Industry sector name for profile. **languages** : Array of language names as string, links to language object (lookup/filter only). **skills** : List of professional skills (free-form tags). **location** : Location information (city, country, etc.) **experience** : Array of experienceItem objects (job history). **profileVisibility** : Controls who can view profile: public or private. Used in search/list visibility. **education** : Array of educationItem objects (degrees/certificates). **certifications** : Professional certifications by name, links to certification object. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Profile` API Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. **Rest Route** The `getProfile` API REST controller can be triggered via the following route: `/v1/profiles/:profileId` **Rest Request Parameters** The `getProfile` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | **profileId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premuimsub` API **Rest Route** The `deletePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `deletePremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Certification` API Edit an existing certification entry. **Rest Route** The `updateCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `updateCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be updated **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Premuimsub` API **Rest Route** The `createPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `createPremuimSub` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Certifications` API Lists all available certifications for profile selection/display. **Rest Route** The `listCertifications` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `listCertifications` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Update Premuimsub` API **Rest Route** The `updatePremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `updatePremuimSub` api has got 6 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **profileId** : the profile id of the subscription **currency** : currency **status** : **price** : the price of the subscription **userId** : the userid of the subscription **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premuimsub` API **Rest Route** The `getPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` **Rest Request Parameters** The `getPremuimSub` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | **premiumsubscriptionId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Create Certification` API Add a new certification for user profiles. Must be unique by name. **Rest Route** The `createCertification` API REST controller can be triggered via the following route: `/v1/certifications` **Rest Request Parameters** The `createCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | **name** : Unique certification name (e.g. PMP, CFA, AWS Certified). **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Certification` API Retrieves a certification entry by ID. **Rest Route** The `getCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `getCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premuimsub` API **Rest Route** The `listPremuimSub` API REST controller can be triggered via the following route: `/v1/premuimsub` **Rest Request Parameters** The `listPremuimSub` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Delete Certification` API Deletes a certification entry from the dictionary. **Rest Route** The `deleteCertification` API REST controller can be triggered via the following route: `/v1/certifications/:certificationId` **Rest Request Parameters** The `deleteCertification` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | **certificationId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Create Premiumsubscriptionpayment` API This route is used to create a new payment. **Rest Route** The `createPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment` **Rest Request Parameters** The `createPremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **orderId** : an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Update Premiumsubscriptionpayment` API This route is used to update an existing payment. **Rest Route** The `updatePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `updatePremiumsubscriptionPayment` api has got 5 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be updated **paymentId** : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type **paymentStatus** : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. **statusLiteral** : A string value to represent the logical payment status which belongs to the application lifecycle itself. **redirectUrl** : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Delete Premiumsubscriptionpayment` API This route is used to delete a payment. **Rest Route** The `deletePremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `deletePremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to select the required data object that will be deleted **REST Request** To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Premiumsubscriptionpayments2` API This route is used to list all payments. **Rest Route** The `listPremiumsubscriptionPayments2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayments2` **Rest Request Parameters** The `listPremiumsubscriptionPayments2` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `Get Premiumsubscriptionpaymentbyorderid` API This route is used to get the payment information by order id. **Rest Route** The `getPremiumsubscriptionPaymentByOrderId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByOrderId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **orderId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpaymentbypaymentid` API This route is used to get the payment information by payment id. **Rest Route** The `getPremiumsubscriptionPaymentByPaymentId` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` **Rest Request Parameters** The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **paymentId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Get Premiumsubscriptionpayment2` API This route is used to get the payment information by ID. **Rest Route** The `getPremiumsubscriptionPayment2` API REST controller can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` **Rest Request Parameters** The `getPremiumsubscriptionPayment2` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | **sys_premiumsubscriptionPaymentId** : This id paremeter is used to query the required data object. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `Start Premiumsubscriptionpayment` API Start payment for premiumsubscription **Rest Route** The `startPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `startPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to start a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Refresh Premiumsubscriptionpayment` API Refresh payment info for premiumsubscription from Stripe **Rest Route** The `refreshPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` **Rest Request Parameters** The `refreshPremiumsubscriptionPayment` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | **premiumsubscriptionId** : This id paremeter is used to select the required data object that will be updated **paymentUserParams** : The user parameters that should be defined to refresh a stripe payment process **REST Request** To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Callback Premiumsubscriptionpayment` API Refresh payment values by gateway webhook call for premiumsubscription **Rest Route** The `callbackPremiumsubscriptionPayment` API REST controller can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` **Rest Request Parameters** The `callbackPremiumsubscriptionPayment` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | **premiumsubscriptionId** : The order id parameter that will be read from webhook callback params **REST Request** To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` ### `Get Paymentcustomerbyuserid` API This route is used to get the payment customer information by user id. **Rest Route** The `getPaymentCustomerByUserId` API REST controller can be triggered via the following route: `/v1/paymentcustomers/:userId` **Rest Request Parameters** The `getPaymentCustomerByUserId` api has got 2 request parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | **sys_paymentCustomerId** : This id paremeter is used to query the required data object. **userId** : This parameter will be used to select the data object that is queried **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` ### `List Paymentcustomers` API This route is used to list all payment customers. **Rest Route** The `listPaymentCustomers` API REST controller can be triggered via the following route: `/v1/paymentcustomers` **Rest Request Parameters** The `listPaymentCustomers` api has got no request parameters. **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` ### `List Paymentcustomermethods` API This route is used to list all payment customer methods. **Rest Route** The `listPaymentCustomerMethods` API REST controller can be triggered via the following route: `/v1/paymentcustomermethods/:userId` **Rest Request Parameters** The `listPaymentCustomerMethods` api has got 1 request parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | **userId** : This parameter will be used to select the data objects that want to be listed **REST Request** To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` **REST Response** ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # REST API GUIDE ## linkedin-profile-service Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ## Architectural Design Credit and Contact Information The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to: Email: We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice. ## Documentation Scope Welcome to the official documentation for the Profile Service's REST API. This document is designed to provide a comprehensive guide to interfacing with our Profile Service exclusively through RESTful API endpoints. **Intended Audience** This documentation is intended for developers and integrators who are looking to interact with the Profile Service via HTTP requests for purposes such as creating, updating, deleting and querying Profile objects. **Overview** Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases. Beyond REST It's important to note that the Profile Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation. ## Authentication And Authorization To ensure secure access to the Profile service's protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it's important to note that access control varies across different routes: **Protected API**: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected. **Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token. ### Token Locations When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters. | Location | Token Name / Param Name | | ---------------------- | ---------------------------- | | Query | access_token | | Authorization Header | Bearer | | Header | linkedin-access-token| | Cookie | linkedin-access-token| Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies. ## Api Definitions This section outlines the API endpoints available within the Profile service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It's important to understand the flexibility in how parameters can be included in requests to effectively interact with the Profile service. This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` **Parameter Inclusion Methods:** Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests: **Query Parameters:** Included directly in the URL's query string. **Path Parameters:** Embedded within the URL's path. **Body Parameters:** Sent within the JSON body of the request. **Session Parameters:** Automatically read from the session object. This method is used for parameters that are intrinsic to the user's session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request. **Note on Session Parameters:** Session parameters represent a unique method of parameter inclusion, relying on the context of the user's session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request. By adhering to the specified parameter inclusion methods, you can effectively utilize the Profile service's API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below. ### Common Parameters The `Profile` service's business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL. ### Supported Common Parameters: - **getJoins (BOOLEAN)**: Controls whether to retrieve associated objects along with the main object. By default, `getJoins` is assumed to be `true`. Set it to `false` if you prefer to receive only the main fields of an object, excluding its associations. - **excludeCQRS (BOOLEAN)**: Applicable only when `getJoins` is `true`. By default, `excludeCQRS` is set to `false`. Enabling this parameter (`true`) omits non-local associations, which are typically more resource-intensive as they require querying external services like ElasticSearch for additional information. Use this to optimize response times and resource usage. - **requestId (String)**: Identifies a request to enable tracking through the service's log chain. A random hex string of 32 characters is assigned by default. If you wish to use a custom `requestId`, simply include it in your query parameters. - **caching (BOOLEAN)**: Determines the use of caching for query API. By default, caching is enabled (`true`). To ensure the freshest data directly from the database, set this parameter to `false`, bypassing the cache. - **cacheTTL (Integer)**: Specifies the Time-To-Live (TTL) for query caching, in seconds. This is particularly useful for adjusting the default caching duration (5 minutes) for `get list` queries. Setting a custom `cacheTTL` allows you to fine-tune the cache lifespan to meet your needs. - **pageNumber (Integer)**: For paginated `get list` API's, this parameter selects which page of results to retrieve. The default is `1`, indicating the first page. To disable pagination and retrieve all results, set `pageNumber` to `0`. - **pageRowCount (Integer)**: In conjunction with paginated API's, this parameter defines the number of records per page. The default value is `25`. Adjusting `pageRowCount` allows you to control the volume of data returned in a single request. By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the `Profile` service. ### Error Response If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity: - **400 Bad Request**: The request was improperly formatted or contained invalid parameters, preventing the server from processing it. - **401 Unauthorized**: The request lacked valid authentication credentials or the credentials provided do not grant access to the requested resource. - **404 Not Found**: The requested resource was not found on the server. - **500 Internal Server Error**: The server encountered an unexpected condition that prevented it from fulfilling the request. Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently. ```js { "result": "ERR", "status": 400, "message": "errMsg_organizationIdisNotAValidID", "errCode": 400, "date": "2024-03-19T12:13:54.124Z", "detail": "String" } ``` ### Object Structure of a Successfull Response When the `Profile` service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client. **Key Characteristics of the Response Envelope:** - **Data Presentation**: Depending on the nature of the request, the service returns either a single data object or an array of objects encapsulated within the JSON envelope. - **Creation and Update API**: These API routes return the unmodified (pure) form of the data object(s), without any associations to other data objects. - **Delete API**: Even though the data is removed from the database, the last known state of the data object(s) is returned in its pure form. - **Get Requests**: A single data object is returned in JSON format. - **Get List Requests**: An array of data objects is provided, reflecting a collection of resources. - **Data Structure and Joins**: The complexity of the data structure in the response can vary based on the API's architectural design and the join options specified in the request. The architecture might inherently limit join operations, or they might be dynamically controlled through query parameters. - **Pure Data Forms**: In some cases, the response mirrors the exact structure found in the primary data table, without extensions. - **Extended Data Forms**: Alternatively, responses might include data extended through joins with tables within the same service or aggregated from external sources, such as ElasticSearch indices related to other services. - **Join Varieties**: The extensions might involve one-to-one joins, resulting in single object associations, or one-to-many joins, leading to an array of objects. In certain instances, the data might even feature nested inclusions from other data objects. **Design Considerations**: The structure of a API's response data is meticulously crafted during the service's architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information. **Brief Data**: Certain API's return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect. ### API Response Structure The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response. **HTTP Status Codes:** - **200 OK**: This status code is returned for successful GET, LIST, UPDATE, or DELETE operations, indicating that the request has been processed successfully. - **201 Created**: This status code is specific to CREATE operations, signifying that the requested resource has been successfully created. **Success Response Format:** For successful operations, the response includes a `"status": "OK"` property, signaling the successful execution of the request. The structure of a successful response is outlined below: ```json { "status":"OK", "statusCode": 200, "elapsedMs":126, "ssoTime":120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName":"products", "method":"GET", "action":"list", "appVersion":"Version", "rowCount":3 "products":[{},{},{}], "paging": { "pageNumber":1, "pageRowCount":25, "totalRowCount":3, "pageCount":1 }, "filters": [], "uiPermissions": [] } ``` - **`products`**: In this example, this key contains the actual response content, which may be a single object or an array of objects depending on the operation performed. **Handling Errors:** For details on handling error scenarios and understanding the structure of error responses, please refer to the "Error Response" section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages. ## Resources Profile service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service. ### Profile resource *Resource Definition* : Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... *Profile Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **summary** | Text | | | *Profile summary (bio/description).* | | **headline** | String | | | *Short tagline or headline for profile.* | | **profilePhotoUrl** | String | | | *URL for profile photo/avatar.* | | **userId** | ID | | | *Foreign key to auth:user. Owner of the profile. Single profile per user.* | | **fullName** | String | | | *Full name for display/search.* | | **currentCompany** | String | | | *Current employer/company, free text for now.* | | **industry** | String | | | *Industry sector name for profile.* | | **languages** | String | | | *Array of language names as string, links to language object (lookup/filter only).* | | **skills** | String | | | *List of professional skills (free-form tags).* | | **location** | String | | | *Location information (city, country, etc.)* | | **experience** | Object | | | *Array of experienceItem objects (job history).* | | **profileVisibility** | Enum | | | *Controls who can view profile: public or private. Used in search/list visibility.* | | **education** | Object | | | *Array of educationItem objects (degrees/certificates).* | | **certifications** | String | | | *Professional certifications by name, links to certification object.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### profileVisibility Enum Property *Property Definition* : Controls who can view profile: public or private. Used in search/list visibility.*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **public** | `"public""` | 0 | | **private** | `"private""` | 1 | ### Premiumsubscription resource *Resource Definition* : premium subscription for a user *Premiumsubscription Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **profileId** | ID | | | *the profile id of the subscription* | | **currency** | String | | | *currency * | | **status** | String | | | ** | | **price** | Double | | | *the price of the subscription* | | **userId** | ID | | | *the userid of the subscription* | | **_paymentConfirmation** | Enum | | | *An automatic property that is used to check the confirmed status of the payment set by webhooks.* | #### Enum Properties Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer. ##### _paymentConfirmation Enum Property *Property Definition* : An automatic property that is used to check the confirmed status of the payment set by webhooks.*Enum Options* | Name | Value | Index | | ---- | ----- | ----- | | **pending** | `"pending""` | 0 | | **processing** | `"processing""` | 1 | | **paid** | `"paid""` | 2 | | **canceled** | `"canceled""` | 3 | ### Certification resource *Resource Definition* : Official certification available for selection in user profile (dictionary only, not user relation). *Certification Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **name** | String | | | *Unique certification name (e.g. PMP, CFA, AWS Certified).* | ### Language resource *Resource Definition* : Official language available for selection in user profile (dictionary only, not user relation). *Language Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **name** | String | | | *Unique language name (e.g. English, Spanish).* | ### Sys_premiumsubscriptionPayment resource *Resource Definition* : A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config *Sys_premiumsubscriptionPayment Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **ownerId** | ID | | | * An ID value to represent owner user who created the order* | | **orderId** | ID | | | *an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object* | | **paymentId** | String | | | *A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type* | | **paymentStatus** | String | | | *A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.* | | **statusLiteral** | String | | | *A string value to represent the logical payment status which belongs to the application lifecycle itself.* | | **redirectUrl** | String | | | *A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.* | ### Sys_paymentCustomer resource *Resource Definition* : A payment storage object to store the customer values of the payment platform *Sys_paymentCustomer Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **userId** | ID | | | * An ID value to represent the user who is created as a stripe customer* | | **customerId** | String | | | *A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway* | | **platform** | String | | | *A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future.* | ### Sys_paymentMethod resource *Resource Definition* : A payment storage object to store the payment methods of the platform customers *Sys_paymentMethod Resource Properties* | Name | Type | Required | Default | Definition | | ---- | ---- | -------- | ------- | ---------- | | **paymentMethodId** | String | | | *A string value to represent the id of the payment method on the payment platform.* | | **userId** | ID | | | * An ID value to represent the user who owns the payment method* | | **customerId** | String | | | *A string value to represent the customer id which is generated on the payment gateway.* | | **cardHolderName** | String | | | *A string value to represent the name of the card holder. It can be different than the registered customer.* | | **cardHolderZip** | String | | | *A string value to represent the zip code of the card holder. It is used for address verification in specific countries.* | | **platform** | String | | | *A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future.* | | **cardInfo** | Object | | | *A Json value to store the card details of the payment method.* | ## Business Api ### Update Profile API *API Definition* : Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. *API Crud Type* : update *Default access route* : *PATCH* `/v1/profiles/:profileId` #### Parameters The updateProfile api has got 14 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Profile](businessApi/updateProfile). ### Delete Profile API *API Definition* : Deletes the profile of the authenticated user (soft delete). *API Crud Type* : delete *Default access route* : *DELETE* `/v1/profiles/:profileId` #### Parameters The deleteProfile api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Profile](businessApi/deleteProfile). ### Delete Language API *API Definition* : Deletes a language entry from the dictionary. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/languages/:languageId` #### Parameters The deleteLanguage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Language](businessApi/deleteLanguage). ### Update Language API *API Definition* : Edit an existing language entry. *API Crud Type* : update *Default access route* : *PATCH* `/v1/languages/:languageId` #### Parameters The updateLanguage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Language](businessApi/updateLanguage). ### List Profiles API *API Definition* : Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. *API Crud Type* : list *Default access route* : *GET* `/v1/profiles` The listProfiles api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profiles`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profiles","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","profiles":[{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Profiles](businessApi/listProfiles). ### List Languages API *API Definition* : Lists all available languages for profile selection. *API Crud Type* : list *Default access route* : *GET* `/v1/languages` The listLanguages api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`languages`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"languages","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","languages":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Languages](businessApi/listLanguages). ### Get Language API *API Definition* : Retrieves a language entry by ID. *API Crud Type* : get *Default access route* : *GET* `/v1/languages/:languageId` #### Parameters The getLanguage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"GET","action":"get","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Language](businessApi/getLanguage). ### Create Language API *API Definition* : Add a new language to the dictionary for user profiles. Must be unique by name. *API Crud Type* : create *Default access route* : *POST* `/v1/languages` #### Parameters The createLanguage api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"language","method":"POST","action":"create","appVersion":"Version","rowCount":1,"language":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Language](businessApi/createLanguage). ### Create Profile API *API Definition* : Creates a new professional profile for the authenticated user. Each user can create only one profile. *API Crud Type* : create *Default access route* : *POST* `/v1/profiles` #### Parameters The createProfile api has got 13 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"POST","action":"create","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Profile](businessApi/createProfile). ### Get Profile API *API Definition* : Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. *API Crud Type* : get *Default access route* : *GET* `/v1/profiles/:profileId` #### Parameters The getProfile api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"profile","method":"GET","action":"get","appVersion":"Version","rowCount":1,"profile":{"id":"ID","summary":"Text","headline":"String","profilePhotoUrl":"String","userId":"ID","fullName":"String","currentCompany":"String","industry":"String","languages":"String","skills":"String","location":"String","experience":"Object","profileVisibility":"Enum","profileVisibility_idx":"Integer","education":"Object","certifications":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Profile](businessApi/getProfile). ### Delete Premuimsub API *API Crud Type* : delete *Default access route* : *DELETE* `/v1/premuimsub/:premiumsubscriptionId` #### Parameters The deletePremuimSub api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Premuimsub](businessApi/deletePremuimSub). ### Update Certification API *API Definition* : Edit an existing certification entry. *API Crud Type* : update *Default access route* : *PATCH* `/v1/certifications/:certificationId` #### Parameters The updateCertification api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Certification](businessApi/updateCertification). ### Create Premuimsub API *API Crud Type* : create *Default access route* : *POST* `/v1/premuimsub` #### Parameters The createPremuimSub api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"create","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Premuimsub](businessApi/createPremuimSub). ### List Certifications API *API Definition* : Lists all available certifications for profile selection/display. *API Crud Type* : list *Default access route* : *GET* `/v1/certifications` The listCertifications api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certifications`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certifications","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","certifications":[{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Certifications](businessApi/listCertifications). ### Update Premuimsub API *API Crud Type* : update *Default access route* : *PATCH* `/v1/premuimsub/:premiumsubscriptionId` #### Parameters The updatePremuimSub api has got 6 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Premuimsub](businessApi/updatePremuimSub). ### Get Premuimsub API *API Crud Type* : get *Default access route* : *GET* `/v1/premuimsub/:premiumsubscriptionId` #### Parameters The getPremuimSub api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"GET","action":"get","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Premuimsub](businessApi/getPremuimSub). ### Create Certification API *API Definition* : Add a new certification for user profiles. Must be unique by name. *API Crud Type* : create *Default access route* : *POST* `/v1/certifications` #### Parameters The createCertification api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"POST","action":"create","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Certification](businessApi/createCertification). ### Get Certification API *API Definition* : Retrieves a certification entry by ID. *API Crud Type* : get *Default access route* : *GET* `/v1/certifications/:certificationId` #### Parameters The getCertification api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"GET","action":"get","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Certification](businessApi/getCertification). ### List Premuimsub API *API Crud Type* : list *Default access route* : *GET* `/v1/premuimsub` The listPremuimSub api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscriptions`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscriptions","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","premiumsubscriptions":[{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Premuimsub](businessApi/listPremuimSub). ### Delete Certification API *API Definition* : Deletes a certification entry from the dictionary. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/certifications/:certificationId` #### Parameters The deleteCertification api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"certification","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"certification":{"id":"ID","name":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Certification](businessApi/deleteCertification). ### Get Premiumsubscriptionpayment2 API *API Definition* : This route is used to get the payment information by ID. *API Crud Type* : get *Default access route* : *GET* `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` #### Parameters The getPremiumsubscriptionPayment2 api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Premiumsubscriptionpayment2](businessApi/getPremiumsubscriptionPayment2). ### List Premiumsubscriptionpayments2 API *API Definition* : This route is used to list all payments. *API Crud Type* : list *Default access route* : *GET* `/v1/premiumsubscriptionpayments2` The listPremiumsubscriptionPayments2 api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayments`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Premiumsubscriptionpayments2](businessApi/listPremiumsubscriptionPayments2). ### Create Premiumsubscriptionpayment API *API Definition* : This route is used to create a new payment. *API Crud Type* : create *Default access route* : *POST* `/v1/premiumsubscriptionpayment` #### Parameters The createPremiumsubscriptionPayment api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"201","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"POST","action":"create","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Create Premiumsubscriptionpayment](businessApi/createPremiumsubscriptionPayment). ### Update Premiumsubscriptionpayment API *API Definition* : This route is used to update an existing payment. *API Crud Type* : update *Default access route* : *PATCH* `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` #### Parameters The updatePremiumsubscriptionPayment api has got 5 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Update Premiumsubscriptionpayment](businessApi/updatePremiumsubscriptionPayment). ### Delete Premiumsubscriptionpayment API *API Definition* : This route is used to delete a payment. *API Crud Type* : delete *Default access route* : *DELETE* `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` #### Parameters The deletePremiumsubscriptionPayment api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"DELETE","action":"delete","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":false,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Delete Premiumsubscriptionpayment](businessApi/deletePremiumsubscriptionPayment). ### List Premiumsubscriptionpayments2 API *API Definition* : This route is used to list all payments. *API Crud Type* : list *Default access route* : *GET* `/v1/premiumsubscriptionpayments2` The listPremiumsubscriptionPayments2 api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayments`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayments","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_premiumsubscriptionPayments":[{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Premiumsubscriptionpayments2](businessApi/listPremiumsubscriptionPayments2). ### Get Premiumsubscriptionpaymentbyorderid API *API Definition* : This route is used to get the payment information by order id. *API Crud Type* : get *Default access route* : *GET* `/v1/premiumsubscriptionpaymentbyorderid/:orderId` #### Parameters The getPremiumsubscriptionPaymentByOrderId api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Premiumsubscriptionpaymentbyorderid](businessApi/getPremiumsubscriptionPaymentByOrderId). ### Get Premiumsubscriptionpaymentbypaymentid API *API Definition* : This route is used to get the payment information by payment id. *API Crud Type* : get *Default access route* : *GET* `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` #### Parameters The getPremiumsubscriptionPaymentByPaymentId api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Premiumsubscriptionpaymentbypaymentid](businessApi/getPremiumsubscriptionPaymentByPaymentId). ### Get Premiumsubscriptionpayment2 API *API Definition* : This route is used to get the payment information by ID. *API Crud Type* : get *Default access route* : *GET* `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` #### Parameters The getPremiumsubscriptionPayment2 api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_premiumsubscriptionPayment","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_premiumsubscriptionPayment":{"id":"ID","ownerId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"String","statusLiteral":"String","redirectUrl":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Premiumsubscriptionpayment2](businessApi/getPremiumsubscriptionPayment2). ### Start Premiumsubscriptionpayment API *API Definition* : Start payment for premiumsubscription *API Crud Type* : update *Default access route* : *PATCH* `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` #### Parameters The startPremiumsubscriptionPayment api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Start Premiumsubscriptionpayment](businessApi/startPremiumsubscriptionPayment). ### Refresh Premiumsubscriptionpayment API *API Definition* : Refresh payment info for premiumsubscription from Stripe *API Crud Type* : update *Default access route* : *PATCH* `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` #### Parameters The refreshPremiumsubscriptionPayment api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"PATCH","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Refresh Premiumsubscriptionpayment](businessApi/refreshPremiumsubscriptionPayment). ### Callback Premiumsubscriptionpayment API *API Definition* : Refresh payment values by gateway webhook call for premiumsubscription *API Crud Type* : update *Default access route* : *POST* `/v1/callbackpremiumsubscriptionpayment` #### Parameters The callbackPremiumsubscriptionPayment api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"premiumsubscription","method":"POST","action":"update","appVersion":"Version","rowCount":1,"premiumsubscription":{"id":"ID","profileId":"ID","currency":"String","status":"String","price":"Double","userId":"ID","_paymentConfirmation":"Enum","_paymentConfirmation_idx":"Integer","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},"paymentResult":{"paymentTicketId":"ID","orderId":"ID","paymentId":"String","paymentStatus":"Enum","paymentIntentInfo":"Object","statusLiteral":"String","amount":"Double","currency":"String","success":true,"description":"String","metadata":"Object","paymentUserParams":"Object"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Callback Premiumsubscriptionpayment](businessApi/callbackPremiumsubscriptionPayment). ### Get Paymentcustomerbyuserid API *API Definition* : This route is used to get the payment customer information by user id. *API Crud Type* : get *Default access route* : *GET* `/v1/paymentcustomers/:userId` #### Parameters The getPaymentCustomerByUserId api has got 2 parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentCustomer`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomer","method":"GET","action":"get","appVersion":"Version","rowCount":1,"sys_paymentCustomer":{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"}} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For Get Paymentcustomerbyuserid](businessApi/getPaymentCustomerByUserId). ### List Paymentcustomers API *API Definition* : This route is used to list all payment customers. *API Crud Type* : list *Default access route* : *GET* `/v1/paymentcustomers` The listPaymentCustomers api has got no parameters. To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentCustomers`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentCustomers","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentCustomers":[{"id":"ID","userId":"ID","customerId":"String","platform":"String","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Paymentcustomers](businessApi/listPaymentCustomers). ### List Paymentcustomermethods API *API Definition* : This route is used to list all payment customer methods. *API Crud Type* : list *Default access route* : *GET* `/v1/paymentcustomermethods/:userId` #### Parameters The listPaymentCustomerMethods api has got 1 parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentMethods`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json {"status":"OK","statusCode":"200","elapsedMs":126,"ssoTime":120,"source":"db","cacheKey":"hexCode","userId":"ID","sessionId":"ID","requestId":"ID","dataName":"sys_paymentMethods","method":"GET","action":"list","appVersion":"Version","rowCount":"\"Number\"","sys_paymentMethods":[{"id":"ID","paymentMethodId":"String","userId":"ID","customerId":"String","cardHolderName":"String","cardHolderZip":"String","platform":"String","cardInfo":"Object","isActive":true,"recordVersion":"Integer","createdAt":"Date","updatedAt":"Date","_owner":"ID"},{},{}],"paging":{"pageNumber":"Number","pageRowCount":"NUmber","totalRowCount":"Number","pageCount":"Number"},"filters":[],"uiPermissions":[]} ``` > For a detailed description of the `` api with its internal and inter-service logic please refer to the [Business API Specification Document For List Paymentcustomermethods](businessApi/listPaymentCustomerMethods). ### Authentication Specific Routes ### Common Routes ### Route: currentuser *Route Definition*: Retrieves the currently authenticated user's session information. *Route Type*: sessionInfo *Access Route*: `GET /currentuser` #### Parameters This route does **not** require any request parameters. #### Behavior - Returns the authenticated session object associated with the current access token. - If no valid session exists, responds with a 401 Unauthorized. ```js // Sample GET /currentuser call axios.get("/currentuser", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns the session object, including user-related data and token information. ``` { "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9", "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "email": "user@example.com", "fullname": "John Doe", "roleId": "user", "tenantId": "abc123", "accessToken": "jwt-token-string", ... } ``` **Error Response** **401 Unauthorized:** No active session found. ``` { "status": "ERR", "message": "No login found" } ``` **Notes** * This route is typically used by frontend or mobile applications to fetch the current session state after login. * The returned session includes key user identity fields, tenant information (if applicable), and the access token for further authenticated requests. * Always ensure a valid access token is provided in the request to retrieve the session. ### Route: permissions `*Route Definition*`: Retrieves all effective permission records assigned to the currently authenticated user. `*Route Type*`: permissionFetch *Access Route*: `GET /permissions` #### Parameters This route does **not** require any request parameters. #### Behavior - Fetches all active permission records (`givenPermissions` entries) associated with the current user session. - Returns a full array of permission objects. - Requires a valid session (`access token`) to be available. ```js // Sample GET /permissions call axios.get("/permissions", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** Returns an array of permission objects. ```json [ { "id": "perm1", "permissionName": "adminPanel.access", "roleId": "admin", "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" }, { "id": "perm2", "permissionName": "orders.manage", "roleId": null, "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38", "subjectUserGroupId": null, "objectId": null, "canDo": true, "tenantCodename": "store123" } ] ``` Each object reflects a single permission grant, aligned with the givenPermissions model: - `**permissionName**`: The permission the user has. - `**roleId**`: If the permission was granted through a role. -` **subjectUserId**`: If directly granted to the user. - `**subjectUserGroupId**`: If granted through a group. - `**objectId**`: If tied to a specific object (OBAC). - `**canDo**`: True or false flag to represent if permission is active or restricted. **Error Responses** * **401 Unauthorized**: No active session found. ```json { "status": "ERR", "message": "No login found" } ``` * **500 Internal Server Error**: Unexpected error fetching permissions. **Notes** * The /permissions route is available across all backend services generated by Mindbricks, not just the auth service. * Auth service: Fetches permissions freshly from the live database (givenPermissions table). * Other services: Typically use a cached or projected view of permissions stored in a common ElasticSearch store, optimized for faster authorization checks. > **Tip**: > Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations. ### Route: permissions/:permissionName *Route Definition*: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions. *Route Type*: permissionScopeCheck *Access Route*: `GET /permissions/:permissionName` #### Parameters | Parameter | Type | Required | Population | |------------------|--------|----------|------------------------| | permissionName | String | Yes | `request.params.permissionName` | #### Behavior - Evaluates whether the current user **has access** to the given `permissionName`. - Returns a structured object indicating: - Whether the permission is generally granted (`canDo`) - Which object IDs are explicitly included or excluded from access (`exceptions`) - Requires a valid session (`access token`). ```js // Sample GET /permissions/orders.manage axios.get("/permissions/orders.manage", { headers: { "Authorization": "Bearer your-jwt-token" } }); ``` **Success Response** ```json { "canDo": true, "exceptions": [ "a1f2e3d4-xxxx-yyyy-zzzz-object1", "b2c3d4e5-xxxx-yyyy-zzzz-object2" ] } ``` * If `canDo` is `true`, the user generally has the permission, but not for the objects listed in `exceptions` (i.e., restrictions). * If `canDo` is `false`, the user does not have the permission by default — but only for the objects in `exceptions`, they do have permission (i.e., selective overrides). * The exceptions array contains valid **UUID strings**, each corresponding to an object ID (typically from the data model targeted by the permission). ## Copyright All sources, documents and other digital materials are copyright of . ## About Us For more information please visit our website: . . . # Service Design Specification **linkedin-profile-service** documentation -Version:**`1.0.23`** ## Scope This document provides a structured architectural overview of the `profile` microservice, detailing its configuration, data model, authorization logic, business rules, and API design. It has been automatically generated based on the service definition within Mindbricks, ensuring that the information reflects the source of truth used during code generation and deployment. The document is intended to serve multiple audiences: * **Service architects** can use it to validate design decisions and ensure alignment with broader architectural goals. * **Developers and maintainers** will find it useful for understanding the structure and behavior of the service, facilitating easier debugging, feature extension, and integration with other systems. * **Stakeholders and reviewers** can use it to gain a clear understanding of the service's capabilities and domain logic. > **Note for Frontend Developers**: While this document is valuable for understanding business logic and data interactions, please refer to the [Service API Documentation](#) for endpoint-level specifications and integration details. > **Note for Backend Developers**: Since the code for this service is automatically generated by Mindbricks, you typically won't need to implement or modify it manually. However, this document is especially valuable when you're building other services—whether within Mindbricks or externally—that need to interact with or depend on this service. It provides a clear reference to the service's data contracts, business rules, and API structure, helping ensure compatibility and correct integration. ## `Profile` Service Settings [**Edit**](profile/serviceSettings) Handles user professional profiles, including experience, education, skills, languages, certifications, profile photo, and visibility controls. Enables recruiter search, elastic-style indexing, and profile editing, with all data linked to authenticated users.. ### Service Overview This service is configured to listen for HTTP requests on port `3001`, serving both the main API interface and default administrative endpoints. The following routes are available by default: * **API Test Interface (API Face):** `/` * **Swagger Documentation:** `/swagger` * **Postman Collection Download:** `/getPostmanCollection` * **Health Checks:** `/health` and `/admin/health` * **Current Session Info:** `/currentuser` * **Favicon:** `/favicon.ico` The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-profile-service`. This service is accessible via the following environment-specific URLs: * **Preview:** `https://linkedin.prw.mindbricks.com/profile-api` * **Staging:** `https://linkedin-stage.mindbricks.co/profile-api` * **Production:** `https://linkedin.mindbricks.co/profile-api` ### Authentication & Security - **Login Required**: Yes This service requires user authentication for access. It supports both JWT and RSA-based authentication mechanisms, ensuring secure user sessions and data integrity. If a crud route also is configured to require login, it will check a valid JWT token in the request query/header/bearer/cookie. If the token is valid, it will extract the user information from the token and make the fetched session data available in the request context. ### Service Data Objects The service uses a **PostgreSQL** database for data storage, with the database name set to `linkedin-profile-service`. Data deletion is managed using a **soft delete** strategy. Instead of removing records from the database, they are flagged as inactive by setting the `isActive` field to `false`. | Object Name | Description | Public Access | |-------------|-------------|---------------| | `profile` | Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... | accessPrivate | | `premiumsubscription` | premium subscription for a user | accessPrivate | | `certification` | Official certification available for selection in user profile (dictionary only, not user relation). | accessPublic | | `language` | Official language available for selection in user profile (dictionary only, not user relation). | accessPublic | | `sys_premiumsubscriptionPayment` | A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config | accessPrivate | | `sys_paymentCustomer` | A payment storage object to store the customer values of the payment platform | accessPrivate | | `sys_paymentMethod` | A payment storage object to store the payment methods of the platform customers | accessPrivate | ## profile Data Object ### Object Overview **Description:** Professional profile for a user, includes core info and arrays of experience/education/skills. One profile per user... This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **oneProfilePerUser**: [userId] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `summary` | Text | No | Profile summary (bio/description). | | `headline` | String | No | Short tagline or headline for profile. | | `profilePhotoUrl` | String | No | URL for profile photo/avatar. | | `userId` | ID | Yes | Foreign key to auth:user. Owner of the profile. Single profile per user. | | `fullName` | String | Yes | Full name for display/search. | | `currentCompany` | String | No | Current employer/company, free text for now. | | `industry` | String | No | Industry sector name for profile. | | `languages` | String | No | Array of language names as string, links to language object (lookup/filter only). | | `skills` | String | No | List of professional skills (free-form tags). | | `location` | String | No | Location information (city, country, etc.) | | `experience` | Object | No | Array of experienceItem objects (job history). | | `profileVisibility` | Enum | Yes | Controls who can view profile: public or private. Used in search/list visibility. | | `education` | Object | No | Array of educationItem objects (degrees/certificates). | | `certifications` | String | No | Professional certifications by name, links to certification object. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Array Properties `languages` `skills` `experience` `education` `certifications` Array properties can hold multiple values and are indicated by the `[]` suffix in their type. Avoid using arrays in properties that are used for relations, as they will not work correctly. Note that using connection objects instead of arrays is recommended for relations, as they provide better performance and flexibility. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **userId**: '00000000-0000-0000-0000-000000000000' - **fullName**: 'default' - **profileVisibility**: public ### Constant Properties `userId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `summary` `headline` `profilePhotoUrl` `fullName` `currentCompany` `industry` `languages` `skills` `location` `experience` `profileVisibility` `education` `certifications` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **profileVisibility**: [public, private] ### Elastic Search Indexing `summary` `headline` `userId` `fullName` `currentCompany` `industry` `languages` `skills` `location` `experience` `profileVisibility` `education` `certifications` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `userId` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `userId` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Relation Properties `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Session Data Properties `userId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **userId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `headline` `fullName` `currentCompany` `industry` `location` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **headline**: String has a filter named `headline` - **fullName**: String has a filter named `fullName` - **currentCompany**: String has a filter named `currentCompany` - **industry**: String has a filter named `industry` - **location**: String has a filter named `location` ## premiumsubscription Data Object ### Object Overview **Description:** premium subscription for a user This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Stripe Integration This data object is configured to integrate with Stripe for order management of `premiumsubscription`. It is designed to handle payment processing and order tracking. To manage payments, Mindbricks will design additional Business API routes arround this data object, which will be used checkout orders and charge customers. - **Order Name**: `premiumsubscription` - **Order Id Property**: this.premiumsubscription.id This MScript expression is used to extract the order's unique identifier from the data object. - **Order Amount Property**: this.premiumsubscription.price This MScript expression is used to determine the order amount for payment. It should return a numeric value representing the total amount to be charged. - **Order Currency Property**: this.premiumsubscription.currency This MScript expression is used to determine the currency for the order. It should return a string representing the currency code (e.g., "USD", "EUR"). - **Order Description Property**: `Making subscription for this userId: ${this.premiumsubscription.userId} with profileId: ${this.premiumsubscription.profileId}` This MScript expression is used to provide a description for the order, which will be shown in Stripe and on customer receipts. It should return a string that describes the order. - **Order Status Property**: status This property is selected as the order status property, which will be used to track the current status of the order. It will be automatically updated based on payment results from Stripe. - **Order Status Update Date Property**: updatedAt This property is selected to record the timestamp of the last order status update. It will be automatically managed during payment events to reflect when the status was last changed. - **Order Owner Id Property**: userId This property is selected as the order owner property, which will be used to track the user who owns the order. It will be used to ensure correct access control in payment flows, allowing only the owner to manage their orders. - **Map Payment Result to Order Status**: This configuration defines how Stripe's payment results (e.g., started, success, failed, canceled) map to internal order statuses., `paymentResultStarted` status will be mapped to a local value using `"pending"` and will be set to `status`property. `paymentResultCanceled` status will be mapped to a local value using `"cancelled"` and will be set to `status` property. `paymentResultFailed` status will be mapped to a local value using `"declined"` and will be set to `status` property. `paymentResultSuccess` status will be mapped to a local value using `"completed"` and will be set to `status` property. - **On Checkout Error**: continueRoute if an error occurs during the checkout process, the API will continue to execute, allowing for custom error handling. In this case, the payment error will ve recorded as a status update. To make a retry a new checkout, a new order will be created with the same data as the original order. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `profileId` | ID | Yes | the profile id of the subscription | | `currency` | String | Yes | currency | | `status` | String | Yes | - | | `price` | Double | Yes | the price of the subscription | | `userId` | ID | Yes | the userid of the subscription | | `_paymentConfirmation` | Enum | Yes | An automatic property that is used to check the confirmed status of the payment set by webhooks. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **profileId**: '00000000-0000-0000-0000-000000000000' - **currency**: 'default' - **status**: 'default' - **price**: 0.0 - **userId**: '00000000-0000-0000-0000-000000000000' - **_paymentConfirmation**: pending ### Always Create with Default Values Some of the default values are set to be always used when creating a new object, even if the property value is provided in the request body. It ensures that the property is always initialized with a default value when the object is created. - **_paymentConfirmation**: Will be created with value `pending` ### Auto Update Properties `profileId` `currency` `status` `price` `userId` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Enum Properties Enum properties are defined with a set of allowed values, ensuring that only valid options can be assigned to them. The enum options value will be stored as strings in the database, but when a data object is created an addtional property with the same name plus an idx suffix will be created, which will hold the index of the selected enum option. You can use the index property to sort by the enum value or when your enum options represent a sequence of values. - **_paymentConfirmation**: [pending, processing, paid, canceled] ### Elastic Search Indexing `profileId` `currency` `status` `price` `userId` `_paymentConfirmation` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `_paymentConfirmation` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Secondary Key Properties `_paymentConfirmation` Secondary key properties are used to create an additional indexed identifiers for the data object, allowing for alternative access patterns. Different than normal indexed properties, secondary keys will act as primary keys and Mindbricks will provide automatic secondary key db utility functions to access the data object by the secondary key. ### Relation Properties `profileId` `userId` Mindbricks supports relations between data objects, allowing you to define how objects are linked together. You can define relations in the data object properties, which will be used to create foreign key constraints in the database. For complex joins operations, Mindbricks supportsa BFF pattern, where you can view dynamic and static views based on Elastic Search Indexes. Use db level relations for simple one-to-one or one-to-many relationships, and use BFF views for complex joins that require multiple data objects to be joined together. - **profileId**: ID Relation to `profile`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes - **userId**: ID Relation to `user`.id The target object is a parent object, meaning that the relation is a one-to-many relationship from target to this object. On Delete: Set Null Required: Yes ### Filter Properties `profileId` `currency` `status` `price` `userId` `_paymentConfirmation` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **profileId**: ID has a filter named `subscriptionProfileId` - **currency**: String has a filter named `subscriptionCurrency` - **status**: String has a filter named `subscriptionStatus` - **price**: Double has a filter named `subscriptionPrice` - **userId**: ID has a filter named `subscriptionUserId` - **_paymentConfirmation**: Enum has a filter named `_paymentConfirmation` ## certification Data Object ### Object Overview **Description:** Official certification available for selection in user profile (dictionary only, not user relation). This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPublic — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **certificationName**: [name] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `name` | String | Yes | Unique certification name (e.g. PMP, CFA, AWS Certified). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **name**: 'default' ### Constant Properties `name` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Elastic Search Indexing `name` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `name` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `name` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Filter Properties `name` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **name**: String has a filter named `name` ## language Data Object ### Object Overview **Description:** Official language available for selection in user profile (dictionary only, not user relation). This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPublic — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Composite Indexes - **languageName**: [name] This composite index is defined to optimize query performance for complex queries involving multiple fields. The index also defines a conflict resolution strategy for duplicate key violations. When a new record would violate this composite index, the following action will be taken: **On Duplicate**: `throwError` An error will be thrown, preventing the insertion of conflicting data. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `name` | String | Yes | Unique language name (e.g. English, Spanish). | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **name**: 'default' ### Constant Properties `name` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Elastic Search Indexing `name` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `name` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `name` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Filter Properties `name` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **name**: String has a filter named `name` ## sys_premiumsubscriptionPayment Data Object ### Object Overview **Description:** A payment storage object to store the payment life cyle of orders based on premiumsubscription object. It is autocreated based on the source object's checkout config This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `ownerId` | ID | No | An ID value to represent owner user who created the order | | `orderId` | ID | Yes | an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object | | `paymentId` | String | Yes | A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type | | `paymentStatus` | String | Yes | A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. | | `statusLiteral` | String | Yes | A string value to represent the logical payment status which belongs to the application lifecycle itself. | | `redirectUrl` | String | No | A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **orderId**: '00000000-0000-0000-0000-000000000000' - **paymentId**: 'default' - **paymentStatus**: 'default' - **statusLiteral**: started ### Constant Properties `orderId` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `ownerId` `orderId` `paymentId` `paymentStatus` `statusLiteral` `redirectUrl` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `ownerId` `orderId` `paymentId` `paymentStatus` `statusLiteral` `redirectUrl` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `ownerId` `orderId` `paymentId` `paymentStatus` `statusLiteral` `redirectUrl` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `orderId` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Secondary Key Properties `orderId` Secondary key properties are used to create an additional indexed identifiers for the data object, allowing for alternative access patterns. Different than normal indexed properties, secondary keys will act as primary keys and Mindbricks will provide automatic secondary key db utility functions to access the data object by the secondary key. ### Session Data Properties `ownerId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **ownerId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `ownerId` `orderId` `paymentId` `paymentStatus` `statusLiteral` `redirectUrl` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **ownerId**: ID has a filter named `ownerId` - **orderId**: ID has a filter named `orderId` - **paymentId**: String has a filter named `paymentId` - **paymentStatus**: String has a filter named `paymentStatus` - **statusLiteral**: String has a filter named `statusLiteral` - **redirectUrl**: String has a filter named `redirectUrl` ## sys_paymentCustomer Data Object ### Object Overview **Description:** A payment storage object to store the customer values of the payment platform This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `userId` | ID | No | An ID value to represent the user who is created as a stripe customer | | `customerId` | String | Yes | A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway | | `platform` | String | Yes | A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **customerId**: 'default' - **platform**: stripe ### Constant Properties `customerId` `platform` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `userId` `customerId` `platform` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `userId` `customerId` `platform` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `userId` `customerId` `platform` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `userId` `customerId` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Secondary Key Properties `userId` `customerId` Secondary key properties are used to create an additional indexed identifiers for the data object, allowing for alternative access patterns. Different than normal indexed properties, secondary keys will act as primary keys and Mindbricks will provide automatic secondary key db utility functions to access the data object by the secondary key. ### Session Data Properties `userId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **userId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `userId` `customerId` `platform` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **userId**: ID has a filter named `userId` - **customerId**: String has a filter named `customerId` - **platform**: String has a filter named `platform` ## sys_paymentMethod Data Object ### Object Overview **Description:** A payment storage object to store the payment methods of the platform customers This object represents a core data structure within the service and acts as the blueprint for database interaction, API generation, and business logic enforcement. It is defined using the `ObjectSettings` pattern, which governs its behavior, access control, caching strategy, and integration points with other systems such as Stripe and Redis. ### Core Configuration - **Soft Delete:** Enabled — Determines whether records are marked inactive (`isActive = false`) instead of being physically deleted. - **Public Access:** accessPrivate — If enabled, anonymous users may access this object’s data depending on API-level rules. ### Properties Schema | Property | Type | Required | Description | |----------|------|----------|-------------| | `paymentMethodId` | String | Yes | A string value to represent the id of the payment method on the payment platform. | | `userId` | ID | Yes | An ID value to represent the user who owns the payment method | | `customerId` | String | Yes | A string value to represent the customer id which is generated on the payment gateway. | | `cardHolderName` | String | No | A string value to represent the name of the card holder. It can be different than the registered customer. | | `cardHolderZip` | String | No | A string value to represent the zip code of the card holder. It is used for address verification in specific countries. | | `platform` | String | Yes | A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future. | | `cardInfo` | Object | Yes | A Json value to store the card details of the payment method. | * Required properties are mandatory for creating objects and must be provided in the request body if no default value is set. ### Default Values Default values are automatically assigned to properties when a new object is created, if no value is provided in the request body. Since default values are applied on db level, they should be literal values, not expressions.If you want to use expressions, you can use transposed parameters in any business API to set default values dynamically. - **paymentMethodId**: 'default' - **userId**: '00000000-0000-0000-0000-000000000000' - **customerId**: 'default' - **platform**: stripe - **cardInfo**: {} ### Constant Properties `paymentMethodId` `userId` `customerId` `cardHolderName` `cardHolderZip` `platform` Constant properties are defined to be immutable after creation, meaning they cannot be updated or changed once set. They are typically used for properties that should remain constant throughout the object's lifecycle. A property is set to be constant if the `Allow Update` option is set to `false`. ### Auto Update Properties `paymentMethodId` `userId` `customerId` `cardHolderName` `cardHolderZip` `platform` `cardInfo` An update crud API created with the option `Auto Params` enabled will automatically update these properties with the provided values in the request body. If you want to update any property in your own business logic not by user input, you can set the `Allow Auto Update` option to false. These properties will be added to the update API's body parameters and can be updated by the user if any value is provided in the request body. ### Elastic Search Indexing `paymentMethodId` `userId` `customerId` `cardHolderName` `cardHolderZip` `platform` `cardInfo` Properties that are indexed in Elastic Search will be searchable via the Elastic Search API. While all properties are stored in the elastic search index of the data object, only those marked for Elastic Search indexing will be available for search queries. ### Database Indexing `paymentMethodId` `userId` `customerId` `platform` `cardInfo` Properties that are indexed in the database will be optimized for query performance, allowing for faster data retrieval. Make a property indexed in the database if you want to use it frequently in query filters or sorting. ### Unique Properties `paymentMethodId` Unique properties are enforced to have distinct values across all instances of the data object, preventing duplicate entries. Note that a unique property is automatically indexed in the database so you will not need to set the `Indexed in DB` option. ### Secondary Key Properties `paymentMethodId` `userId` `customerId` Secondary key properties are used to create an additional indexed identifiers for the data object, allowing for alternative access patterns. Different than normal indexed properties, secondary keys will act as primary keys and Mindbricks will provide automatic secondary key db utility functions to access the data object by the secondary key. ### Session Data Properties `userId` Session data properties are used to store data that is specific to the user session, allowing for personalized experiences and temporary data storage. If a property is configured as session data, it will be automatically mapped to the related field in the user session during CRUD operations. Note that session data properties can not be mutated by the user, but only by the system. - **userId**: ID property will be mapped to the session parameter `userId`. This property is also used to store the owner of the session data, allowing for ownership checks and access control. ### Filter Properties `paymentMethodId` `userId` `customerId` `cardHolderName` `cardHolderZip` `platform` `cardInfo` Filter properties are used to define parameters that can be used in query filters, allowing for dynamic data retrieval based on user input or predefined criteria. These properties are automatically mapped as API parameters in the listing API's that have "Auto Params" enabled. - **paymentMethodId**: String has a filter named `paymentMethodId` - **userId**: ID has a filter named `userId` - **customerId**: String has a filter named `customerId` - **cardHolderName**: String has a filter named `cardHolderName` - **cardHolderZip**: String has a filter named `cardHolderZip` - **platform**: String has a filter named `platform` - **cardInfo**: Object has a filter named `cardInfo` ## Business Logic profile has got 35 Business APIs to manage its internal and crud logic. For the details of each business API refer to its chapter. * [Update Profile](/businessLogic/updateprofile) * [Delete Profile](/businessLogic/deleteprofile) * [Delete Language](/businessLogic/deletelanguage) * [Update Language](/businessLogic/updatelanguage) * [List Profiles](/businessLogic/listprofiles) * [List Languages](/businessLogic/listlanguages) * [Get Language](/businessLogic/getlanguage) * [Create Language](/businessLogic/createlanguage) * [Create Profile](/businessLogic/createprofile) * [Get Profile](/businessLogic/getprofile) * [Delete Premuimsub](/businessLogic/deletepremuimsub) * [Update Certification](/businessLogic/updatecertification) * [Create Premuimsub](/businessLogic/createpremuimsub) * [List Certifications](/businessLogic/listcertifications) * [Update Premuimsub](/businessLogic/updatepremuimsub) * [Get Premuimsub](/businessLogic/getpremuimsub) * [Create Certification](/businessLogic/createcertification) * [Get Certification](/businessLogic/getcertification) * [List Premuimsub](/businessLogic/listpremuimsub) * [Delete Certification](/businessLogic/deletecertification) * [Get Premiumsubscriptionpayment2](/businessLogic/getpremiumsubscriptionpayment2) * [List Premiumsubscriptionpayments2](/businessLogic/listpremiumsubscriptionpayments2) * [Create Premiumsubscriptionpayment](/businessLogic/createpremiumsubscriptionpayment) * [Update Premiumsubscriptionpayment](/businessLogic/updatepremiumsubscriptionpayment) * [Delete Premiumsubscriptionpayment](/businessLogic/deletepremiumsubscriptionpayment) * [List Premiumsubscriptionpayments2](/businessLogic/listpremiumsubscriptionpayments2) * [Get Premiumsubscriptionpaymentbyorderid](/businessLogic/getpremiumsubscriptionpaymentbyorderid) * [Get Premiumsubscriptionpaymentbypaymentid](/businessLogic/getpremiumsubscriptionpaymentbypaymentid) * [Get Premiumsubscriptionpayment2](/businessLogic/getpremiumsubscriptionpayment2) * [Start Premiumsubscriptionpayment](/businessLogic/startpremiumsubscriptionpayment) * [Refresh Premiumsubscriptionpayment](/businessLogic/refreshpremiumsubscriptionpayment) * [Callback Premiumsubscriptionpayment](/businessLogic/callbackpremiumsubscriptionpayment) * [Get Paymentcustomerbyuserid](/businessLogic/getpaymentcustomerbyuserid) * [List Paymentcustomers](/businessLogic/listpaymentcustomers) * [List Paymentcustomermethods](/businessLogic/listpaymentcustomermethods) ## Edge Controllers No edge controllers defined for this service. --- ## Service Library ### Functions #### checkNoProfileExistsForUser.js ```js module.exports = async function(userId) { const { Profile } = this.getModels(); const count = await Profile.count({ where: { userId: userId, isActive: true } }); return count === 0; } ``` ### Hook Functions No hook functions defined. ### Edge Functions No edge functions defined. ### Templates No templates defined. ### Assets No assets defined. ### Public Assets No public assets defined. --- ### Event Emission --- ## Integration Patterns ## Deployment Considerations ### Environment Configuration - **HTTP Port**: `3001` - **Database Type**: MongoDB - **Global Soft Delete**: Enabled ## Implementation Guidelines ### Development Workflow 1. **Data Model Implementation**: Generate database schema from data object definitions 2. **CRUD Route Generation**: Implement auto-generated routes with custom logic 3. **Custom Logic Integration**: Implement hook functions and edge functions 4. **Authentication Integration**: Configure with project-level authentication 5. **Testing**: Unit and integration testing for all components ### Code Generation Expectations - **Database Schema**: Auto-generated from data objects and relationships - **API Routes**: REST endpoints with customizable behavior - **Validation Logic**: Input validation from property definitions - **Access Control**: Authentication and authorization middleware ### Custom Code Integration Points - **Hook Functions**: Lifecycle-specific custom logic - **Edge Functions**: Full request/response control - **Library Functions**: Reusable business logic - **Templates**: Dynamic content rendering ### Testing Strategy #### Unit Testing - Test all custom library functions - Test validation logic and business rules - Test hook function implementations #### Integration Testing - Test API endpoints with authentication scenarios - Test database operations and transactions - Test external integrations - Test event emission and Kafka integration #### Performance Testing - Load test high-traffic endpoints - Test caching effectiveness - Monitor database query performance - Test scalability under load --- ## Appendices ### Data Type Reference | Type | Description | Storage | |------|-------------|---------| | ID | Unique identifier | UUID (SQL) / ObjectID (NoSQL) | | String | Short text (≤255 chars) | VARCHAR | | Text | Long-form text | TEXT | | Integer | 32-bit whole numbers | INT | | Boolean | True/false values | BOOLEAN | | Double | 64-bit floating point | DOUBLE | | Float | 32-bit floating point | FLOAT | | Short | 16-bit integers | SMALLINT | | Object | JSON object | JSONB (PostgreSQL) / Object (MongoDB) | | Date | ISO 8601 timestamp | TIMESTAMP | | Enum | Fixed numeric values | SMALLINT with lookup | ### Enum Value Mappings #### Request Locations - `0`: Bearer token in Authorization header - `1`: Cookie value - `2`: Custom HTTP header - `3`: Query parameter - `4`: Request body property - `5`: URL path parameter - `6`: Session data - `7`: Root request object #### HTTP Methods - `0`: GET - `1`: POST - `2`: PUT - `3`: PATCH - `4`: DELETE ### Edge Function Signature ```javascript async function edgeFunction(request) { // Custom request processing // Return response object or throw error return { data: {}, status: 200, message: "Success" }; } ``` --- *This document was generated from the service architecture definition and should be kept in sync with implementation changes.* -------------------------------------------------------- title: QuickStart description: Test slug: quick-start date: 01.04.2025 -------------------------------------------------------- # Business API Design Specification - `Archive Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `archiveProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `archiveProfile` Business API is designed to handle a `delete` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This api is used by users to archive their profiles. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-archived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `archiveProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/archiveprofile/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `archiveProfile` Business API includes a gRPC controller that can be triggered via the following function: `archiveProfile()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `archiveProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `archiveProfile` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `archiveProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Action : protectSuperAdmin **Action Type**: `ValidationAction` Prevents deletion of the SuperAdmin account. This safeguard ensures that the SuperAdmin userId cannot be removed under any circumstances. ```js class Api { async protectSuperAdmin() { const isError = this.userId == this.auth?.superAdminId; if (isError) { throw new BadRequestError("SuperAdminCantBeDeleted"); } return isError; } } ``` --- ### [7] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [8] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [9] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [10] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [11] Action : deleteUserSessions **Action Type**: `FunctionCallAction` Makes a call to this.auth to delete the sessions of the deleted user. ```js class Api { async deleteUserSessions() { try { return await (async (userId) => { await this.auth.deleteUserSessions(userId); })(this.userId); } catch (err) { console.error("Error in FunctionCallAction deleteUserSessions:", err); throw err; } } } ``` --- ### [12] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [13] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [14] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `archiveProfile` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/archiveprofile/:userId** ```js axios({ method: 'DELETE', url: `/v1/archiveprofile/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create User` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createUser` Business API is designed to handle a `create` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This api is used by admin roles to create a new user manually from admin panels ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `user-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createUser` Business API includes a REST controller that can be triggered via the following route: `/v1/users` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `createUser` Business API includes a gRPC controller that can be triggered via the following function: `createUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createUser` Business API has 5 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `No` | `-` | `body` | `userId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `avatar` | `String` | `No` | `-` | `body` | `avatar` | | **Description:** | The avatar url of the user. If not sent, a default random one will be generated. | | | | | | | | | | | | | `email` | `String` | `Yes` | `-` | `body` | `email` | | **Description:** | A string value to represent the user's email. | | | | | | | | | | | | | `password` | `String` | `Yes` | `-` | `body` | `password` | | **Description:** | A string value to represent the user's password. It will be stored as hashed. | | | | | | | | | | | | | `fullname` | `String` | `Yes` | `-` | `body` | `fullname` | | **Description:** | A string value to represent the fullname of the user | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. * `avatar`: ```javascript this.avatar = this.avatar ? `https://gravatar.com/avatar/${LIB.common.md5(this.email ?? 'nullValue')}?s=200&d=identicon` : null ``` ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin`, `saasAdmin`, `tenantAdmin`, `tenantOwner]` --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.userId, email: this.email, password: this.hashString(this.password), fullname: this.fullname, avatar: this.avatar, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Action : fetchArchivedUser **Action Type**: `FetchObjectAction` Check and get if any deleted user exists with the same email ```js class Api { async fetchArchivedUser() { // Fetch Object on childObject user const userQuery = { $and: [ { email: this.email, isActive: false }, { _archivedAt: { $gte: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), }, }, ], }; const { convertUserQueryToSequelizeQuery } = require("common"); const scriptQuery = convertUserQueryToSequelizeQuery(userQuery); // get object from db const data = await getUserByQuery(scriptQuery); return data ? { id: data["id"], } : null; } } ``` --- ### [6] Action : checkArchivedUser **Action Type**: `ValidationAction` Prevents re-register of a user when their profile is sitll in 30days archive ```js class Api { async checkArchivedUser() { const isError = this.archivedUser?.email != null; if (isError) { throw new BadRequestError("ThisProfileIsArchivedPleaseLoginToRestore"); } return isError; } } ``` --- ### [7] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [8] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [9] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [10] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [11] Action : writeVerificationNeedsToResponse **Action Type**: `AddToResponseAction` Set if email or mobile verification needed ```js class Api { async writeVerificationNeedsToResponse() { try { this.output["emailVerificationNeeded"] = !this.user?.emailVerified; this.output["mobileVerificationNeeded"] = false; return true; } catch (error) { console.error("AddToResponseAction error:", error); throw error; } } } ``` --- ### [12] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [13] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createUser` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | email | String | true | request.body?.email | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/users** ```js axios({ method: 'POST', url: '/v1/users', data: { avatar:"String", email:"String", password:"String", fullname:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete User` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteUser` Business API is designed to handle a `delete` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This api is used by admins to delete user profiles. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `user-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteUser` Business API includes a REST controller that can be triggered via the following route: `/v1/users/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `deleteUser` Business API includes a gRPC controller that can be triggered via the following function: `deleteUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteUser` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Action : protectSuperAdmin **Action Type**: `ValidationAction` Prevents deletion of the SuperAdmin account. This safeguard ensures that the SuperAdmin userId cannot be removed under any circumstances. ```js class Api { async protectSuperAdmin() { const isError = this.userId == this.auth?.superAdminId; if (isError) { throw new BadRequestError("SuperAdminCantBeDeleted"); } return isError; } } ``` --- ### [7] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [8] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [9] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [10] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [11] Action : deleteUserSessions **Action Type**: `FunctionCallAction` Makes a call to this.auth to delete the sessions of the deleted user. ```js class Api { async deleteUserSessions() { try { return await (async (userId) => { await this.auth.deleteUserSessions(userId); })(this.userId); } catch (err) { console.error("Error in FunctionCallAction deleteUserSessions:", err); throw err; } } } ``` --- ### [12] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [13] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [14] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteUser` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/users/:userId** ```js axios({ method: 'DELETE', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Briefuser` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getBriefUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getBriefUser` Business API is designed to handle a `get` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used by public to get simple user profile information. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `briefuser-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getBriefUser` Business API includes a REST controller that can be triggered via the following route: `/v1/briefuser/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `getBriefUser` Business API includes a gRPC controller that can be triggered via the following function: `getBriefUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getBriefUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getBriefUser` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getBriefUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API is **public** and can be accessed without login (`loginRequired = false`). --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `id`,`fullname`,`avatar` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getBriefUser` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/briefuser/:userId** ```js axios({ method: 'GET', url: `/v1/briefuser/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. This route's response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "fullname": "String", "avatar": "String", "isActive": true } } ``` # Business API Design Specification - `Get User` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getUser` Business API is designed to handle a `get` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This api is used by admin roles or the users themselves to get the user profile information. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `user-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getUser` Business API includes a REST controller that can be triggered via the following route: `/v1/users/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `getUser` Business API includes a gRPC controller that can be triggered via the following function: `getUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getUser` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin, admin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getUser` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/users/:userId** ```js axios({ method: 'GET', url: `/v1/users/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Users` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listUsers` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listUsers` Business API is designed to handle a `list` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description The list of users is filtered by the tenantId. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `users-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listUsers` Business API includes a REST controller that can be triggered via the following route: `/v1/users` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `listUsers` Business API includes a gRPC controller that can be triggered via the following function: `listUsers()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listUsers` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listUsers` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listUsers` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin, admin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). [ id asc ] **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listUsers` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/users** ```js axios({ method: 'GET', url: '/v1/users', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`users`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Register User` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `registerUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `registerUser` Business API is designed to handle a `create` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This api is used by public users to register themselves ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `user-registered` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `registerUser` Business API includes a REST controller that can be triggered via the following route: `/v1/registeruser` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `registerUser` Business API includes a gRPC controller that can be triggered via the following function: `registerUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `registerUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `registerUser` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `No` | `-` | `body` | `userId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `avatar` | `String` | `No` | `-` | `body` | `avatar` | | **Description:** | The avatar url of the user. If not sent, a default random one will be generated. | | | | | | | | | | | | | `socialCode` | `String` | `No` | `-` | `body` | `socialCode` | | **Description:** | Send this social code if it is sent to you after a social login authetication of an unregistred user. The users profile data will be complemented from the autheticated social profile using this code. If you provide the social code there is no need to give full profile data of the user, just give the ones that are not included in social profiles. | | | | | | | | | | | | | `password` | `String` | `Yes` | `-` | `body` | `password` | | **Description:** | The password defined by the the user that is being registered. | | | | | | | | | | | | | `fullname` | `String` | `Yes` | `-` | `body` | `fullname` | | **Description:** | The fullname defined by the the user that is being registered. | | | | | | | | | | | | | `email` | `String` | `Yes` | `-` | `body` | `email` | | **Description:** | The email defined by the the user that is being registered. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. * `avatar`: ```javascript this.avatar = this.socialProfile?.avatar ?? (this.avatar ? this.avatar : `https://gravatar.com/avatar/${LIB.common.md5(this.email ?? 'nullValue')}?s=200&d=identicon`) ``` * `password`: ```javascript this.password = this.socialProfile ? this.password ?? LIB.common.randomCode() : this.password ``` * `fullname`: ```javascript this.fullname = this.socialProfile?.fullname ?? this.fullname ``` * `email`: ```javascript this.email = this.socialProfile?.email ?? this.email ``` ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `registerUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API is **public** and can be accessed without login (`loginRequired = false`). --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** ```js { emailVerified: this.socialProfile?.emailVerified ?? false, roleId: this.socialProfile?.roleId ?? 'user', } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.userId, email: this.email, password: this.hashString(this.password), fullname: this.fullname, avatar: this.avatar, emailVerified: this.socialProfile?.emailVerified ?? false, roleId: this.socialProfile?.roleId ?? 'user', isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Action : fetchArchivedUser **Action Type**: `FetchObjectAction` Check and get if any deleted user(in 30 days) exists with the same email ```js class Api { async fetchArchivedUser() { // Fetch Object on childObject user const userQuery = { $and: [ { email: this.email, isActive: false }, { _archivedAt: { $gte: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), }, }, ], }; const { convertUserQueryToSequelizeQuery } = require("common"); const scriptQuery = convertUserQueryToSequelizeQuery(userQuery); // get object from db const data = await getUserByQuery(scriptQuery); return data ? { id: data["id"], } : null; } } ``` --- ### [6] Action : checkArchivedUser **Action Type**: `ValidationAction` Prevents re-register of a user when their profile is sitll in 30days archive ```js class Api { async checkArchivedUser() { const isError = this.archivedUser?.email != null; if (isError) { throw new BadRequestError("YourProfileIsArchivedPleaseLoginToRestore"); } return isError; } } ``` --- ### [7] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [8] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [9] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [10] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [11] Action : writeVerificationNeedsToResponse **Action Type**: `AddToResponseAction` Set if email or mobile verification needed ```js class Api { async writeVerificationNeedsToResponse() { try { this.output["emailVerificationNeeded"] = !this.user?.emailVerified; this.output["mobileVerificationNeeded"] = false; return true; } catch (error) { console.error("AddToResponseAction error:", error); throw error; } } } ``` --- ### [12] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [13] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `registerUser` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | avatar | String | false | request.body?.avatar | | password | String | true | request.body?.password | | fullname | String | true | request.body?.fullname | | email | String | true | request.body?.email | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/registeruser** ```js axios({ method: 'POST', url: '/v1/registeruser', data: { avatar:"String", password:"String", fullname:"String", email:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Search Users` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `searchUsers` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `searchUsers` Business API is designed to handle a `list` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description The list of users is filtered by the tenantId. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `users-searched` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `searchUsers` Business API includes a REST controller that can be triggered via the following route: `/v1/searchusers` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `searchUsers` Business API includes a gRPC controller that can be triggered via the following function: `searchUsers()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `searchUsers` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `searchUsers` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `keyword` | `String` | `Yes` | `-` | `query` | `keyword` | | **Description:** | - | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `searchUsers` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin, admin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). [ id asc ] **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `searchUsers` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | keyword | String | true | request.query?.keyword | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/searchusers** ```js axios({ method: 'GET', url: '/v1/searchusers', data: { }, params: { keyword:'"String"', } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`users`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "users", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "users": [ { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Update Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateProfile` Business API is designed to handle a `update` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used by users to update their profiles. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/profile/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `updateProfile` Business API includes a gRPC controller that can be triggered via the following function: `updateProfile()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateProfile` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `fullname` | `String` | `No` | `-` | `body` | `fullname` | | **Description:** | A string value to represent the fullname of the user | | | | | | | | | | | | | `avatar` | `String` | `No` | `-` | `body` | `avatar` | | **Description:** | The avatar url of the user. A random avatar will be generated if not provided | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { fullname: this.fullname, avatar: this.avatar, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateProfile` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/profile/:userId** ```js axios({ method: 'PATCH', url: `/v1/profile/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update User` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateUser` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateUser` Business API is designed to handle a `update` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used by admins to update user profiles. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `user-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateUser` Business API includes a REST controller that can be triggered via the following route: `/v1/users/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `updateUser` Business API includes a gRPC controller that can be triggered via the following function: `updateUser()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateUser` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateUser` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `fullname` | `String` | `No` | `-` | `body` | `fullname` | | **Description:** | A string value to represent the fullname of the user | | | | | | | | | | | | | `avatar` | `String` | `No` | `-` | `body` | `avatar` | | **Description:** | The avatar url of the user. A random avatar will be generated if not provided | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateUser` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `saasAdmin`, `admin`, `tenantOwner`, `tenantAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { fullname: this.fullname, avatar: this.avatar, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Action : setRolesOrder **Action Type**: `CreateObjectAction` Sets the hiyerarchy of the roles to check user permissions on other users ```js class Api { async setRolesOrder() { // Construct base object const obj = {}; // Merge dynamic object Object.assign(obj, { superAdmin: 20, saasAdmin: 19, admin: 18, tenantOwner: 17, tenantAdmin: 16, saasUser: 15, tenantUser: 14, user: 13, }); return obj; } } ``` --- ### [9] Action : protectHigherRole **Action Type**: `ValidationAction` Prevents the update of a higher or equal user role if not themselves ```js class Api { async protectHigherRole() { const isValid = (this._r[this.session.roleId] ?? 0) > (this._r[this.user.roleId] ?? 0); if (!isValid) { throw new BadRequestError("AHigherUserRoleCantBeChanged"); } return isValid; } } ``` --- ### [10] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [11] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [12] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [13] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [14] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [15] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateUser` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | fullname | String | false | request.body?.fullname | | avatar | String | false | request.body?.avatar | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/users/:userId** ```js axios({ method: 'PATCH', url: `/v1/users/${userId}`, data: { fullname:"String", avatar:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Userpassword` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateUserPassword` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateUserPassword` Business API is designed to handle a `update` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to update the password of users in the profile page by users themselves ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `userpassword-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateUserPassword` Business API includes a REST controller that can be triggered via the following route: `/v1/userpassword/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `updateUserPassword` Business API includes a gRPC controller that can be triggered via the following function: `updateUserPassword()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateUserPassword` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateUserPassword` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `oldPassword` | `String` | `Yes` | `-` | `body` | `oldPassword` | | **Description:** | The old password of the user that will be overridden bu the new one. Send for double check. | | | | | | | | | | | | | `newPassword` | `String` | `Yes` | `-` | `body` | `newPassword` | | **Description:** | The new password of the user to be updated | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. * `newPassword`: ```javascript this.newPassword = this.newPassword ? this.hashString(this.newPassword) : null ``` ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateUserPassword` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { password: this.newPassword, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { // password parameter is closed to update by client request // include it in data clause unless you are sure password: this.newPassword, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Action : checkOldPassword **Action Type**: `ValidationAction` Check if the current password mathces the old password. It is done after the instance is fetched. ```js class Api { async checkOldPassword() { if (this.checkAbsolute()) return true; const isValid = this.hashCompare(this.oldPassword, this.user.password); if (!isValid) { throw new ForbiddenError("TheOldPasswordDoesNotMatch"); } return isValid; } } ``` --- ### [10] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [11] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [12] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [13] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [14] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateUserPassword` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | oldPassword | String | true | request.body?.oldPassword | | newPassword | String | true | request.body?.newPassword | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/userpassword/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpassword/${userId}`, data: { oldPassword:"String", newPassword:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Userpasswordbyadmin` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateUserPasswordByAdmin` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateUserPasswordByAdmin` Business API is designed to handle a `update` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `userpasswordbyadmin-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateUserPasswordByAdmin` Business API includes a REST controller that can be triggered via the following route: `/v1/userpasswordbyadmin/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `updateUserPasswordByAdmin` Business API includes a gRPC controller that can be triggered via the following function: `updateUserPasswordByAdmin()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateUserPasswordByAdmin` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateUserPasswordByAdmin` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `password` | `String` | `Yes` | `-` | `body` | `password` | | **Description:** | The new password of the user to be updated | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. * `password`: ```javascript this.password = this.password ? this.hashString(this.password) : null ``` ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateUserPasswordByAdmin` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { password: this.password, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { // password parameter is closed to update by client request // include it in data clause unless you are sure password: this.password, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Action : setRolesOrder **Action Type**: `CreateObjectAction` Sets the hiyerarchy of the roles to check user permissions on other users ```js class Api { async setRolesOrder() { // Construct base object const obj = {}; // Merge dynamic object Object.assign(obj, { superAdmin: 20, saasAdmin: 19, admin: 18, tenantOwner: 17, tenantAdmin: 16, saasUser: 15, tenantUser: 14, user: 13, }); return obj; } } ``` --- ### [10] Action : protectHigherRole **Action Type**: `ValidationAction` Prevents the update of a higher or equal user role ```js class Api { async protectHigherRole() { const isValid = (this._r[this.session.roleId] ?? 0) > (this._r[this.user.roleId] ?? 0); if (!isValid) { throw new BadRequestError("AHigherUserCantBeUpdated"); } return isValid; } } ``` --- ### [11] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [12] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [13] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [14] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [15] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateUserPasswordByAdmin` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | password | String | true | request.body?.password | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/userpasswordbyadmin/:userId** ```js axios({ method: 'PATCH', url: `/v1/userpasswordbyadmin/${userId}`, data: { password:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Userrole` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateUserRole` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateUserRole` Business API is designed to handle a `update` operation on the `User` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used by admin roles to update the user role.The default role is user when a user is registered. A user's role can be updated by superAdmin or admin ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `userrole-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateUserRole` Business API includes a REST controller that can be triggered via the following route: `/v1/userrole/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### gRPC Controller The `updateUserRole` Business API includes a gRPC controller that can be triggered via the following function: `updateUserRole()` By calling this gRPC endpoint using a gRPC client, you can execute the Business API. Note that all parameters must be provided as function arguments, regardless of their HTTP location configuration, which is relevant only for the REST controller. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateUserRole` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateUserRole` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `roleId` | `String` | `Yes` | `-` | `body` | `roleId` | | **Description:** | The new roleId of the user to be updated | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateUserRole` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` - **Check roles** (must pass basic role checks): Users must have at least one of the following roles to execute this API: `[superAdmin`, `admin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.userId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { roleId: this.roleId, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { // roleId parameter is closed to update by client request // include it in data clause unless you are sure roleId: this.roleId, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Action : setRolesOrder **Action Type**: `CreateObjectAction` Sets the hiyerarchy of the roles to check user permissions on other users ```js class Api { async setRolesOrder() { // Construct base object const obj = {}; // Merge dynamic object Object.assign(obj, { superAdmin: 20, saasAdmin: 19, admin: 18, tenantOwner: 17, tenantAdmin: 16, saasUser: 15, tenantUser: 0, user: 0, }); return obj; } } ``` --- ### [7] Action : preventHigherRoleSet **Action Type**: `ValidationAction` Prevents to set a user's role as higher than or equal to the setter role ```js class Api { async preventHigherRoleSet() { const isValid = (this._r[this.session.roleId] ?? 0) > (this._r[this.roleId] ?? 0); if (!isValid) { throw new BadRequestError("AHigherRoleCantBeAssigned"); } return isValid; } } ``` --- ### [8] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [9] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [10] Action : protectHigherRole **Action Type**: `ValidationAction` Prevents the update of a higher or equal user role ```js class Api { async protectHigherRole() { const isValid = (this._r[this.session.roleId] ?? 0) > (this._r[this.user.roleId] ?? 0); if (!isValid) { throw new BadRequestError("AHigherUserRoleCantBeChanged"); } return isValid; } } ``` --- ### [11] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [12] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [13] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [14] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [15] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [16] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateUserRole` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.params?.userId | | roleId | String | true | request.body?.roleId | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/userrole/:userId** ```js axios({ method: 'PATCH', url: `/v1/userrole/${userId}`, data: { roleId:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`user`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "user", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "user": { "id": "ID", "email": "String", "password": "String", "fullname": "String", "avatar": "String", "roleId": "String", "emailVerified": "Boolean", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Assign Companyadmin` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `assignCompanyAdmin` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `assignCompanyAdmin` Business API is designed to handle a `create` operation on the `CompanyAdmin` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Assigns a user as company admin. Must be called by an existing admin. Records assigning user and timestamp for audit. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyadmin-assigned` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `assignCompanyAdmin` Business API includes a REST controller that can be triggered via the following route: `/v1/assigncompanyadmin` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `assignCompanyAdmin` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `assignCompanyAdmin` Business API has 5 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyAdminId` | `ID` | `No` | `-` | `body` | `companyAdminId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `assignedAt` | `Date` | `Yes` | `-` | `body` | `assignedAt` | | **Description:** | Timestamp when admin assigned. | | | | | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `body` | `userId` | | **Description:** | FK to auth:user who is admin of this company. | | | | | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `body` | `companyId` | | **Description:** | FK to company. | | | | | | | | | | | | | `assignedBy` | `ID` | `Yes` | `-` | `body` | `assignedBy` | | **Description:** | User who assigned this admin (for audit). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `assignCompanyAdmin` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.companyAdminId, assignedAt: this.assignedAt, userId: this.userId, companyId: this.companyId, assignedBy: this.assignedBy, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `assignCompanyAdmin` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | assignedAt | Date | true | request.body?.assignedAt | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | assignedBy | ID | true | request.body?.assignedBy | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/assigncompanyadmin** ```js axios({ method: 'POST', url: '/v1/assigncompanyadmin', data: { assignedAt:"Date", userId:"ID", companyId:"ID", assignedBy:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createCompany` Business API is designed to handle a `create` operation on the `Company` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Creates a new company profile (page). User initiating the company becomes initial admin (enforced in workflow). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/companies` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createCompany` Business API has 9 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyId` | `ID` | `No` | `-` | `body` | `companyId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `name` | `String` | `Yes` | `-` | `body` | `name` | | **Description:** | Company brand name. Displayed and searchable. Unique per company. | | | | | | | | | | | | | `website` | `String` | `No` | `-` | `body` | `website` | | **Description:** | Official company website link. | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Company HQ/main location string (e.g. city, country). | | | | | | | | | | | | | `logoUrl` | `String` | `No` | `-` | `body` | `logoUrl` | | **Description:** | Uploaded image URL for company logo/branding. | | | | | | | | | | | | | `pageVisibility` | `Enum` | `Yes` | `-` | `body` | `pageVisibility` | | **Description:** | Visibility of the company page (public/private). | | | | | | | | | | | | | `createdByUserId` | `ID` | `Yes` | `-` | `body` | `createdByUserId` | | **Description:** | - | | | | | | | | | | | | | `description` | `Text` | `No` | `-` | `body` | `description` | | **Description:** | Company description / about section. | | | | | | | | | | | | | `industry` | `String` | `No` | `-` | `body` | `industry` | | **Description:** | Industry sector or market. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.companyId, name: this.name, website: this.website, location: this.location, logoUrl: this.logoUrl, pageVisibility: this.pageVisibility, createdByUserId: this.createdByUserId, description: this.description, industry: this.industry, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createCompany` api has got 8 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | true | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/companies** ```js axios({ method: 'POST', url: '/v1/companies', data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Companyupdate` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createCompanyUpdate` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createCompanyUpdate` Business API is designed to handle a `create` operation on the `CompanyUpdate` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Posts a company update/news. Only active admin of company may post on that company's behalf. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyupdate-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createCompanyUpdate` Business API includes a REST controller that can be triggered via the following route: `/v1/companyupdates` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createCompanyUpdate` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createCompanyUpdate` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyUpdateId` | `ID` | `No` | `-` | `body` | `companyUpdateId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `body` | `companyId` | | **Description:** | FK to company whose update this is. | | | | | | | | | | | | | `content` | `Text` | `Yes` | `-` | `body` | `content` | | **Description:** | Body/content of the update/news item. | | | | | | | | | | | | | `authorUserId` | `ID` | `Yes` | `-` | `body` | `authorUserId` | | **Description:** | FK to auth:user who authored the update (must be active admin at time of post). | | | | | | | | | | | | | `attachmentUrls` | `String` | `No` | `-` | `body` | `attachmentUrls` | | **Description:** | Array of URLs for update attachments (files, images, links). | | | | | | | | | | | | | `visibility` | `Enum` | `Yes` | `-` | `body` | `visibility` | | **Description:** | Update visibility: public (all) or private (followers only). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createCompanyUpdate` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.companyUpdateId, companyId: this.companyId, content: this.content, authorUserId: this.authorUserId, attachmentUrls: this.attachmentUrls, visibility: this.visibility, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createCompanyUpdate` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.body?.companyId | | content | Text | true | request.body?.content | | authorUserId | ID | true | request.body?.authorUserId | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | true | request.body?.visibility | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/companyupdates** ```js axios({ method: 'POST', url: '/v1/companyupdates', data: { companyId:"ID", content:"Text", authorUserId:"ID", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteCompany` Business API is designed to handle a `delete` operation on the `Company` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Deletes (soft-delete) a company page. Only current admin may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/companies/:companyId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteCompany` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `urlpath` | `companyId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteCompany` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/companies/:companyId** ```js axios({ method: 'DELETE', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Companyupdate` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteCompanyUpdate` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteCompanyUpdate` Business API is designed to handle a `delete` operation on the `CompanyUpdate` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Delete (soft delete) a company update/news. Only author or current admin may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyupdate-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteCompanyUpdate` Business API includes a REST controller that can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteCompanyUpdate` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteCompanyUpdate` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyUpdateId` | `ID` | `Yes` | `-` | `urlpath` | `companyUpdateId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteCompanyUpdate` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyUpdateId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteCompanyUpdate` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'DELETE', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Follow Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `followCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `followCompany` Business API is designed to handle a `create` operation on the `CompanyFollower` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Follow a company. Adds entry to companyFollower. Any logged-in user may follow. Cannot follow twice. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-followed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `followCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/followcompany` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `followCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `followCompany` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyFollowerId` | `ID` | `No` | `-` | `body` | `companyFollowerId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `body` | `userId` | | **Description:** | FK to auth:user who follows the company. | | | | | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `body` | `companyId` | | **Description:** | FK to company:company being followed. | | | | | | | | | | | | | `followedAt` | `Date` | `Yes` | `-` | `body` | `followedAt` | | **Description:** | Timestamp when user followed company. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `followCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.companyFollowerId, userId: this.userId, companyId: this.companyId, followedAt: this.followedAt, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `followCompany` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | ID | true | request.body?.userId | | companyId | ID | true | request.body?.companyId | | followedAt | Date | true | request.body?.followedAt | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/followcompany** ```js axios({ method: 'POST', url: '/v1/followcompany', data: { userId:"ID", companyId:"ID", followedAt:"Date", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getCompany` Business API is designed to handle a `get` operation on the `Company` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a company page by ID. If public, anyone can view. If private, only admin/followers. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/companies/:companyId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getCompany` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `urlpath` | `companyId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getCompany` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companies/:companyId** ```js axios({ method: 'GET', url: `/v1/companies/${companyId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Companyadmin` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getCompanyAdmin` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getCompanyAdmin` Business API is designed to handle a `get` operation on the `CompanyAdmin` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get company admin record by ID. Only admins can query of their company. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyadmin-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getCompanyAdmin` Business API includes a REST controller that can be triggered via the following route: `/v1/companyadmins/:companyAdminId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getCompanyAdmin` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getCompanyAdmin` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyAdminId` | `ID` | `Yes` | `-` | `urlpath` | `companyAdminId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getCompanyAdmin` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyAdminId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getCompanyAdmin` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyadmins/:companyAdminId** ```js axios({ method: 'GET', url: `/v1/companyadmins/${companyAdminId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Companyfollower` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getCompanyFollower` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getCompanyFollower` Business API is designed to handle a `get` operation on the `CompanyFollower` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a companyFollower record (for audit/profile/follower listing). Only follower/userId or company admin can get record. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyfollower-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getCompanyFollower` Business API includes a REST controller that can be triggered via the following route: `/v1/companyfollowers/:companyFollowerId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getCompanyFollower` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getCompanyFollower` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyFollowerId` | `ID` | `Yes` | `-` | `urlpath` | `companyFollowerId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getCompanyFollower` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyFollowerId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getCompanyFollower` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers/:companyFollowerId** ```js axios({ method: 'GET', url: `/v1/companyfollowers/${companyFollowerId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Companyupdate` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getCompanyUpdate` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getCompanyUpdate` Business API is designed to handle a `get` operation on the `CompanyUpdate` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a company update/news post. Only public posts are visible to all, private are visible to company followers and company admins. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyupdate-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getCompanyUpdate` Business API includes a REST controller that can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getCompanyUpdate` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getCompanyUpdate` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyUpdateId` | `ID` | `Yes` | `-` | `urlpath` | `companyUpdateId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getCompanyUpdate` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyUpdateId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getCompanyUpdate` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'GET', url: `/v1/companyupdates/${companyUpdateId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Companies` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listCompanies` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listCompanies` Business API is designed to handle a `list` operation on the `Company` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List all (optionally filtered) companies, e.g. for directory/search, subject to visibility. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companies-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listCompanies` Business API includes a REST controller that can be triggered via the following route: `/v1/companies` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listCompanies` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listCompanies` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listCompanies` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listCompanies` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companies** ```js axios({ method: 'GET', url: '/v1/companies', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companies`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companies", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companies": [ { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Companyadmins` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listCompanyAdmins` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listCompanyAdmins` Business API is designed to handle a `list` operation on the `CompanyAdmin` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List all current admins for a given company. Only admins can query their company admin list. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyadmins-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listCompanyAdmins` Business API includes a REST controller that can be triggered via the following route: `/v1/companyadmins` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listCompanyAdmins` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listCompanyAdmins` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listCompanyAdmins` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listCompanyAdmins` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyadmins** ```js axios({ method: 'GET', url: '/v1/companyadmins', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmins`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmins", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyAdmins": [ { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Companyfollowers` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listCompanyFollowers` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listCompanyFollowers` Business API is designed to handle a `list` operation on the `CompanyFollower` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List all followers of a company. Only company admin can see list of all followers. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyfollowers-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listCompanyFollowers` Business API includes a REST controller that can be triggered via the following route: `/v1/companyfollowers` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listCompanyFollowers` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listCompanyFollowers` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listCompanyFollowers` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listCompanyFollowers` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyfollowers** ```js axios({ method: 'GET', url: '/v1/companyfollowers', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollowers`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollowers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyFollowers": [ { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Companyupdates` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listCompanyUpdates` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listCompanyUpdates` Business API is designed to handle a `list` operation on the `CompanyUpdate` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List company updates/news for a company. Public updates are visible to all, private to followers/admins. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyupdates-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listCompanyUpdates` Business API includes a REST controller that can be triggered via the following route: `/v1/companyupdates` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listCompanyUpdates` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listCompanyUpdates` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listCompanyUpdates` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listCompanyUpdates` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/companyupdates** ```js axios({ method: 'GET', url: '/v1/companyupdates', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdates`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdates", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "companyUpdates": [ { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Remove Companyadmin` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `removeCompanyAdmin` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `removeCompanyAdmin` Business API is designed to handle a `delete` operation on the `CompanyAdmin` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Removes admin rights from a user for a company. Can only be performed by current admin, not self-removal unless last admin? ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyadmin-removed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `removeCompanyAdmin` Business API includes a REST controller that can be triggered via the following route: `/v1/removecompanyadmin/:companyAdminId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `removeCompanyAdmin` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `removeCompanyAdmin` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyAdminId` | `ID` | `Yes` | `-` | `urlpath` | `companyAdminId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `removeCompanyAdmin` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyAdminId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `removeCompanyAdmin` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyAdminId | ID | true | request.params?.companyAdminId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/removecompanyadmin/:companyAdminId** ```js axios({ method: 'DELETE', url: `/v1/removecompanyadmin/${companyAdminId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyAdmin`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyAdmin", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyAdmin": { "id": "ID", "assignedAt": "Date", "userId": "ID", "companyId": "ID", "assignedBy": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Unfollow Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `unfollowCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `unfollowCompany` Business API is designed to handle a `delete` operation on the `CompanyFollower` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Unfollow a company. Deletes companyFollower entry. Only current follower may unfollow. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-unfollowed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `unfollowCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/unfollowcompany/:companyFollowerId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `unfollowCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `unfollowCompany` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyFollowerId` | `ID` | `Yes` | `-` | `urlpath` | `companyFollowerId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `unfollowCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyFollowerId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `unfollowCompany` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyFollowerId | ID | true | request.params?.companyFollowerId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/unfollowcompany/:companyFollowerId** ```js axios({ method: 'DELETE', url: `/v1/unfollowcompany/${companyFollowerId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyFollower`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyFollower", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "companyFollower": { "id": "ID", "userId": "ID", "companyId": "ID", "followedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Company` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateCompany` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateCompany` Business API is designed to handle a `update` operation on the `Company` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Updates fields of a company page/profile. Only current company admin can update. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `company-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateCompany` Business API includes a REST controller that can be triggered via the following route: `/v1/companies/:companyId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateCompany` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateCompany` Business API has 9 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `urlpath` | `companyId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `name` | `String` | `No` | `-` | `body` | `name` | | **Description:** | Company brand name. Displayed and searchable. Unique per company. | | | | | | | | | | | | | `website` | `String` | `No` | `-` | `body` | `website` | | **Description:** | Official company website link. | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Company HQ/main location string (e.g. city, country). | | | | | | | | | | | | | `logoUrl` | `String` | `No` | `-` | `body` | `logoUrl` | | **Description:** | Uploaded image URL for company logo/branding. | | | | | | | | | | | | | `pageVisibility` | `Enum` | `No` | `-` | `body` | `pageVisibility` | | **Description:** | Visibility of the company page (public/private). | | | | | | | | | | | | | `createdByUserId` | `ID` | `Yes` | `-` | `body` | `createdByUserId` | | **Description:** | - | | | | | | | | | | | | | `description` | `Text` | `No` | `-` | `body` | `description` | | **Description:** | Company description / about section. | | | | | | | | | | | | | `industry` | `String` | `No` | `-` | `body` | `industry` | | **Description:** | Industry sector or market. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateCompany` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { name: this.name, website: this.website, location: this.location, logoUrl: this.logoUrl, pageVisibility: this.pageVisibility, createdByUserId: this.createdByUserId, description: this.description, industry: this.industry, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateCompany` api has got 9 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyId | ID | true | request.params?.companyId | | name | String | false | request.body?.name | | website | String | false | request.body?.website | | location | String | false | request.body?.location | | logoUrl | String | false | request.body?.logoUrl | | pageVisibility | Enum | false | request.body?.pageVisibility | | createdByUserId | ID | true | request.body?.createdByUserId | | description | Text | false | request.body?.description | | industry | String | false | request.body?.industry | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/companies/:companyId** ```js axios({ method: 'PATCH', url: `/v1/companies/${companyId}`, data: { name:"String", website:"String", location:"String", logoUrl:"String", pageVisibility:"Enum", createdByUserId:"ID", description:"Text", industry:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`company`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "company", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "company": { "id": "ID", "name": "String", "website": "String", "location": "String", "logoUrl": "String", "pageVisibility": "Enum", "pageVisibility_idx": "Integer", "createdByUserId": "ID", "description": "Text", "industry": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Companyupdate` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateCompanyUpdate` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateCompanyUpdate` Business API is designed to handle a `update` operation on the `CompanyUpdate` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update company update post/news. Only author or company admins may update. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `companyupdate-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateCompanyUpdate` Business API includes a REST controller that can be triggered via the following route: `/v1/companyupdates/:companyUpdateId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateCompanyUpdate` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateCompanyUpdate` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `companyUpdateId` | `ID` | `Yes` | `-` | `urlpath` | `companyUpdateId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `content` | `Text` | `No` | `-` | `body` | `content` | | **Description:** | Body/content of the update/news item. | | | | | | | | | | | | | `attachmentUrls` | `String` | `No` | `-` | `body` | `attachmentUrls` | | **Description:** | Array of URLs for update attachments (files, images, links). | | | | | | | | | | | | | `visibility` | `Enum` | `No` | `-` | `body` | `visibility` | | **Description:** | Update visibility: public (all) or private (followers only). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateCompanyUpdate` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.companyUpdateId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { content: this.content, attachmentUrls: this.attachmentUrls ? this.attachmentUrls : ( this.attachmentUrls_remove ? sequelize.fn('array_remove', sequelize.col('attachmentUrls'), this.attachmentUrls_remove) : (this.attachmentUrls_append ? sequelize.fn('array_append', sequelize.col('attachmentUrls'), this.attachmentUrls_append) : undefined)) , visibility: this.visibility, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateCompanyUpdate` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | companyUpdateId | ID | true | request.params?.companyUpdateId | | content | Text | false | request.body?.content | | attachmentUrls | String | false | request.body?.attachmentUrls | | visibility | Enum | false | request.body?.visibility | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/companyupdates/:companyUpdateId** ```js axios({ method: 'PATCH', url: `/v1/companyupdates/${companyUpdateId}`, data: { content:"Text", attachmentUrls:"String", visibility:"Enum", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`companyUpdate`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "companyUpdate", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "companyUpdate": { "id": "ID", "companyId": "ID", "content": "Text", "authorUserId": "ID", "attachmentUrls": "String", "visibility": "Enum", "visibility_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Comment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createComment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createComment` Business API is designed to handle a `create` operation on the `Comment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Add a new comment to a post. Can be top-level (parentCommentId null) or a reply. Only authenticated users can comment. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `comment-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createComment` Business API includes a REST controller that can be triggered via the following route: `/v1/comments` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createComment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createComment` Business API has 5 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `commentId` | `ID` | `No` | `-` | `body` | `commentId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `authorUserId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | FK to auth:user - user who authored comment. | | | | | | | | | | | | | `postId` | `ID` | `Yes` | `-` | `body` | `postId` | | **Description:** | FK to content:post - the post this comment is for. Required. | | | | | | | | | | | | | `content` | `Text` | `Yes` | `-` | `body` | `content` | | **Description:** | Comment body/content. | | | | | | | | | | | | | `parentCommentId` | `ID` | `No` | `-` | `body` | `parentCommentId` | | **Description:** | Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createComment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.commentId, authorUserId: this.authorUserId, postId: this.postId, content: this.content, parentCommentId: this.parentCommentId, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createComment` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | | content | Text | true | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/comments** ```js axios({ method: 'POST', url: '/v1/comments', data: { postId:"ID", content:"Text", parentCommentId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createPost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createPost` Business API is designed to handle a `create` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Create a new post for the authenticated user. Visibility defaults to public. Posts can optionally belong to a company if author is a company admin. Attachments optional. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createPost` Business API includes a REST controller that can be triggered via the following route: `/v1/posts` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createPost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createPost` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `postId` | `ID` | `No` | `-` | `body` | `postId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `content` | `Text` | `Yes` | `-` | `body` | `content` | | **Description:** | Main post content/body text | | | | | | | | | | | | | `companyId` | `ID` | `No` | `-` | `body` | `companyId` | | **Description:** | Optional. FK to company:company - if set, post is from company context (by admin). | | | | | | | | | | | | | `authorUserId` | `ID` | `Yes` | `-` | `body` | `authorUserId` | | **Description:** | FK to auth:user - the user who created the post. Required. | | | | | | | | | | | | | `visibility` | `Enum` | `Yes` | `-` | `body` | `visibility` | | **Description:** | Post-level visibility: public or private. | | | | | | | | | | | | | `attachmentUrls` | `String` | `No` | `-` | `body` | `attachmentUrls` | | **Description:** | Array of attachment URLs (e.g. images, docs, links). Optional. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createPost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.postId, content: this.content, companyId: this.companyId, authorUserId: this.authorUserId, visibility: this.visibility, attachmentUrls: this.attachmentUrls, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createPost` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | companyId | ID | false | request.body?.companyId | | authorUserId | ID | true | request.body?.authorUserId | | visibility | Enum | true | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/posts** ```js axios({ method: 'POST', url: '/v1/posts', data: { content:"Text", companyId:"ID", authorUserId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Comment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteComment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteComment` Business API is designed to handle a `delete` operation on the `Comment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Delete (soft-delete) a comment. Only the author may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `comment-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteComment` Business API includes a REST controller that can be triggered via the following route: `/v1/comments/:commentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteComment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteComment` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `commentId` | `ID` | `Yes` | `-` | `urlpath` | `commentId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteComment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.commentId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteComment` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/comments/:commentId** ```js axios({ method: 'DELETE', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deletePost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deletePost` Business API is designed to handle a `delete` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Delete (soft-delete) a post. Only the author (or company admin for company posts) may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deletePost` Business API includes a REST controller that can be triggered via the following route: `/v1/posts/:postId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deletePost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deletePost` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `postId` | `ID` | `Yes` | `-` | `urlpath` | `postId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deletePost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.postId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deletePost` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/posts/:postId** ```js axios({ method: 'DELETE', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Comment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getComment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getComment` Business API is designed to handle a `get` operation on the `Comment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a comment by ID. Any user can read comments. Soft-deleted comments not listed unless owner. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `comment-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getComment` Business API includes a REST controller that can be triggered via the following route: `/v1/comments/:commentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getComment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getComment` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `commentId` | `ID` | `Yes` | `-` | `urlpath` | `commentId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getComment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.commentId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getComment` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/comments/:commentId** ```js axios({ method: 'GET', url: `/v1/comments/${commentId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPost` Business API is designed to handle a `get` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a post by ID. Public posts visible to all. Private only visible to author or company admin (if company post). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPost` Business API includes a REST controller that can be triggered via the following route: `/v1/posts/:postId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPost` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `postId` | `ID` | `Yes` | `-` | `urlpath` | `postId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.postId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPost` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/posts/:postId** ```js axios({ method: 'GET', url: `/v1/posts/${postId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Like Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `likePost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `likePost` Business API is designed to handle a `create` operation on the `Like` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Like a post. User can like a post only once; duplicate likes prevented. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-liked` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `likePost` Business API includes a REST controller that can be triggered via the following route: `/v1/likepost` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `likePost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `likePost` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `likeId` | `ID` | `No` | `-` | `body` | `likeId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `postId` | `ID` | `Yes` | `-` | `body` | `postId` | | **Description:** | FK to content:post - the post that was liked. Required. | | | | | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | FK to auth:user - owner of the like entry (who liked). Required. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `likePost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.likeId, postId: this.postId, userId: this.userId, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `likePost` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.body?.postId | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/likepost** ```js axios({ method: 'POST', url: '/v1/likepost', data: { postId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`like`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Comments` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listComments` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listComments` Business API is designed to handle a `list` operation on the `Comment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List comments for a post (or by parentComment). Supports filtering by postId and parentCommentId. Sorted by creation date ascending. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `comments-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listComments` Business API includes a REST controller that can be triggered via the following route: `/v1/comments` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listComments` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listComments` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listComments` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listComments` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/comments** ```js axios({ method: 'GET', url: '/v1/comments', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comments`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "comments": [ { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Likes` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listLikes` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listLikes` Business API is designed to handle a `list` operation on the `Like` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List likes on a given post (or by user). Supports filtering by postId and userId. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `likes-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listLikes` Business API includes a REST controller that can be triggered via the following route: `/v1/likes` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listLikes` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listLikes` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listLikes` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listLikes` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/likes** ```js axios({ method: 'GET', url: '/v1/likes', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`likes`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "likes", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "likes": [ { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Posts` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listPosts` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listPosts` Business API is designed to handle a `list` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List posts matching filters, honoring post visibility. Public posts shown to all; private posts only to owners. Supports filtering by author, company, and visibility. Feed aggregation is handled at higher BFF layer. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `posts-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listPosts` Business API includes a REST controller that can be triggered via the following route: `/v1/posts` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listPosts` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listPosts` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listPosts` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listPosts` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/posts** ```js axios({ method: 'GET', url: '/v1/posts', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`posts`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Userposts` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listUserPosts` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listUserPosts` Business API is designed to handle a `list` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description list all posts of a user ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `userposts-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listUserPosts` Business API includes a REST controller that can be triggered via the following route: `/v1/userposts` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listUserPosts` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listUserPosts` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listUserPosts` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has a `fullWhereClause` setting : ```js {authorUserId:this.session.userId} ``` **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{authorUserId:this.session.userId},{isActive:true}]} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listUserPosts` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/userposts** ```js axios({ method: 'GET', url: '/v1/userposts', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`posts`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "posts", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "posts": [ { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Unlike Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `unlikePost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `unlikePost` Business API is designed to handle a `delete` operation on the `Like` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Undo a like by user for a given post. Soft-deletes the like record. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-unliked` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `unlikePost` Business API includes a REST controller that can be triggered via the following route: `/v1/unlikepost/:likeId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `unlikePost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `unlikePost` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `likeId` | `ID` | `Yes` | `-` | `urlpath` | `likeId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `unlikePost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.likeId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `unlikePost` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | likeId | ID | true | request.params?.likeId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/unlikepost/:likeId** ```js axios({ method: 'DELETE', url: `/v1/unlikepost/${likeId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`like`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "like", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "like": { "id": "ID", "likedAt": "Date", "postId": "ID", "userId": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Comment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateComment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateComment` Business API is designed to handle a `update` operation on the `Comment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update an existing comment. Only the author can update. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `comment-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateComment` Business API includes a REST controller that can be triggered via the following route: `/v1/comments/:commentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateComment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateComment` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `commentId` | `ID` | `Yes` | `-` | `urlpath` | `commentId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `content` | `Text` | `No` | `-` | `body` | `content` | | **Description:** | Comment body/content. | | | | | | | | | | | | | `parentCommentId` | `ID` | `No` | `-` | `body` | `parentCommentId` | | **Description:** | Optional. FK to comment. If set, this is a reply to the parent comment, otherwise a top-level comment. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateComment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.commentId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { content: this.content, parentCommentId: this.parentCommentId, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateComment` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | commentId | ID | true | request.params?.commentId | | content | Text | false | request.body?.content | | parentCommentId | ID | false | request.body?.parentCommentId | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/comments/:commentId** ```js axios({ method: 'PATCH', url: `/v1/comments/${commentId}`, data: { content:"Text", parentCommentId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`comment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "comment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "comment": { "id": "ID", "authorUserId": "ID", "postId": "ID", "content": "Text", "parentCommentId": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Post` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updatePost` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updatePost` Business API is designed to handle a `update` operation on the `Post` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update content, visibility, or attachments of an existing post by its owner or company admin (if company post). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `post-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updatePost` Business API includes a REST controller that can be triggered via the following route: `/v1/posts/:postId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updatePost` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updatePost` Business API has 5 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `postId` | `ID` | `Yes` | `-` | `urlpath` | `postId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `content` | `Text` | `No` | `-` | `body` | `content` | | **Description:** | Main post content/body text | | | | | | | | | | | | | `companyId` | `ID` | `No` | `-` | `body` | `companyId` | | **Description:** | Optional. FK to company:company - if set, post is from company context (by admin). | | | | | | | | | | | | | `visibility` | `Enum` | `No` | `-` | `body` | `visibility` | | **Description:** | Post-level visibility: public or private. | | | | | | | | | | | | | `attachmentUrls` | `String` | `No` | `-` | `body` | `attachmentUrls` | | **Description:** | Array of attachment URLs (e.g. images, docs, links). Optional. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updatePost` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.postId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { content: this.content, companyId: this.companyId, visibility: this.visibility, attachmentUrls: this.attachmentUrls ? this.attachmentUrls : ( this.attachmentUrls_remove ? sequelize.fn('array_remove', sequelize.col('attachmentUrls'), this.attachmentUrls_remove) : (this.attachmentUrls_append ? sequelize.fn('array_append', sequelize.col('attachmentUrls'), this.attachmentUrls_append) : undefined)) , } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updatePost` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | postId | ID | true | request.params?.postId | | content | Text | false | request.body?.content | | companyId | ID | false | request.body?.companyId | | visibility | Enum | false | request.body?.visibility | | attachmentUrls | String | false | request.body?.attachmentUrls | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/posts/:postId** ```js axios({ method: 'PATCH', url: `/v1/posts/${postId}`, data: { content:"Text", companyId:"ID", visibility:"Enum", attachmentUrls:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`post`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "post", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "post": { "id": "ID", "content": "Text", "companyId": "ID", "authorUserId": "ID", "visibility": "Enum", "visibility_idx": "Integer", "attachmentUrls": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Jobapplication` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createJobApplication` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createJobApplication` Business API is designed to handle a `create` operation on the `JobApplication` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Submit a job application for a jobPosting (by logged-in user). Only if not already applied, and before deadline. Sets status=submitted. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobapplication-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createJobApplication` Business API includes a REST controller that can be triggered via the following route: `/v1/jobapplications` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createJobApplication` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createJobApplication` Business API has 8 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobApplicationId` | `ID` | `No` | `-` | `body` | `jobApplicationId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `jobPostingId` | `ID` | `Yes` | `-` | `body` | `jobPostingId` | | **Description:** | FK to jobPosting: job applied for. | | | | | | | | | | | | | `applicantUserId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | User who submitted the application. FK to auth:user.id; used for ownership. | | | | | | | | | | | | | `coverLetter` | `Text` | `No` | `-` | `body` | `coverLetter` | | **Description:** | User's (optional) cover letter/body with application. | | | | | | | | | | | | | `resumeUrl` | `String` | `No` | `-` | `body` | `resumeUrl` | | **Description:** | URL/path to user resume/doc to share with recruiter/admin. User-provided. | | | | | | | | | | | | | `lastStatusUpdateAt` | `Date` | `Yes` | `-` | `body` | `lastStatusUpdateAt` | | **Description:** | Timestamp of latest status change (set when status is updated). | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. | | | | | | | | | | | | | `appliedAt` | `Date` | `Yes` | `-` | `body` | `appliedAt` | | **Description:** | Timestamp when application was submitted. Set automatically on create. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createJobApplication` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.jobApplicationId, jobPostingId: this.jobPostingId, applicantUserId: this.applicantUserId, coverLetter: this.coverLetter, resumeUrl: this.resumeUrl, lastStatusUpdateAt: this.lastStatusUpdateAt, status: this.status, appliedAt: this.appliedAt, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createJobApplication` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.body?.jobPostingId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/jobapplications** ```js axios({ method: 'POST', url: '/v1/jobapplications', data: { jobPostingId:"ID", coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Jobposting` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createJobPosting` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createJobPosting` Business API is designed to handle a `create` operation on the `JobPosting` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Create a new job posting. Only company admins/recruiters for companyId can create. postedByUserId set from session. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobposting-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createJobPosting` Business API includes a REST controller that can be triggered via the following route: `/v1/jobpostings` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createJobPosting` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createJobPosting` Business API has 13 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobPostingId` | `ID` | `No` | `-` | `body` | `jobPostingId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `description` | `Text` | `Yes` | `-` | `body` | `description` | | **Description:** | Detailed description of the job posting. | | | | | | | | | | | | | `title` | `String` | `Yes` | `-` | `body` | `title` | | **Description:** | Job title/position name. | | | | | | | | | | | | | `applicationDeadline` | `Date` | `No` | `-` | `body` | `applicationDeadline` | | **Description:** | Last date for accepting applications. Checked during apply. | | | | | | | | | | | | | `companyId` | `ID` | `No` | `-` | `body` | `companyId` | | **Description:** | Company offering the job. FK to company:company | | | | | | | | | | | | | `employmentType` | `Enum` | `Yes` | `-` | `body` | `employmentType` | | **Description:** | Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). | | | | | | | | | | | | | `postedByUserId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | User (admin/recruiter) who posted the job. FK to auth:user; used for ownership. | | | | | | | | | | | | | `salaryRange` | `String` | `No` | `-` | `body` | `salaryRange` | | **Description:** | Human-readable salary range (free-form for v1; can be refined later). | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Primary job location (city, country, etc.) | | | | | | | | | | | | | `visibility` | `Enum` | `Yes` | `-` | `body` | `visibility` | | **Description:** | Controls who can see/apply to this job: public (all) or private (admins only). | | | | | | | | | | | | | `workplaceType` | `Enum` | `Yes` | `-` | `body` | `workplaceType` | | **Description:** | Workplace type (on-site,remote,hybrid). | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | status : active or closed | | | | | | | | | | | | | `companyName` | `String` | `Yes` | `-` | `body` | `companyName` | | **Description:** | company name | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createJobPosting` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.jobPostingId, description: this.description, title: this.title, applicationDeadline: this.applicationDeadline, companyId: this.companyId, employmentType: this.employmentType, postedByUserId: this.postedByUserId, salaryRange: this.salaryRange, location: this.location, visibility: this.visibility, workplaceType: this.workplaceType, status: this.status, companyName: this.companyName, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createJobPosting` api has got 11 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | false | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/jobpostings** ```js axios({ method: 'POST', url: '/v1/jobpostings', data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Jobapplication` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteJobApplication` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteJobApplication` Business API is designed to handle a `delete` operation on the `JobApplication` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Delete (soft) job application. Only applicant or admin for the job's company may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobapplication-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteJobApplication` Business API includes a REST controller that can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteJobApplication` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteJobApplication` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobApplicationId` | `ID` | `Yes` | `-` | `urlpath` | `jobApplicationId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteJobApplication` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobApplicationId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteJobApplication` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'DELETE', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Jobposting` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteJobPosting` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteJobPosting` Business API is designed to handle a `delete` operation on the `JobPosting` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Delete (soft) a job posting. Only admin for companyId may delete. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobposting-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteJobPosting` Business API includes a REST controller that can be triggered via the following route: `/v1/jobpostings/:jobPostingId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteJobPosting` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteJobPosting` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobPostingId` | `ID` | `Yes` | `-` | `urlpath` | `jobPostingId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteJobPosting` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobPostingId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteJobPosting` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/jobpostings/:jobPostingId** ```js axios({ method: 'DELETE', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Jobapplication` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getJobApplication` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getJobApplication` Business API is designed to handle a `get` operation on the `JobApplication` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get job application record. Only applicant or admin of company may view. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobapplication-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getJobApplication` Business API includes a REST controller that can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getJobApplication` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getJobApplication` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobApplicationId` | `ID` | `Yes` | `-` | `urlpath` | `jobApplicationId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getJobApplication` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobApplicationId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getJobApplication` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'GET', url: `/v1/jobapplications/${jobApplicationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Jobposting` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getJobPosting` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getJobPosting` Business API is designed to handle a `get` operation on the `JobPosting` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Fetch a job posting by ID. Publicly visible if visibility=public, else only viewable by admins of company. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobposting-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getJobPosting` Business API includes a REST controller that can be triggered via the following route: `/v1/jobpostings/:jobPostingId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getJobPosting` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getJobPosting` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobPostingId` | `ID` | `Yes` | `-` | `urlpath` | `jobPostingId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getJobPosting` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobPostingId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getJobPosting` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/jobpostings/:jobPostingId** ```js axios({ method: 'GET', url: `/v1/jobpostings/${jobPostingId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Jobapplications` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listJobApplications` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listJobApplications` Business API is designed to handle a `list` operation on the `JobApplication` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List job applications. Applicants see their own; admins of job's company can view all for their jobs; supports filter by status, job and applicant. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobapplications-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listJobApplications` Business API includes a REST controller that can be triggered via the following route: `/v1/jobapplications` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listJobApplications` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listJobApplications` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listJobApplications` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listJobApplications` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/jobapplications** ```js axios({ method: 'GET', url: '/v1/jobapplications', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplications`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobApplications": [ { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Jobpostings` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listJobPostings` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listJobPostings` Business API is designed to handle a `list` operation on the `JobPosting` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List job postings. Public jobs visible to all; private jobs visible only to company admins or recruiters. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobpostings-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listJobPostings` Business API includes a REST controller that can be triggered via the following route: `/v1/jobpostings` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listJobPostings` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listJobPostings` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listJobPostings` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listJobPostings` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/jobpostings** ```js axios({ method: 'GET', url: '/v1/jobpostings', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPostings`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPostings", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "jobPostings": [ { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Update Jobapplication` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateJobApplication` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateJobApplication` Business API is designed to handle a `update` operation on the `JobApplication` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update job application (status/by admin, or resume/cover by applicant, limited). Only admins/recruiters for job's company, or applicant, may update. Status can only move forward, not revert to submitted. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobapplication-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateJobApplication` Business API includes a REST controller that can be triggered via the following route: `/v1/jobapplications/:jobApplicationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateJobApplication` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateJobApplication` Business API has 5 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobApplicationId` | `ID` | `Yes` | `-` | `urlpath` | `jobApplicationId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `coverLetter` | `Text` | `No` | `-` | `body` | `coverLetter` | | **Description:** | User's (optional) cover letter/body with application. | | | | | | | | | | | | | `resumeUrl` | `String` | `No` | `-` | `body` | `resumeUrl` | | **Description:** | URL/path to user resume/doc to share with recruiter/admin. User-provided. | | | | | | | | | | | | | `lastStatusUpdateAt` | `Date` | `No` | `-` | `body` | `lastStatusUpdateAt` | | **Description:** | Timestamp of latest status change (set when status is updated). | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | Application status: submitted, in_review, accepted, rejected. Only updatable by admin/recruiter for this job. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateJobApplication` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobApplicationId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { coverLetter: this.coverLetter, resumeUrl: this.resumeUrl, lastStatusUpdateAt: this.lastStatusUpdateAt, status: this.status, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateJobApplication` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobApplicationId | ID | true | request.params?.jobApplicationId | | coverLetter | Text | false | request.body?.coverLetter | | resumeUrl | String | false | request.body?.resumeUrl | | status | Enum | true | request.body?.status | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/jobapplications/:jobApplicationId** ```js axios({ method: 'PATCH', url: `/v1/jobapplications/${jobApplicationId}`, data: { coverLetter:"Text", resumeUrl:"String", status:"Enum", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobApplication`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobApplication", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobApplication": { "id": "ID", "jobPostingId": "ID", "applicantUserId": "ID", "coverLetter": "Text", "resumeUrl": "String", "lastStatusUpdateAt": "Date", "status": "Enum", "status_idx": "Integer", "appliedAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Jobposting` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateJobPosting` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateJobPosting` Business API is designed to handle a `update` operation on the `JobPosting` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update job posting fields. Only company admins for companyId may update. Ownership enforced. Edits forbidden after deadline if desired. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `jobposting-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateJobPosting` Business API includes a REST controller that can be triggered via the following route: `/v1/jobpostings/:jobPostingId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateJobPosting` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateJobPosting` Business API has 13 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `jobPostingId` | `ID` | `Yes` | `-` | `urlpath` | `jobPostingId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `description` | `Text` | `Yes` | `-` | `body` | `description` | | **Description:** | Detailed description of the job posting. | | | | | | | | | | | | | `title` | `String` | `Yes` | `-` | `body` | `title` | | **Description:** | Job title/position name. | | | | | | | | | | | | | `applicationDeadline` | `Date` | `No` | `-` | `body` | `applicationDeadline` | | **Description:** | Last date for accepting applications. Checked during apply. | | | | | | | | | | | | | `companyId` | `ID` | `Yes` | `-` | `body` | `companyId` | | **Description:** | Company offering the job. FK to company:company | | | | | | | | | | | | | `employmentType` | `Enum` | `Yes` | `-` | `body` | `employmentType` | | **Description:** | Job employment type (full-time, part-time, contract, internship,temporary,volunteer,other). | | | | | | | | | | | | | `postedByUserId` | `ID` | `No` | `-` | `session` | `userId` | | **Description:** | User (admin/recruiter) who posted the job. FK to auth:user; used for ownership. | | | | | | | | | | | | | `salaryRange` | `String` | `No` | `-` | `body` | `salaryRange` | | **Description:** | Human-readable salary range (free-form for v1; can be refined later). | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Primary job location (city, country, etc.) | | | | | | | | | | | | | `visibility` | `Enum` | `Yes` | `-` | `body` | `visibility` | | **Description:** | Controls who can see/apply to this job: public (all) or private (admins only). | | | | | | | | | | | | | `workplaceType` | `Enum` | `Yes` | `-` | `body` | `workplaceType` | | **Description:** | Workplace type (on-site,remote,hybrid). | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | status : active or closed | | | | | | | | | | | | | `companyName` | `String` | `Yes` | `-` | `body` | `companyName` | | **Description:** | company name | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateJobPosting` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.jobPostingId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { description: this.description, title: this.title, applicationDeadline: this.applicationDeadline, companyId: this.companyId, employmentType: this.employmentType, postedByUserId: this.postedByUserId, salaryRange: this.salaryRange, location: this.location, visibility: this.visibility, workplaceType: this.workplaceType, status: this.status, companyName: this.companyName, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateJobPosting` api has got 12 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | jobPostingId | ID | true | request.params?.jobPostingId | | description | Text | true | request.body?.description | | title | String | true | request.body?.title | | applicationDeadline | Date | false | request.body?.applicationDeadline | | companyId | ID | true | request.body?.companyId | | employmentType | Enum | true | request.body?.employmentType | | salaryRange | String | false | request.body?.salaryRange | | location | String | false | request.body?.location | | visibility | Enum | true | request.body?.visibility | | workplaceType | Enum | true | request.body?.workplaceType | | status | Enum | true | request.body?.status | | companyName | String | true | request.body?.companyName | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/jobpostings/:jobPostingId** ```js axios({ method: 'PATCH', url: `/v1/jobpostings/${jobPostingId}`, data: { description:"Text", title:"String", applicationDeadline:"Date", companyId:"ID", employmentType:"Enum", salaryRange:"String", location:"String", visibility:"Enum", workplaceType:"Enum", status:"Enum", companyName:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`jobPosting`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "jobPosting", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "jobPosting": { "id": "ID", "description": "Text", "title": "String", "applicationDeadline": "Date", "companyId": "ID", "employmentType": "Enum", "employmentType_idx": "Integer", "postedByUserId": "ID", "salaryRange": "String", "location": "String", "visibility": "Enum", "visibility_idx": "Integer", "workplaceType": "Enum", "workplaceType_idx": "Integer", "status": "Enum", "status_idx": "Integer", "companyName": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Conversation` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createConversation` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createConversation` Business API is designed to handle a `create` operation on the `Conversation` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Create a new conversation (thread) for messaging; can be group (isGroup) or 1:1. Participants must include the session user. For 1:1, only two users allowed; for group, at least three. If 1:1 exists, prevent duplicate. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `conversation-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createConversation` Business API includes a REST controller that can be triggered via the following route: `/v1/conversations` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createConversation` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createConversation` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `conversationId` | `ID` | `No` | `-` | `body` | `conversationId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `isGroup` | `Boolean` | `Yes` | `-` | `body` | `isGroup` | | **Description:** | True for group; false for one-to-one conversation (default false). | | | | | | | | | | | | | `participantIds` | `ID` | `Yes` | `-` | `body` | `participantIds` | | **Description:** | Array of user IDs (auth:user) participating in the conversation (min 2). | | | | | | | | | | | | | `lastMessageAt` | `Date` | `No` | `-` | `body` | `lastMessageAt` | | **Description:** | Timestamp of most recent message sent in this conversation. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createConversation` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.conversationId, isGroup: this.isGroup, participantIds: this.participantIds, lastMessageAt: this.lastMessageAt, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createConversation` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | isGroup | Boolean | true | request.body?.isGroup | | participantIds | ID | true | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/conversations** ```js axios({ method: 'POST', url: '/v1/conversations', data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Message` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createMessage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createMessage` Business API is designed to handle a `create` operation on the `Message` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Send a new message in a conversation. Only participants can send. On send, update conversation.lastMessageAt and set sentAt=now, senderUserId=session user. Add sender to readBy by default. Publish event for notification subsystem. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `message-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createMessage` Business API includes a REST controller that can be triggered via the following route: `/v1/messages` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createMessage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createMessage` Business API has 7 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `messageId` | `ID` | `No` | `-` | `body` | `messageId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `content` | `Text` | `Yes` | `-` | `body` | `content` | | **Description:** | Raw message body/content. | | | | | | | | | | | | | `senderUserId` | `ID` | `Yes` | `-` | `body` | `senderUserId` | | **Description:** | auth:user.id of message sender. | | | | | | | | | | | | | `deletedFor` | `ID` | `No` | `-` | `body` | `deletedFor` | | **Description:** | Array of userIds who have deleted/hid this message (soft/hide). | | | | | | | | | | | | | `readBy` | `ID` | `No` | `-` | `body` | `readBy` | | **Description:** | Array of userIds who have read this message. Used for read receipts. | | | | | | | | | | | | | `conversationId` | `ID` | `Yes` | `-` | `body` | `conversationId` | | **Description:** | Conversation this message belongs to (messaging:conversation). | | | | | | | | | | | | | `sentAt` | `Date` | `No` | `-` | `body` | `sentAt` | | **Description:** | Timestamp when message is sent (defaults to now on create). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createMessage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.messageId, content: this.content, senderUserId: this.senderUserId, deletedFor: this.deletedFor, readBy: this.readBy, conversationId: this.conversationId, sentAt: this.sentAt, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createMessage` api has got 6 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | content | Text | true | request.body?.content | | senderUserId | ID | true | request.body?.senderUserId | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | | conversationId | ID | true | request.body?.conversationId | | sentAt | Date | false | request.body?.sentAt | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/messages** ```js axios({ method: 'POST', url: '/v1/messages', data: { content:"Text", senderUserId:"ID", deletedFor:"ID", readBy:"ID", conversationId:"ID", sentAt:"Date", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Conversation` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteConversation` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteConversation` Business API is designed to handle a `delete` operation on the `Conversation` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Soft-delete a conversation thread. Only participants can delete. This is 'hide for all' (e.g., group exit or complete deletion). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `conversation-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteConversation` Business API includes a REST controller that can be triggered via the following route: `/v1/conversations/:conversationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteConversation` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteConversation` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `conversationId` | `ID` | `Yes` | `-` | `urlpath` | `conversationId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteConversation` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.conversationId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteConversation` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/conversations/:conversationId** ```js axios({ method: 'DELETE', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Message` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteMessage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteMessage` Business API is designed to handle a `delete` operation on the `Message` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Soft-delete a message. Sender can hard-delete for all (set isActive=false). Any participant can soft-delete (add own userId to deletedFor array). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `message-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteMessage` Business API includes a REST controller that can be triggered via the following route: `/v1/messages/:messageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteMessage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteMessage` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `messageId` | `ID` | `Yes` | `-` | `urlpath` | `messageId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteMessage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.messageId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteMessage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/messages/:messageId** ```js axios({ method: 'DELETE', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Conversation` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getConversation` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getConversation` Business API is designed to handle a `get` operation on the `Conversation` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Fetch details for a conversation thread. Only participants may view. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `conversation-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getConversation` Business API includes a REST controller that can be triggered via the following route: `/v1/conversations/:conversationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getConversation` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getConversation` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `conversationId` | `ID` | `Yes` | `-` | `urlpath` | `conversationId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getConversation` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.conversationId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getConversation` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/conversations/:conversationId** ```js axios({ method: 'GET', url: `/v1/conversations/${conversationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Message` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getMessage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getMessage` Business API is designed to handle a `get` operation on the `Message` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Fetch a specific message if the requesting user is a participant in the conversation. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `message-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getMessage` Business API includes a REST controller that can be triggered via the following route: `/v1/messages/:messageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getMessage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getMessage` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `messageId` | `ID` | `Yes` | `-` | `urlpath` | `messageId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getMessage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.messageId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getMessage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/messages/:messageId** ```js axios({ method: 'GET', url: `/v1/messages/${messageId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Conversations` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listConversations` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listConversations` Business API is designed to handle a `list` operation on the `Conversation` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List all conversations for the session user (where session userId in participantIds). Shows recent first (lastMessageAt desc). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `conversations-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listConversations` Business API includes a REST controller that can be triggered via the following route: `/v1/conversations` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listConversations` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listConversations` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listConversations` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listConversations` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/conversations** ```js axios({ method: 'GET', url: '/v1/conversations', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversations`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversations", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "conversations": [ { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Messages` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listMessages` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listMessages` Business API is designed to handle a `list` operation on the `Message` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List messages in a conversation, ordered by sentAt ascending. Only participants can view. Support filters such as min/max sentAt, unreadBy, etc. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `messages-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listMessages` Business API includes a REST controller that can be triggered via the following route: `/v1/messages` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listMessages` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listMessages` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listMessages` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listMessages` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/messages** ```js axios({ method: 'GET', url: '/v1/messages', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`messages`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "messages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "messages": [ { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Update Conversation` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateConversation` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateConversation` Business API is designed to handle a `update` operation on the `Conversation` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update conversation (e.g., participants, group flag). Only group conversations can be updated. Only current participants can update. For group: can add/remove participants; 1:1 conversations can't change participantIds or isGroup. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `conversation-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateConversation` Business API includes a REST controller that can be triggered via the following route: `/v1/conversations/:conversationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateConversation` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateConversation` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `conversationId` | `ID` | `Yes` | `-` | `urlpath` | `conversationId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `isGroup` | `Boolean` | `No` | `-` | `body` | `isGroup` | | **Description:** | True for group; false for one-to-one conversation (default false). | | | | | | | | | | | | | `participantIds` | `ID` | `No` | `-` | `body` | `participantIds` | | **Description:** | Array of user IDs (auth:user) participating in the conversation (min 2). | | | | | | | | | | | | | `lastMessageAt` | `Date` | `No` | `-` | `body` | `lastMessageAt` | | **Description:** | Timestamp of most recent message sent in this conversation. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateConversation` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.conversationId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { isGroup: this.isGroup, participantIds: this.participantIds ? this.participantIds : ( this.participantIds_remove ? sequelize.fn('array_remove', sequelize.col('participantIds'), this.participantIds_remove) : (this.participantIds_append ? sequelize.fn('array_append', sequelize.col('participantIds'), this.participantIds_append) : undefined)) , lastMessageAt: this.lastMessageAt, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateConversation` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | conversationId | ID | true | request.params?.conversationId | | isGroup | Boolean | false | request.body?.isGroup | | participantIds | ID | false | request.body?.participantIds | | lastMessageAt | Date | false | request.body?.lastMessageAt | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/conversations/:conversationId** ```js axios({ method: 'PATCH', url: `/v1/conversations/${conversationId}`, data: { isGroup:"Boolean", participantIds:"ID", lastMessageAt:"Date", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`conversation`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "conversation", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "conversation": { "id": "ID", "isGroup": "Boolean", "participantIds": "ID", "lastMessageAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Message` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateMessage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateMessage` Business API is designed to handle a `update` operation on the `Message` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Update content of a message or update readBy/deletedFor. Only sender may update content. Any participant can update their readBy/deletedFor entries. Content updates forbidden except for sender. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `message-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateMessage` Business API includes a REST controller that can be triggered via the following route: `/v1/messages/:messageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateMessage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateMessage` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `messageId` | `ID` | `Yes` | `-` | `urlpath` | `messageId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `content` | `Text` | `No` | `-` | `body` | `content` | | **Description:** | Raw message body/content. | | | | | | | | | | | | | `deletedFor` | `ID` | `No` | `-` | `body` | `deletedFor` | | **Description:** | Array of userIds who have deleted/hid this message (soft/hide). | | | | | | | | | | | | | `readBy` | `ID` | `No` | `-` | `body` | `readBy` | | **Description:** | Array of userIds who have read this message. Used for read receipts. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateMessage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.messageId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { content: this.content, deletedFor: this.deletedFor ? this.deletedFor : ( this.deletedFor_remove ? sequelize.fn('array_remove', sequelize.col('deletedFor'), this.deletedFor_remove) : (this.deletedFor_append ? sequelize.fn('array_append', sequelize.col('deletedFor'), this.deletedFor_append) : undefined)) , readBy: this.readBy ? this.readBy : ( this.readBy_remove ? sequelize.fn('array_remove', sequelize.col('readBy'), this.readBy_remove) : (this.readBy_append ? sequelize.fn('array_append', sequelize.col('readBy'), this.readBy_append) : undefined)) , } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateMessage` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | messageId | ID | true | request.params?.messageId | | content | Text | false | request.body?.content | | deletedFor | ID | false | request.body?.deletedFor | | readBy | ID | false | request.body?.readBy | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/messages/:messageId** ```js axios({ method: 'PATCH', url: `/v1/messages/${messageId}`, data: { content:"Text", deletedFor:"ID", readBy:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`message`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "message", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "message": { "id": "ID", "content": "Text", "senderUserId": "ID", "deletedFor": "ID", "readBy": "ID", "conversationId": "ID", "sentAt": "Date", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Connection` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createConnection` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createConnection` Business API is designed to handle a `create` operation on the `Connection` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Create Connection ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connection-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createConnection` Business API includes a REST controller that can be triggered via the following route: `/v1/connections` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createConnection` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createConnection` Business API has 4 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionId` | `ID` | `No` | `-` | `body` | `connectionId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `connectedSince` | `Date` | `Yes` | `-` | `body` | `connectedSince` | | **Description:** | Timestamp when connection was established. | | | | | | | | | | | | | `userId1` | `ID` | `Yes` | `-` | `body` | `userId1` | | **Description:** | FK to auth:user.id. First user of the connection. Value must be lower of both user IDs lexically to ensure uniqueness regardless of order. | | | | | | | | | | | | | `userId2` | `ID` | `Yes` | `-` | `body` | `userId2` | | **Description:** | FK to auth:user.id. Second user of the connection. Value must be higher of both user IDs lexically. Together with userId1 ensures uniqueness of unordered pair. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createConnection` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.connectionId, connectedSince: this.connectedSince, userId1: this.userId1, userId2: this.userId2, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createConnection` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId1 | ID | true | request.body?.userId1 | | userId2 | ID | true | request.body?.userId2 | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/connections** ```js axios({ method: 'POST', url: '/v1/connections', data: { userId1:"ID", userId2:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Connectionrequest` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createConnectionRequest` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createConnectionRequest` Business API is designed to handle a `create` operation on the `ConnectionRequest` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Send a new connection request from logged-in user to another user. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connectionrequest-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createConnectionRequest` Business API includes a REST controller that can be triggered via the following route: `/v1/connectionrequests` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createConnectionRequest` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createConnectionRequest` Business API has 7 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionRequestId` | `ID` | `No` | `-` | `body` | `connectionRequestId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `receiverUserId` | `ID` | `Yes` | `-` | `body` | `receiverUserId` | | **Description:** | FK to auth:user.id — target of the request. | | | | | | | | | | | | | `senderUserId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | FK to auth:user.id — user sending the connection request. | | | | | | | | | | | | | `sentAt` | `Date` | `Yes` | `-` | `body` | `sentAt` | | **Description:** | Timestamp when request was sent. | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | Request status: pending/accepted/rejected. | | | | | | | | | | | | | `respondedAt` | `Date` | `No` | `-` | `body` | `respondedAt` | | **Description:** | Timestamp when receiver accepted/rejected. | | | | | | | | | | | | | `message` | `String` | `No` | `-` | `body` | `message` | | **Description:** | Optional introductory message from sender to receiver. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createConnectionRequest` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.connectionRequestId, receiverUserId: this.receiverUserId, senderUserId: this.senderUserId, sentAt: this.sentAt, status: this.status, respondedAt: this.respondedAt, message: this.message, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createConnectionRequest` api has got 4 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | receiverUserId | ID | true | request.body?.receiverUserId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | | message | String | false | request.body?.message | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/connectionrequests** ```js axios({ method: 'POST', url: '/v1/connectionrequests', data: { receiverUserId:"ID", status:"Enum", respondedAt:"Date", message:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Connection` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteConnection` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteConnection` Business API is designed to handle a `delete` operation on the `Connection` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Break (delete) the connection between two users. Either user may disconnect. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connection-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteConnection` Business API includes a REST controller that can be triggered via the following route: `/v1/connections/:connectionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteConnection` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteConnection` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionId` | `ID` | `Yes` | `-` | `urlpath` | `connectionId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteConnection` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.connectionId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteConnection` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/connections/:connectionId** ```js axios({ method: 'DELETE', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Connectionrequest` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteConnectionRequest` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteConnectionRequest` Business API is designed to handle a `delete` operation on the `ConnectionRequest` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Sender or receiver may cancel/delete a connection request (soft-delete). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connectionrequest-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteConnectionRequest` Business API includes a REST controller that can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteConnectionRequest` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteConnectionRequest` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionRequestId` | `ID` | `Yes` | `-` | `urlpath` | `connectionRequestId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteConnectionRequest` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.connectionRequestId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteConnectionRequest` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'DELETE', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Connection` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getConnection` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getConnection` Business API is designed to handle a `get` operation on the `Connection` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get connection between session user and another user (if exists, not soft-deleted). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connection-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getConnection` Business API includes a REST controller that can be triggered via the following route: `/v1/connections/:connectionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getConnection` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getConnection` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionId` | `ID` | `Yes` | `-` | `urlpath` | `connectionId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getConnection` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.connectionId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getConnection` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionId | ID | true | request.params?.connectionId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/connections/:connectionId** ```js axios({ method: 'GET', url: `/v1/connections/${connectionId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connection`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connection", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connection": { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Connectionrequest` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getConnectionRequest` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getConnectionRequest` Business API is designed to handle a `get` operation on the `ConnectionRequest` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Get a specific connection request by ID if sender/receiver. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connectionrequest-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getConnectionRequest` Business API includes a REST controller that can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getConnectionRequest` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getConnectionRequest` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionRequestId` | `ID` | `Yes` | `-` | `urlpath` | `connectionRequestId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getConnectionRequest` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.connectionRequestId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getConnectionRequest` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'GET', url: `/v1/connectionrequests/${connectionRequestId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Connectionrequests` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listConnectionRequests` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listConnectionRequests` Business API is designed to handle a `list` operation on the `ConnectionRequest` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List connection requests involving current user, filterable by status (pending, accepted, rejected). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connectionrequests-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listConnectionRequests` Business API includes a REST controller that can be triggered via the following route: `/v1/connectionrequests` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listConnectionRequests` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listConnectionRequests` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listConnectionRequests` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listConnectionRequests` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/connectionrequests** ```js axios({ method: 'GET', url: '/v1/connectionrequests', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequests`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequests", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connectionRequests": [ { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Connections` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listConnections` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listConnections` Business API is designed to handle a `list` operation on the `Connection` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description List all active connections where session user is a participant. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connections-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listConnections` Business API includes a REST controller that can be triggered via the following route: `/v1/connections` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listConnections` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listConnections` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listConnections` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listConnections` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/connections** ```js axios({ method: 'GET', url: '/v1/connections', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connections`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connections", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "connections": [ { "id": "ID", "connectedSince": "Date", "userId1": "ID", "userId2": "ID", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Update Connectionrequest` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateConnectionRequest` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateConnectionRequest` Business API is designed to handle a `update` operation on the `ConnectionRequest` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Allows receiver of a pending connection request to accept or reject request. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `connectionrequest-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateConnectionRequest` Business API includes a REST controller that can be triggered via the following route: `/v1/connectionrequests/:connectionRequestId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateConnectionRequest` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateConnectionRequest` Business API has 3 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `connectionRequestId` | `ID` | `Yes` | `-` | `urlpath` | `connectionRequestId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `status` | `Enum` | `Yes` | `-` | `body` | `status` | | **Description:** | Request status: pending/accepted/rejected. | | | | | | | | | | | | | `respondedAt` | `Date` | `No` | `-` | `body` | `respondedAt` | | **Description:** | Timestamp when receiver accepted/rejected. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateConnectionRequest` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.connectionRequestId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { status: this.status, respondedAt: this.respondedAt, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateConnectionRequest` api has got 3 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | connectionRequestId | ID | true | request.params?.connectionRequestId | | status | Enum | true | request.body?.status | | respondedAt | Date | false | request.body?.respondedAt | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/connectionrequests/:connectionRequestId** ```js axios({ method: 'PATCH', url: `/v1/connectionrequests/${connectionRequestId}`, data: { status:"Enum", respondedAt:"Date", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`connectionRequest`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "connectionRequest", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "connectionRequest": { "id": "ID", "receiverUserId": "ID", "senderUserId": "ID", "sentAt": "Date", "status": "Enum", "status_idx": "Integer", "respondedAt": "Date", "message": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Callback Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `callbackPremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `callbackPremiumsubscriptionPayment` Business API is designed to handle a `update` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Refresh payment values by gateway webhook call for premiumsubscription ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-calledback` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `callbackPremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/callbackpremiumsubscriptionpayment` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `callbackPremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `callbackPremiumsubscriptionPayment` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `body` | `premiumsubscriptionId` | | **Description:** | The order id parameter that will be read from webhook callback params | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. * `premiumsubscriptionId`: ```javascript this.premiumsubscriptionId = this.paymentCallbackParams?.orderId ``` ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `callbackPremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API is **public** and can be accessed without login (`loginRequired = false`). --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { status: this.status, updatedAt: new Date(), _paymentConfirmation: this._paymentConfirmation, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { status: this.status, updatedAt: new Date(), // _paymentConfirmation parameter is closed to update by client request // include it in data clause unless you are sure _paymentConfirmation: this._paymentConfirmation, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Action : verifyPaymentWebhook **Action Type**: `VerifyWebhookAction` Verify a providers webhook call with the secret signature and read the params, write the callback parameters to the context. Only stripe webhooks is supported for now. ```js class Api { // Code for VerifyWebhookAction async verifyPaymentWebhook() { const secretKey = null; const stripeGateway = this.checkoutManager.paymentGate; const result = await stripeGateway.webhookController(this.request); if (result.statusLiteral == "unhandled") { throw new BadRequestError( `Unhandled stripe webhook event [${result.eventType}]`, ); } return result; } } ``` --- ### [4] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [5] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [6] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [7] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [8] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [9] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [10] Action : doPaymentCallback **Action Type**: `CheckoutAction` Refresh payment by Stripe platform webhook, the payment operation data in the gateway server will be given by webhook call and the application payment tickets and order status will be refreshed according to the server. ```js class Api { getOrderId() { return this.premiumsubscriptionId; } getPaymentStatusTopic(actionType) { switch (actionType) { case "started": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-started"; case "updated": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-updated"; case "succeeded": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-succeeded"; case "failed": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-failed"; } } async checkoutUpdated(statusLiteral) { switch (statusLiteral) { case "started": await this.checkoutStarted(); break; case "canceled": await this.checkoutCanceled(); break; case "failed": await this.checkoutFailed(); break; case "success": await this.checkoutDone(); break; default: await this.checkoutFailed(); break; } } async checkoutStarted() { this.status = "pending"; this._paymentConfirmation = "processing"; this.raisePaymentStatusEvent("started"); } async checkoutCanceled() { this.status = "cancelled"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutFailed() { this.status = "declined"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutDone() { this.status = "completed"; this._paymentConfirmation = "paid"; this.raisePaymentStatusEvent("succeeded"); } getCheckoutParameters(userParams) { const description = `Making subscription for this userId: ${this.premiumsubscription.userId} with profileId: ${this.premiumsubscription.profileId}`; return { userId: this.session._USERID, fullname: this.session.fullname, email: this.session.email, description, amount: this.premiumsubscription.price, currency: this.premiumsubscription.currency, orderId: this.premiumsubscription.id, metadata: { order: "Profile-Premiumsubscription-order", orderId: this.premiumsubscription.id, checkoutName: "premiumsubscription", }, storeCard: userParams?.storeCard, paymentUserParams: userParams, bodyParams: this.bodyParams, }; } async doPaymentCallback() { // Handle Checkout Action try { if (!this.checkoutManager) { throw new Error( "This dboject is not an order object. So auto-checkout process can not be started.", ); } this.paymentResult = await this.checkoutManager.processCheckoutCallbackResult( this.paymentCallbackParams, ); } catch (err) { if (err instanceof PaymentGateError) { this.paymentResult = err.serializeError(); //**errorLog } else throw err; } return this.paymentResult; } } ``` --- ### [11] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [12] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [13] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [14] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [15] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `callbackPremiumsubscriptionPayment` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.body?.premiumsubscriptionId | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/callbackpremiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/callbackpremiumsubscriptionpayment', data: { premiumsubscriptionId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` # Business API Design Specification - `Create Certification` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createCertification` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createCertification` Business API is designed to handle a `create` operation on the `Certification` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Add a new certification for user profiles. Must be unique by name. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `certification-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createCertification` Business API includes a REST controller that can be triggered via the following route: `/v1/certifications` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createCertification` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createCertification` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `certificationId` | `ID` | `No` | `-` | `body` | `certificationId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `name` | `String` | `Yes` | `-` | `body` | `name` | | **Description:** | Unique certification name (e.g. PMP, CFA, AWS Certified). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createCertification` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.certificationId, name: this.name, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createCertification` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/certifications** ```js axios({ method: 'POST', url: '/v1/certifications', data: { name:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Language` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createLanguage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createLanguage` Business API is designed to handle a `create` operation on the `Language` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Add a new language to the dictionary for user profiles. Must be unique by name. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `language-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createLanguage` Business API includes a REST controller that can be triggered via the following route: `/v1/languages` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createLanguage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createLanguage` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `languageId` | `ID` | `No` | `-` | `body` | `languageId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `name` | `String` | `Yes` | `-` | `body` | `name` | | **Description:** | Unique language name (e.g. English, Spanish). | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createLanguage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.languageId, name: this.name, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createLanguage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | name | String | true | request.body?.name | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/languages** ```js axios({ method: 'POST', url: '/v1/languages', data: { name:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createPremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createPremiumsubscriptionPayment` Business API is designed to handle a `create` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to create a new payment. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createPremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpayment` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createPremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createPremiumsubscriptionPayment` Business API has 7 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `No` | `-` | `body` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `ownerId` | `ID` | `No` | `-` | `session` | `userId` | | **Description:** | An ID value to represent owner user who created the order | | | | | | | | | | | | | `orderId` | `ID` | `Yes` | `-` | `body` | `orderId` | | **Description:** | an ID value to represent the orderId which is the ID parameter of the source premiumsubscription object | | | | | | | | | | | | | `paymentId` | `String` | `Yes` | `-` | `body` | `paymentId` | | **Description:** | A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type | | | | | | | | | | | | | `paymentStatus` | `String` | `Yes` | `-` | `body` | `paymentStatus` | | **Description:** | A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. | | | | | | | | | | | | | `statusLiteral` | `String` | `Yes` | `-` | `body` | `statusLiteral` | | **Description:** | A string value to represent the logical payment status which belongs to the application lifecycle itself. | | | | | | | | | | | | | `redirectUrl` | `String` | `No` | `-` | `body` | `redirectUrl` | | **Description:** | A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createPremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.sys_premiumsubscriptionPaymentId, ownerId: this.ownerId, orderId: this.orderId, paymentId: this.paymentId, paymentStatus: this.paymentStatus, statusLiteral: this.statusLiteral, redirectUrl: this.redirectUrl, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createPremiumsubscriptionPayment` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | orderId | ID | true | request.body?.orderId | | paymentId | String | true | request.body?.paymentId | | paymentStatus | String | true | request.body?.paymentStatus | | statusLiteral | String | true | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/premiumsubscriptionpayment** ```js axios({ method: 'POST', url: '/v1/premiumsubscriptionpayment', data: { orderId:"ID", paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Premuimsub` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createPremuimSub` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createPremuimSub` Business API is designed to handle a `create` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premuimsub-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createPremuimSub` Business API includes a REST controller that can be triggered via the following route: `/v1/premuimsub` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createPremuimSub` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createPremuimSub` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `No` | `-` | `body` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `profileId` | `ID` | `Yes` | `-` | `body` | `profileId` | | **Description:** | the profile id of the subscription | | | | | | | | | | | | | `currency` | `String` | `Yes` | `-` | `body` | `currency` | | **Description:** | currency | | | | | | | | | | | | | `status` | `String` | `Yes` | `-` | `body` | `status` | | **Description:** | - | | | | | | | | | | | | | `price` | `Double` | `Yes` | `-` | `body` | `price` | | **Description:** | the price of the subscription | | | | | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `body` | `userId` | | **Description:** | the userid of the subscription | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createPremuimSub` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.premiumsubscriptionId, profileId: this.profileId, currency: this.currency, status: this.status, price: this.price, userId: this.userId, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createPremuimSub` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.body?.profileId | | currency | String | true | request.body?.currency | | status | String | true | request.body?.status | | price | Double | true | request.body?.price | | userId | ID | true | request.body?.userId | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/premuimsub** ```js axios({ method: 'POST', url: '/v1/premuimsub', data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Create Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `createProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `createProfile` Business API is designed to handle a `create` operation on the `Profile` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Creates a new professional profile for the authenticated user. Each user can create only one profile. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-created` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `createProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/profiles` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `createProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `createProfile` Business API has 15 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `profileId` | `ID` | `No` | `-` | `body` | `profileId` | | **Description:** | This id paremeter is used to create the data object with a given specific id. Leave null for automatic id. | | | | | | | | | | | | | `summary` | `Text` | `No` | `-` | `body` | `summary` | | **Description:** | Profile summary (bio/description). | | | | | | | | | | | | | `headline` | `String` | `No` | `-` | `body` | `headline` | | **Description:** | Short tagline or headline for profile. | | | | | | | | | | | | | `profilePhotoUrl` | `String` | `No` | `-` | `body` | `profilePhotoUrl` | | **Description:** | URL for profile photo/avatar. | | | | | | | | | | | | | `userId` | `ID` | `Yes` | `-` | `session` | `userId` | | **Description:** | Foreign key to auth:user. Owner of the profile. Single profile per user. | | | | | | | | | | | | | `fullName` | `String` | `Yes` | `-` | `body` | `fullName` | | **Description:** | Full name for display/search. | | | | | | | | | | | | | `currentCompany` | `String` | `No` | `-` | `body` | `currentCompany` | | **Description:** | Current employer/company, free text for now. | | | | | | | | | | | | | `industry` | `String` | `No` | `-` | `body` | `industry` | | **Description:** | Industry sector name for profile. | | | | | | | | | | | | | `languages` | `String` | `No` | `-` | `body` | `languages` | | **Description:** | Array of language names as string, links to language object (lookup/filter only). | | | | | | | | | | | | | `skills` | `String` | `No` | `-` | `body` | `skills` | | **Description:** | List of professional skills (free-form tags). | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Location information (city, country, etc.) | | | | | | | | | | | | | `experience` | `Object` | `No` | `-` | `body` | `experience` | | **Description:** | Array of experienceItem objects (job history). | | | | | | | | | | | | | `profileVisibility` | `Enum` | `Yes` | `-` | `body` | `profileVisibility` | | **Description:** | Controls who can view profile: public or private. Used in search/list visibility. | | | | | | | | | | | | | `education` | `Object` | `No` | `-` | `body` | `education` | | **Description:** | Array of educationItem objects (degrees/certificates). | | | | | | | | | | | | | `certifications` | `String` | `No` | `-` | `body` | `certifications` | | **Description:** | Professional certifications by name, links to certification object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `createProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { id: this.profileId, summary: this.summary, headline: this.headline, profilePhotoUrl: this.profilePhotoUrl, userId: this.userId, fullName: this.fullName, currentCompany: this.currentCompany, industry: this.industry, languages: this.languages, skills: this.skills, location: this.location, experience: this.experience ? (typeof this.experience == 'string' ? JSON.parse(this.experience) : this.experience) : null, profileVisibility: this.profileVisibility, education: this.education ? (typeof this.education == 'string' ? JSON.parse(this.education) : this.education) : null, certifications: this.certifications, isActive: true, _archivedAt: null, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, populates session and request objects, prepares internal structures for parameter handling and workflow execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads input parameters, normalizes missing values, applies default type casting, and stores them in the API context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager transforms parameters, computes derived values, flattens or remaps arrays/objects, and adjusts formats for downstream processing. --- ### [4] Step : checkParameters Manager executes built-in validations: required field checks, type enforcement, and basic business rules. Prevents operation if validation fails. --- ### [5] Step : checkBasicAuth Manager performs authentication and authorization checks: verifies session, user roles, permissions, and tenant restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildDataClause Manager constructs the final data object for creation, fills auto-generated fields (IDs, timestamps, owner fields), and ensures schema consistency. You can use the following settings to change some behavior of this step. `dataClause` --- ### [7] Step : mainCreateOperation Manager executes the database insert operation, updates indexes/caches, and triggers internal post-processing like linked default records. --- ### [8] Step : buildOutput Manager shapes the response: masks sensitive fields, resolves linked references, and formats output according to API contract. --- ### [9] Step : sendResponse Manager sends the response to the client and finalizes internal tasks like flushing logs or updating session state. --- ### [10] Step : raiseApiEvent Manager triggers API-level events (Kafka, WebSocket, async workflows) as the final internal step. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `createProfile` api has got 13 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | true | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | ### REST Request To access the api you can use the **REST** controller with the path **POST /v1/profiles** ```js axios({ method: 'POST', url: '/v1/profiles', data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "201", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "POST", "action": "create", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Certification` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteCertification` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteCertification` Business API is designed to handle a `delete` operation on the `Certification` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Deletes a certification entry from the dictionary. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `certification-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteCertification` Business API includes a REST controller that can be triggered via the following route: `/v1/certifications/:certificationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteCertification` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteCertification` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `certificationId` | `ID` | `Yes` | `-` | `urlpath` | `certificationId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteCertification` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.certificationId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteCertification` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/certifications/:certificationId** ```js axios({ method: 'DELETE', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Language` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteLanguage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteLanguage` Business API is designed to handle a `delete` operation on the `Language` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Deletes a language entry from the dictionary. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `language-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteLanguage` Business API includes a REST controller that can be triggered via the following route: `/v1/languages/:languageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteLanguage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteLanguage` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `languageId` | `ID` | `Yes` | `-` | `urlpath` | `languageId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteLanguage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.languageId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteLanguage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/languages/:languageId** ```js axios({ method: 'DELETE', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deletePremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deletePremiumsubscriptionPayment` Business API is designed to handle a `delete` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to delete a payment. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deletePremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deletePremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deletePremiumsubscriptionPayment` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `Yes` | `-` | `urlpath` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deletePremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.sys_premiumsubscriptionPaymentId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deletePremiumsubscriptionPayment` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'DELETE', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Premuimsub` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deletePremuimSub` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deletePremuimSub` Business API is designed to handle a `delete` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premuimsub-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deletePremuimSub` Business API includes a REST controller that can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deletePremuimSub` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deletePremuimSub` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `urlpath` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deletePremuimSub` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deletePremuimSub` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'DELETE', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Delete Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `deleteProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `deleteProfile` Business API is designed to handle a `delete` operation on the `Profile` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Deletes the profile of the authenticated user (soft delete). ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-deleted` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `deleteProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/profiles/:profileId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `deleteProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `deleteProfile` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `profileId` | `ID` | `Yes` | `-` | `urlpath` | `profileId` | | **Description:** | This id paremeter is used to select the required data object that will be deleted | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `deleteProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.profileId},{isActive:true}]} ``` ## Delete Options Use these options to set `delete` specific settings. **useSoftDelete**: false If true, the record will be marked as deleted `(isActive: false)` instead of removed. The implementation depends on the data object’s soft delete configuration. ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request/session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads and normalizes parameters, applies defaults, and stores them in the context for downstream steps. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts, computes derived values, and remaps objects or arrays as needed for later processing. --- ### [4] Step : checkParameters Manager runs built-in validations including required field checks, type enforcement, and deletion preconditions. Stops execution if validation fails. --- ### [5] Step : checkBasicAuth Manager validates session, user roles, permissions, and tenant-specific access rules to enforce basic auth restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager generates the query conditions, applies ownership and parent checks, and ensures the clause is correct for the delete operation. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the target record, applies filters from WHERE clause, and writes the instance to the context for further checks. --- ### [8] Step : checkInstance Manager performs object-level validations such as lock status, soft-delete eligibility, and multi-step approval enforcement. --- ### [9] Step : mainDeleteOperation Manager executes the delete query, updates related indexes/caches, and handles soft/hard delete logic according to configuration. You can use the following settings to change some behavior of this step. `deleteOptions` --- ### [10] Step : buildOutput Manager shapes the response payload, masks sensitive fields, and formats related cleanup results for output. --- ### [11] Step : sendResponse Manager delivers the response to the client and finalizes any temporary internal structures. --- ### [12] Step : raiseApiEvent Manager triggers asynchronous API events, notifies queues or streams, and performs final cleanup for the workflow. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `deleteProfile` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | ### REST Request To access the api you can use the **REST** controller with the path **DELETE /v1/profiles/:profileId** ```js axios({ method: 'DELETE', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "DELETE", "action": "delete", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": false, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Certification` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getCertification` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getCertification` Business API is designed to handle a `get` operation on the `Certification` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Retrieves a certification entry by ID. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `certification-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getCertification` Business API includes a REST controller that can be triggered via the following route: `/v1/certifications/:certificationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getCertification` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getCertification` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `certificationId` | `ID` | `Yes` | `-` | `urlpath` | `certificationId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getCertification` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.certificationId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getCertification` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/certifications/:certificationId** ```js axios({ method: 'GET', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Language` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getLanguage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getLanguage` Business API is designed to handle a `get` operation on the `Language` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Retrieves a language entry by ID. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `language-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getLanguage` Business API includes a REST controller that can be triggered via the following route: `/v1/languages/:languageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getLanguage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getLanguage` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `languageId` | `ID` | `Yes` | `-` | `urlpath` | `languageId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getLanguage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.languageId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getLanguage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/languages/:languageId** ```js axios({ method: 'GET', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Paymentcustomerbyuserid` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPaymentCustomerByUserId` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPaymentCustomerByUserId` Business API is designed to handle a `get` operation on the `Sys_paymentCustomer` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to get the payment customer information by user id. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `paymentcustomerbyuserid-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPaymentCustomerByUserId` Business API includes a REST controller that can be triggered via the following route: `/v1/paymentcustomers/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPaymentCustomerByUserId` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPaymentCustomerByUserId` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_paymentCustomerId` | `ID` | `Yes` | `-` | `urlpath` | `sys_paymentCustomerId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | | `userId` | `String` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This parameter will be used to select the data object that is queried | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPaymentCustomerByUserId` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. The business api configuration has a `selectBy` setting: '['']` **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{userId:{"$eq":this.userId}},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPaymentCustomerByUserId` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_paymentCustomerId | ID | true | request.params?.sys_paymentCustomerId | | userId | String | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomers/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentCustomer`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomer", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_paymentCustomer": { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Premiumsubscriptionpayment2` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPremiumsubscriptionPayment2` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPremiumsubscriptionPayment2` Business API is designed to handle a `get` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to get the payment information by ID. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment2-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPremiumsubscriptionPayment2` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPremiumsubscriptionPayment2` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPremiumsubscriptionPayment2` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `Yes` | `-` | `urlpath` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPremiumsubscriptionPayment2` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.sys_premiumsubscriptionPaymentId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPremiumsubscriptionPayment2` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayment2/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpayment2/${sys_premiumsubscriptionPaymentId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Premiumsubscriptionpaymentbyorderid` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPremiumsubscriptionPaymentByOrderId` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPremiumsubscriptionPaymentByOrderId` Business API is designed to handle a `get` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to get the payment information by order id. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpaymentbyorderid-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPremiumsubscriptionPaymentByOrderId` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpaymentbyorderid/:orderId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPremiumsubscriptionPaymentByOrderId` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPremiumsubscriptionPaymentByOrderId` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `Yes` | `-` | `urlpath` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | | `orderId` | `String` | `Yes` | `-` | `urlpath` | `orderId` | | **Description:** | This parameter will be used to select the data object that is queried | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPremiumsubscriptionPaymentByOrderId` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. The business api configuration has a `selectBy` setting: '['']` **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{orderId:{"$eq":this.orderId}},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPremiumsubscriptionPaymentByOrderId` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | orderId | String | true | request.params?.orderId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbyorderid/:orderId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbyorderid/${orderId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Premiumsubscriptionpaymentbypaymentid` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPremiumsubscriptionPaymentByPaymentId` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPremiumsubscriptionPaymentByPaymentId` Business API is designed to handle a `get` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to get the payment information by payment id. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpaymentbypaymentid-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPremiumsubscriptionPaymentByPaymentId` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpaymentbypaymentid/:paymentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPremiumsubscriptionPaymentByPaymentId` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPremiumsubscriptionPaymentByPaymentId` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `Yes` | `-` | `urlpath` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | | `paymentId` | `String` | `Yes` | `-` | `urlpath` | `paymentId` | | **Description:** | This parameter will be used to select the data object that is queried | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPremiumsubscriptionPaymentByPaymentId` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. The business api configuration has a `selectBy` setting: '['']` **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{paymentId:{"$eq":this.paymentId}},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPremiumsubscriptionPaymentByPaymentId` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | true | request.params?.paymentId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpaymentbypaymentid/:paymentId** ```js axios({ method: 'GET', url: `/v1/premiumsubscriptionpaymentbypaymentid/${paymentId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Premuimsub` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getPremuimSub` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getPremuimSub` Business API is designed to handle a `get` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premuimsub-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getPremuimSub` Business API includes a REST controller that can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getPremuimSub` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getPremuimSub` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `urlpath` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getPremuimSub` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getPremuimSub` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'GET', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Get Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `getProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `getProfile` Business API is designed to handle a `get` operation on the `Profile` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Retrieves a user profile by ID. If private, only the owner can get; if public, anyone can view. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-retrived` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `getProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/profiles/:profileId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `getProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `getProfile` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `profileId` | `ID` | `Yes` | `-` | `urlpath` | `profileId` | | **Description:** | This id paremeter is used to query the required data object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `getProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.profileId},{isActive:true}]} ``` ## Get Options Use these options to set `get` specific settings. **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Extracts parameters from request and Redis, applies defaults, and writes them to context. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Executes parameter transformation scripts, applies type coercion, merges derived values, and reshapes inputs for downstream milestones. --- ### [4] Step : checkParameters Validates required and custom parameters, enforcing business-specific rules and constraints. --- ### [5] Step : checkBasicAuth Performs login, role, and permission checks, and applies dynamic object-level access rules. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Builds the WHERE clause for fetching the object and applies additional scoped filters if configured. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainGetOperation Executes the database fetch, retrieves the object, and stores it in context for enrichment or further checks. You can use the following settings to change some behavior of this step. `selectClause`, `getOptions` --- ### [8] Step : checkInstance Performs instance-level validations, such as ownership, existence, or access conditions. --- ### [9] Step : buildOutput Assembles the response from the object, applies masking, formatting, and injects additional metadata if needed. --- ### [10] Step : sendResponse Delivers the response to the controller for client delivery. --- ### [11] Step : raiseApiEvent Triggers optional API-level events after workflow completion, sending messages to integrations like Kafka if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `getProfile` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/profiles/:profileId** ```js axios({ method: 'GET', url: `/v1/profiles/${profileId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "GET", "action": "get", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `List Certifications` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listCertifications` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listCertifications` Business API is designed to handle a `list` operation on the `Certification` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Lists all available certifications for profile selection/display. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `certifications-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listCertifications` Business API includes a REST controller that can be triggered via the following route: `/v1/certifications` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listCertifications` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listCertifications` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listCertifications` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listCertifications` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/certifications** ```js axios({ method: 'GET', url: '/v1/certifications', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certifications`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certifications", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "certifications": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Languages` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listLanguages` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listLanguages` Business API is designed to handle a `list` operation on the `Language` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Lists all available languages for profile selection. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `languages-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listLanguages` Business API includes a REST controller that can be triggered via the following route: `/v1/languages` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listLanguages` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listLanguages` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listLanguages` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listLanguages` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/languages** ```js axios({ method: 'GET', url: '/v1/languages', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`languages`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "languages", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "languages": [ { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Paymentcustomermethods` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listPaymentCustomerMethods` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listPaymentCustomerMethods` Business API is designed to handle a `list` operation on the `Sys_paymentMethod` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to list all payment customer methods. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `paymentcustomermethods-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listPaymentCustomerMethods` Business API includes a REST controller that can be triggered via the following route: `/v1/paymentcustomermethods/:userId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listPaymentCustomerMethods` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listPaymentCustomerMethods` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `userId` | `String` | `Yes` | `-` | `urlpath` | `userId` | | **Description:** | This parameter will be used to select the data objects that want to be listed | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listPaymentCustomerMethods` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. The business api configuration has a `selectBy` setting: '['']` **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{userId:{"$eq":this.userId}},{isActive:true}]} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listPaymentCustomerMethods` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | userId | String | true | request.params?.userId | ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomermethods/:userId** ```js axios({ method: 'GET', url: `/v1/paymentcustomermethods/${userId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentMethods`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentMethods", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentMethods": [ { "id": "ID", "paymentMethodId": "String", "userId": "ID", "customerId": "String", "cardHolderName": "String", "cardHolderZip": "String", "platform": "String", "cardInfo": "Object", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Paymentcustomers` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listPaymentCustomers` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listPaymentCustomers` Business API is designed to handle a `list` operation on the `Sys_paymentCustomer` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to list all payment customers. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `paymentcustomers-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listPaymentCustomers` Business API includes a REST controller that can be triggered via the following route: `/v1/paymentcustomers` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listPaymentCustomers` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listPaymentCustomers` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listPaymentCustomers` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listPaymentCustomers` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/paymentcustomers** ```js axios({ method: 'GET', url: '/v1/paymentcustomers', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_paymentCustomers`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_paymentCustomers", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_paymentCustomers": [ { "id": "ID", "userId": "ID", "customerId": "String", "platform": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Premiumsubscriptionpayments2` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listPremiumsubscriptionPayments2` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listPremiumsubscriptionPayments2` Business API is designed to handle a `list` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to list all payments. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayments2-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listPremiumsubscriptionPayments2` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpayments2` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listPremiumsubscriptionPayments2` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listPremiumsubscriptionPayments2` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listPremiumsubscriptionPayments2` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listPremiumsubscriptionPayments2` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premiumsubscriptionpayments2** ```js axios({ method: 'GET', url: '/v1/premiumsubscriptionpayments2', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayments`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayments", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "sys_premiumsubscriptionPayments": [ { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Premuimsub` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listPremuimSub` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listPremuimSub` Business API is designed to handle a `list` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premuimsub-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listPremuimSub` Business API includes a REST controller that can be triggered via the following route: `/v1/premuimsub` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listPremuimSub` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listPremuimSub` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listPremuimSub` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listPremuimSub` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/premuimsub** ```js axios({ method: 'GET', url: '/v1/premuimsub', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscriptions`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscriptions", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "premiumsubscriptions": [ { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `List Profiles` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `listProfiles` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `listProfiles` Business API is designed to handle a `list` operation on the `Profile` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Lists profiles by search/filter. Only public profiles are listed, unless the current user is the owner. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profiles-listed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `listProfiles` Business API includes a REST controller that can be triggered via the following route: `/v1/profiles` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `listProfiles` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `listProfiles` Business API does not require any parameters to be provided from the controllers. ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `listProfiles` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Select Clause Specifies which fields will be selected from the main data object during a `get` or `list` operation. Leave blank to select all properties. This applies only to `get` and `list` type APIs.", `` ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {isActive:true} ``` ## List Options Defines list-specific options including filtering logic, default sorting, and result customization for APIs that return multiple records. **List Sort By** Sort order definitions for the result set. Multiple fields can be provided with direction (asc/desc). Specific sort order is not configure, natural order (ascending id) will be used. **List Group By** Grouping definitions for the result set. This is typically used for visual or report-based grouping. *The list is not grouped.* **setAsRead**: An optional array of field-value mappings that will be updated after the read operation. Useful for marking items as read or viewed. No `setAsread` field-value pair is configured. **Permission Filter** Optional filter that applies permission constraints dynamically based on session or object roles. So that the list items are filtered by the user's OBAC or ABAC permissions. *Permission filter is not active at the moment. Follow Mindbricks updates to be able to use it.* ## Pagination Options Contains settings to configure pagination behavior for `list` APIs. Includes options like page size, offset, cursor support, and total count inclusion. ## Business Logic Workflow ### [1] Step : startBusinessApi Initializes context with request and session objects. Prepares internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Reads request and Redis parameters, applies defaults, and writes them to context for downstream processing. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Transforms and normalizes parameters, derives dependent values, and reshapes inputs for the main list query. --- ### [4] Step : checkParameters Executes validation logic on required and custom parameters, enforcing business rules and cross-field consistency. --- ### [5] Step : checkBasicAuth Performs role-based access checks and applies dynamic membership or session-based restrictions. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Constructs the main query WHERE clause and applies optional filters or scoped access controls. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : mainListOperation Executes the paginated database query, retrieves the list, and stores results in context for enrichment. You can use the following settings to change some behavior of this step. `selectClause`, `listOptions`, `paginationOptions` --- ### [8] Step : buildOutput Assembles the list response, sanitizes sensitive fields, applies transformations, and injects extra context if needed. --- ### [9] Step : sendResponse Sends the paginated list to the client through the controller. --- ### [10] Step : raiseApiEvent Triggers optional post-workflow events, such as Kafka messages, logs, or system notifications. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `listProfiles` api has got no visible parameters. ### REST Request To access the api you can use the **REST** controller with the path **GET /v1/profiles** ```js axios({ method: 'GET', url: '/v1/profiles', data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profiles`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profiles", "method": "GET", "action": "list", "appVersion": "Version", "rowCount": "\"Number\"", "profiles": [ { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, {}, {} ], "paging": { "pageNumber": "Number", "pageRowCount": "NUmber", "totalRowCount": "Number", "pageCount": "Number" }, "filters": [], "uiPermissions": [] } ``` # Business API Design Specification - `Refresh Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `refreshPremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `refreshPremiumsubscriptionPayment` Business API is designed to handle a `update` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Refresh payment info for premiumsubscription from Stripe ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-refreshed` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `refreshPremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `refreshPremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `refreshPremiumsubscriptionPayment` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `urlpath` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `paymentUserParams` | `Object` | `No` | `-` | `body` | `paymentUserParams` | | **Description:** | The user parameters that should be defined to refresh a stripe payment process | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `refreshPremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { status: this.status, updatedAt: new Date(), _paymentConfirmation: this._paymentConfirmation, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { status: this.status, updatedAt: new Date(), // _paymentConfirmation parameter is closed to update by client request // include it in data clause unless you are sure _paymentConfirmation: this._paymentConfirmation, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Action : doRefreshPayment **Action Type**: `CheckoutAction` Refresh payment from Stripe platform, the payment operation data in the gateway server will be fetched and the application payment tickets and order status will be refreshed according to the server. This api may be used if you dont want to use a webhook. ```js class Api { getOrderId() { return this.premiumsubscriptionId; } getPaymentStatusTopic(actionType) { switch (actionType) { case "started": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-started"; case "updated": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-updated"; case "succeeded": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-succeeded"; case "failed": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-failed"; } } async checkoutUpdated(statusLiteral) { switch (statusLiteral) { case "started": await this.checkoutStarted(); break; case "canceled": await this.checkoutCanceled(); break; case "failed": await this.checkoutFailed(); break; case "success": await this.checkoutDone(); break; default: await this.checkoutFailed(); break; } } async checkoutStarted() { this.status = "pending"; this._paymentConfirmation = "processing"; this.raisePaymentStatusEvent("started"); } async checkoutCanceled() { this.status = "cancelled"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutFailed() { this.status = "declined"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutDone() { this.status = "completed"; this._paymentConfirmation = "paid"; this.raisePaymentStatusEvent("succeeded"); } getCheckoutParameters(userParams) { const description = `Making subscription for this userId: ${this.premiumsubscription.userId} with profileId: ${this.premiumsubscription.profileId}`; return { userId: this.session._USERID, fullname: this.session.fullname, email: this.session.email, description, amount: this.premiumsubscription.price, currency: this.premiumsubscription.currency, orderId: this.premiumsubscription.id, metadata: { order: "Profile-Premiumsubscription-order", orderId: this.premiumsubscription.id, checkoutName: "premiumsubscription", }, storeCard: userParams?.storeCard, paymentUserParams: userParams, bodyParams: this.bodyParams, }; } async doRefreshPayment() { // Handle Checkout Action try { if (!this.checkoutManager) { throw new Error( "This dboject is not an order object. So auto-checkout process can not be started.", ); } this.paymentResult = await this.checkoutManager.refreshCheckout( this.paymentUserParams, ); } catch (err) { if (err instanceof PaymentGateError) { this.paymentResult = err.serializeError(); //**errorLog } else throw err; } return this.paymentResult; } } ``` --- ### [10] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [11] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [12] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [13] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [14] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `refreshPremiumsubscriptionPayment` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/refreshpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/refreshpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` # Business API Design Specification - `Start Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `startPremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `startPremiumsubscriptionPayment` Business API is designed to handle a `update` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Start payment for premiumsubscription ## API Options * **Auto Params** : `false` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-started` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `startPremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/startpremiumsubscriptionpayment/:premiumsubscriptionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `startPremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `startPremiumsubscriptionPayment` Business API has 2 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `urlpath` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `paymentUserParams` | `Object` | `No` | `-` | `body` | `paymentUserParams` | | **Description:** | The user parameters that should be defined to start a stripe payment process | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `startPremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** ```js { status: this.status, updatedAt: new Date(), _paymentConfirmation: this._paymentConfirmation, } ``` **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { status: this.status, updatedAt: new Date(), // _paymentConfirmation parameter is closed to update by client request // include it in data clause unless you are sure _paymentConfirmation: this._paymentConfirmation, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Action : doStartPayment **Action Type**: `CheckoutAction` Start a payment on Stripe platform ```js class Api { getOrderId() { return this.premiumsubscriptionId; } getPaymentStatusTopic(actionType) { switch (actionType) { case "started": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-started"; case "updated": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-updated"; case "succeeded": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-succeeded"; case "failed": return "linkedin-profile-service-premiumsubscriptionpaymentstatus-failed"; } } async checkoutUpdated(statusLiteral) { switch (statusLiteral) { case "started": await this.checkoutStarted(); break; case "canceled": await this.checkoutCanceled(); break; case "failed": await this.checkoutFailed(); break; case "success": await this.checkoutDone(); break; default: await this.checkoutFailed(); break; } } async checkoutStarted() { this.status = "pending"; this._paymentConfirmation = "processing"; this.raisePaymentStatusEvent("started"); } async checkoutCanceled() { this.status = "cancelled"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutFailed() { this.status = "declined"; this._paymentConfirmation = "canceled"; this.raisePaymentStatusEvent("failed"); } async checkoutDone() { this.status = "completed"; this._paymentConfirmation = "paid"; this.raisePaymentStatusEvent("succeeded"); } getCheckoutParameters(userParams) { const description = `Making subscription for this userId: ${this.premiumsubscription.userId} with profileId: ${this.premiumsubscription.profileId}`; return { userId: this.session._USERID, fullname: this.session.fullname, email: this.session.email, description, amount: this.premiumsubscription.price, currency: this.premiumsubscription.currency, orderId: this.premiumsubscription.id, metadata: { order: "Profile-Premiumsubscription-order", orderId: this.premiumsubscription.id, checkoutName: "premiumsubscription", }, storeCard: userParams?.storeCard, paymentUserParams: userParams, bodyParams: this.bodyParams, }; } async doStartPayment() { // Handle Checkout Action try { if (!this.checkoutManager) { throw new Error( "This dboject is not an order object. So auto-checkout process can not be started.", ); } this.paymentResult = await this.checkoutManager.startCheckout( this.paymentUserParams, ); } catch (err) { if (err instanceof PaymentGateError) { this.paymentResult = err.serializeError(); //**errorLog } else throw err; } return this.paymentResult; } } ``` --- ### [10] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [11] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [12] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [13] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [14] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `startPremiumsubscriptionPayment` api has got 2 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | paymentUserParams | Object | false | request.body?.paymentUserParams | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/startpremiumsubscriptionpayment/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/startpremiumsubscriptionpayment/${premiumsubscriptionId}`, data: { paymentUserParams:"Object", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" }, "paymentResult": { "paymentTicketId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "Enum", "paymentIntentInfo": "Object", "statusLiteral": "String", "amount": "Double", "currency": "String", "success": true, "description": "String", "metadata": "Object", "paymentUserParams": "Object" } } ``` # Business API Design Specification - `Update Certification` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateCertification` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateCertification` Business API is designed to handle a `update` operation on the `Certification` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Edit an existing certification entry. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `certification-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateCertification` Business API includes a REST controller that can be triggered via the following route: `/v1/certifications/:certificationId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateCertification` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateCertification` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `certificationId` | `ID` | `Yes` | `-` | `urlpath` | `certificationId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateCertification` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.certificationId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js {} ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateCertification` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | certificationId | ID | true | request.params?.certificationId | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/certifications/:certificationId** ```js axios({ method: 'PATCH', url: `/v1/certifications/${certificationId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`certification`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "certification", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "certification": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Language` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateLanguage` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateLanguage` Business API is designed to handle a `update` operation on the `Language` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Edit an existing language entry. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `language-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateLanguage` Business API includes a REST controller that can be triggered via the following route: `/v1/languages/:languageId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateLanguage` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateLanguage` Business API has 1 parameter that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `languageId` | `ID` | `Yes` | `-` | `urlpath` | `languageId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateLanguage` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.languageId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js {} ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateLanguage` api has got 1 client parameter | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | languageId | ID | true | request.params?.languageId | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/languages/:languageId** ```js axios({ method: 'PATCH', url: `/v1/languages/${languageId}`, data: { }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`language`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "language", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "language": { "id": "ID", "name": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Premiumsubscriptionpayment` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updatePremiumsubscriptionPayment` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updatePremiumsubscriptionPayment` Business API is designed to handle a `update` operation on the `Sys_premiumsubscriptionPayment` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description This route is used to update an existing payment. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premiumsubscriptionpayment-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updatePremiumsubscriptionPayment` Business API includes a REST controller that can be triggered via the following route: `/v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updatePremiumsubscriptionPayment` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updatePremiumsubscriptionPayment` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `sys_premiumsubscriptionPaymentId` | `ID` | `Yes` | `-` | `urlpath` | `sys_premiumsubscriptionPaymentId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `ownerId` | `ID` | `No` | `-` | `session` | `userId` | | **Description:** | An ID value to represent owner user who created the order | | | | | | | | | | | | | `paymentId` | `String` | `No` | `-` | `body` | `paymentId` | | **Description:** | A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type | | | | | | | | | | | | | `paymentStatus` | `String` | `No` | `-` | `body` | `paymentStatus` | | **Description:** | A string value to represent the payment status which belongs to the lifecyle of a Stripe payment. | | | | | | | | | | | | | `statusLiteral` | `String` | `No` | `-` | `body` | `statusLiteral` | | **Description:** | A string value to represent the logical payment status which belongs to the application lifecycle itself. | | | | | | | | | | | | | `redirectUrl` | `String` | `No` | `-` | `body` | `redirectUrl` | | **Description:** | A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updatePremiumsubscriptionPayment` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings - **Absolute roles** (bypass all auth checks): Users with any of the following roles will bypass all authentication and authorization checks, including ownership, membership, and standard role/permission checks: `[superAdmin]` --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.sys_premiumsubscriptionPaymentId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { ownerId: this.ownerId, paymentId: this.paymentId, paymentStatus: this.paymentStatus, statusLiteral: this.statusLiteral, redirectUrl: this.redirectUrl, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updatePremiumsubscriptionPayment` api has got 5 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | sys_premiumsubscriptionPaymentId | ID | true | request.params?.sys_premiumsubscriptionPaymentId | | paymentId | String | false | request.body?.paymentId | | paymentStatus | String | false | request.body?.paymentStatus | | statusLiteral | String | false | request.body?.statusLiteral | | redirectUrl | String | false | request.body?.redirectUrl | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/premiumsubscriptionpayment/:sys_premiumsubscriptionPaymentId** ```js axios({ method: 'PATCH', url: `/v1/premiumsubscriptionpayment/${sys_premiumsubscriptionPaymentId}`, data: { paymentId:"String", paymentStatus:"String", statusLiteral:"String", redirectUrl:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`sys_premiumsubscriptionPayment`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "sys_premiumsubscriptionPayment", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "sys_premiumsubscriptionPayment": { "id": "ID", "ownerId": "ID", "orderId": "ID", "paymentId": "String", "paymentStatus": "String", "statusLiteral": "String", "redirectUrl": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Premuimsub` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updatePremuimSub` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updatePremuimSub` Business API is designed to handle a `update` operation on the `Premiumsubscription` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `premuimsub-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updatePremuimSub` Business API includes a REST controller that can be triggered via the following route: `/v1/premuimsub/:premiumsubscriptionId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updatePremuimSub` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updatePremuimSub` Business API has 6 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `premiumsubscriptionId` | `ID` | `Yes` | `-` | `urlpath` | `premiumsubscriptionId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `profileId` | `ID` | `No` | `-` | `body` | `profileId` | | **Description:** | the profile id of the subscription | | | | | | | | | | | | | `currency` | `String` | `No` | `-` | `body` | `currency` | | **Description:** | currency | | | | | | | | | | | | | `status` | `String` | `No` | `-` | `body` | `status` | | **Description:** | - | | | | | | | | | | | | | `price` | `Double` | `No` | `-` | `body` | `price` | | **Description:** | the price of the subscription | | | | | | | | | | | | | `userId` | `ID` | `No` | `-` | `body` | `userId` | | **Description:** | the userid of the subscription | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updatePremuimSub` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.premiumsubscriptionId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { profileId: this.profileId, currency: this.currency, status: this.status, price: this.price, userId: this.userId, } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updatePremuimSub` api has got 6 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | premiumsubscriptionId | ID | true | request.params?.premiumsubscriptionId | | profileId | ID | false | request.body?.profileId | | currency | String | false | request.body?.currency | | status | String | false | request.body?.status | | price | Double | false | request.body?.price | | userId | ID | false | request.body?.userId | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/premuimsub/:premiumsubscriptionId** ```js axios({ method: 'PATCH', url: `/v1/premuimsub/${premiumsubscriptionId}`, data: { profileId:"ID", currency:"String", status:"String", price:"Double", userId:"ID", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`premiumsubscription`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "premiumsubscription", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "premiumsubscription": { "id": "ID", "profileId": "ID", "currency": "String", "status": "String", "price": "Double", "userId": "ID", "_paymentConfirmation": "Enum", "_paymentConfirmation_idx": "Integer", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ``` # Business API Design Specification - `Update Profile` A Business API is a set of logical actions centered around a main data object. These actions can range from simple CRUD operations to complex workflows that implement intricate business logic. While the term “API” traditionally refers to an interface that allows software systems to interact, in Mindbricks a Business API represents a broader concept. It encapsulates a business workflow around a data object, going beyond basic CRUD operations to include rich, internally coordinated actions that can be fully designed and customized. This document provides an in-depth explanation of the architectural design of the `updateProfile` Business API. It is intended to guide backend architects and developers in maintaining the current design. Additionally, frontend developers and frontend AI agents can use this document to understand how to properly consume this API on the client side. ## Main Data Object and CRUD Operation The `updateProfile` Business API is designed to handle a `update` operation on the `Profile` data object. This operation is performed under the specified conditions and may include additional, coordinated actions as part of the workflow. ## API Description Updates the profile of the authenticated user. Includes visibility settings, skills, experience, etc. ## API Options * **Auto Params** : `true` Determines whether input parameters should be auto-generated from the schema of the associated data object. Set to `false` if you want to define all input parameters manually. * **Raise Api Event** : `true` Indicates whether the Business API should emit an API-level event after successful execution. This is typically used for audit trails, analytics, or external integrations. The event will be emitted to the `profile-updated` Kafka Topic Note that the DB-Level events for `create`, `update` and `delete` operations will always be raised for internal reasons. * **Active Check** : `` Controls how the system checks if a record is active (not soft-deleted or inactive). Uses the `ApiCheckOption` to determine whether this is checked during the query or after fetching the instance. * **Read From Entity Cache** : `false` If enabled, the API will attempt to read the target object from the Redis entity cache before querying the database. This can improve performance for frequently accessed records. ## API Controllers A Mindbricks Business API can be accessed through multiple interfaces, including REST, gRPC, WebSocket, Kafka, or Cron. The controllers listed below map the business workflow to a specific interface, enabling consistent interaction regardless of the communication channel. ### REST Controller The `updateProfile` Business API includes a REST controller that can be triggered via the following route: `/v1/profiles/:profileId` By sending a request to this route using the service API address, you can execute this Business API. Parameters can be provided in multiple HTTP locations, including the URL path, URL query, request body, and request headers. Detailed information about these parameters is provided in the **Parameters** section. ### MCP Tool REST controllers also expose the Business API as a tool in the MCP, making it accessible to AI agents. This `updateProfile` Business API will be registered as a tool on the MCP server within the service binding. ## API Parameters The `updateProfile` Business API has 14 parameters that must be sent from the controller. Note that all parameters, except session and Redis parameters, should be provided by the client. Business API parameters can be: * **Auto-generated by Mindbricks** — inferred from the CRUD type and the property definitions of the main data object when the `autoParameters` option is enabled. * **Custom parameters added by the architect** — these can supplement or override the auto-generated parameters. ### Parameter Details | Name | Type | Required | Default | Location | Data Path | | ----------------------------------------------- | --------------------- | -------------------------------------- | -------------------------------------------------------------------- | --------------------------- | ------------------------------ | | | | | | | | | `profileId` | `ID` | `Yes` | `-` | `urlpath` | `profileId` | | **Description:** | This id paremeter is used to select the required data object that will be updated | | | | | | | | | | | | | `summary` | `Text` | `No` | `-` | `body` | `summary` | | **Description:** | Profile summary (bio/description). | | | | | | | | | | | | | `headline` | `String` | `No` | `-` | `body` | `headline` | | **Description:** | Short tagline or headline for profile. | | | | | | | | | | | | | `profilePhotoUrl` | `String` | `No` | `-` | `body` | `profilePhotoUrl` | | **Description:** | URL for profile photo/avatar. | | | | | | | | | | | | | `fullName` | `String` | `No` | `-` | `body` | `fullName` | | **Description:** | Full name for display/search. | | | | | | | | | | | | | `currentCompany` | `String` | `No` | `-` | `body` | `currentCompany` | | **Description:** | Current employer/company, free text for now. | | | | | | | | | | | | | `industry` | `String` | `No` | `-` | `body` | `industry` | | **Description:** | Industry sector name for profile. | | | | | | | | | | | | | `languages` | `String` | `No` | `-` | `body` | `languages` | | **Description:** | Array of language names as string, links to language object (lookup/filter only). | | | | | | | | | | | | | `skills` | `String` | `No` | `-` | `body` | `skills` | | **Description:** | List of professional skills (free-form tags). | | | | | | | | | | | | | `location` | `String` | `No` | `-` | `body` | `location` | | **Description:** | Location information (city, country, etc.) | | | | | | | | | | | | | `experience` | `Object` | `No` | `-` | `body` | `experience` | | **Description:** | Array of experienceItem objects (job history). | | | | | | | | | | | | | `profileVisibility` | `Enum` | `Yes` | `-` | `body` | `profileVisibility` | | **Description:** | Controls who can view profile: public or private. Used in search/list visibility. | | | | | | | | | | | | | `education` | `Object` | `No` | `-` | `body` | `education` | | **Description:** | Array of educationItem objects (degrees/certificates). | | | | | | | | | | | | | `certifications` | `String` | `No` | `-` | `body` | `certifications` | | **Description:** | Professional certifications by name, links to certification object. | | | | | | | | | | | | ### Parameter Transformations Some parameters are post-processed using **transform scripts** after being read from the request but before validation or workflow execution. Only parameters with a `transform` script are listed below. *No parameters are transformed in this API.* ## AUTH Configuration The **authentication and authorization configuration** defines the core access rules for the `updateProfile` Business API. These checks are applied **after parameter validation** and before executing the main business logic. While these settings cover the most common scenarios, more **fine-grained or conditional access control**—such as permissions based on object context, nested memberships, or custom workflows—should be implemented using explicit actions like `PermissionCheckAction`, `MembershipCheckAction`, or `ObjectPermissionCheckAction`. ### Login Requirement This API **requires login** (`loginRequired = true`). Requests from non-logged-in users will return a **401 Unauthorized** error. Login is necessary **but not sufficient**, as additional role, permission, or other authorization checks may still apply. --- ### Ownership Checks This Business API enforces ownership of the main data object before executing the operation. - The check is performed **after fetching the object instance**. If the current user is not the owner, the API will respond with **403 Forbidden**. Note: Ownership checks are applied **only if the objects have an owner field**. --- ### Role and Permission Settings --- ## Where Clause Defines the criteria used to locate the target record(s) for the main operation. This is expressed as a query object and applies to `get`, `list`, `update`, and `delete` APIs. All API types except `list` are expected to affect a single record. *If nothing is configured for (get, update, delete) the id fields will be the select criteria.* **Select By**: A list of fields that must be matched exactly as part of the WHERE clause. This is not a filter — it is a required selection rule. In single-record APIs (`get`, `update`, `delete`), it defines how a unique record is located. In `list` APIs, it scopes the results to only entries matching the given values. Note that `selectBy` fields will be ignored if `fullWhereClause` is set. *The business api configuration has no `selectBy` setting.* **Full Where Clause** An MScript query expression that overrides all default WHERE clause logic. Use this for fully customized queries. When `fullWhereClause` is set, `selectBy` is ignored, however additional selects will still be applied to final where clause. The business api configuration has no `fullWhereClause` setting. **Additional Clauses** A list of conditionally applied MScript query fragments. These clauses are appended only if their conditions evaluate to true. If no condition is set it will be applied to the where clause directly. The business api configuration has no additionalClauses setting. **Actual Where Clause** This where clause is built using whereClause configuration (if set) and default business logic. ```js {$and:[{id:this.profileId},{isActive:true}]} ``` ## Data Clause Defines custom field-value assignments used to modify or augment the default payload for `create` and `update` operations. These settings override values derived from the session or parameters if explicitly provided.", Note that a default data clause is always prepared by Mindbricks using data property settings, however any property in the data clause can be override by Data Clause Settings. An update data clause populates all update-allowed properties of a data object, however the null properties (that are not provided by client) are ignored in db layer. **Custom Data Clause Override** *No custom data clause override configured* **Actual Data Clause** The business api will use the following data clause. Note that any calculated value will be added to the data clause in the api manager. ```js { summary: this.summary, headline: this.headline, profilePhotoUrl: this.profilePhotoUrl, fullName: this.fullName, currentCompany: this.currentCompany, industry: this.industry, languages: this.languages ? this.languages : ( this.languages_remove ? sequelize.fn('array_remove', sequelize.col('languages'), this.languages_remove) : (this.languages_append ? sequelize.fn('array_append', sequelize.col('languages'), this.languages_append) : undefined)) , skills: this.skills ? this.skills : ( this.skills_remove ? sequelize.fn('array_remove', sequelize.col('skills'), this.skills_remove) : (this.skills_append ? sequelize.fn('array_append', sequelize.col('skills'), this.skills_append) : undefined)) , location: this.location, experience: this.experience ? (typeof this.experience == 'string' ? JSON.parse(this.experience) : this.experience) : null, profileVisibility: this.profileVisibility, education: this.education ? (typeof this.education == 'string' ? JSON.parse(this.education) : this.education) : null, certifications: this.certifications ? this.certifications : ( this.certifications_remove ? sequelize.fn('array_remove', sequelize.col('certifications'), this.certifications_remove) : (this.certifications_append ? sequelize.fn('array_append', sequelize.col('certifications'), this.certifications_append) : undefined)) , } ``` ## Business Logic Workflow ### [1] Step : startBusinessApi Manager initializes context, prepares request and session objects, and sets up internal structures for parameter handling and milestone execution. You can use the following settings to change some behavior of this step. `apiOptions`, `restSettings`, `grpcSettings`, `kafkaSettings`, `socketSettings`, `cronSettings` --- ### [2] Step : readParameters Manager reads parameters from the request or Redis, applies defaults, and writes them into context for downstream milestones. You can use the following settings to change some behavior of this step. `customParameters`, `redisParameters` --- ### [3] Step : transposeParameters Manager executes parameter transform scripts and derives any helper values or reshaped payloads into the context. --- ### [4] Step : checkParameters Manager validates required parameters, checks ID formats (UUID/ObjectId), and ensures all preconditions for update are met. --- ### [5] Step : checkBasicAuth Manager performs login verification, role, and permission checks, enforcing tenant and access rules before update. You can use the following settings to change some behavior of this step. `authOptions` --- ### [6] Step : buildWhereClause Manager constructs the WHERE clause used to identify the record to update, applying ownership and parent checks if necessary. You can use the following settings to change some behavior of this step. `whereClause` --- ### [7] Step : fetchInstance Manager fetches the existing record from the database and writes it to the context for validation or enrichment. --- ### [8] Step : checkInstance Manager performs instance-level validations, including ownership, existence, lock status, or other pre-update checks. --- ### [9] Step : buildDataClause Manager prepares the data clause for the update, applying transformations or enhancements before persisting. You can use the following settings to change some behavior of this step. `dataClause` --- ### [10] Step : mainUpdateOperation Manager executes the update operation with the WHERE and data clauses. Database-level events are raised if configured. --- ### [11] Step : buildOutput Manager assembles the response object from the update result, masking fields or injecting additional metadata. --- ### [12] Step : sendResponse Manager sends the response back to the controller for delivery to the client. --- ### [13] Step : raiseApiEvent Manager triggers API-level events, sending relevant messages to Kafka or other integrations if configured. --- ## Rest Usage ### Rest Client Parameters Client parameters are the api parameters that are visible to client and will be populated by the client. Note that some api parameters are not visible to client because they are populated by internal system, session, calculation or joint sources. The `updateProfile` api has got 14 client parameters | Parameter | Type | Required | Population | | ---------------------- | ---------------------- | -------- | ---------------------------- | | profileId | ID | true | request.params?.profileId | | summary | Text | false | request.body?.summary | | headline | String | false | request.body?.headline | | profilePhotoUrl | String | false | request.body?.profilePhotoUrl | | fullName | String | false | request.body?.fullName | | currentCompany | String | false | request.body?.currentCompany | | industry | String | false | request.body?.industry | | languages | String | false | request.body?.languages | | skills | String | false | request.body?.skills | | location | String | false | request.body?.location | | experience | Object | false | request.body?.experience | | profileVisibility | Enum | true | request.body?.profileVisibility | | education | Object | false | request.body?.education | | certifications | String | false | request.body?.certifications | ### REST Request To access the api you can use the **REST** controller with the path **PATCH /v1/profiles/:profileId** ```js axios({ method: 'PATCH', url: `/v1/profiles/${profileId}`, data: { summary:"Text", headline:"String", profilePhotoUrl:"String", fullName:"String", currentCompany:"String", industry:"String", languages:"String", skills:"String", location:"String", experience:"Object", profileVisibility:"Enum", education:"Object", certifications:"String", }, params: { } }); ``` ### REST Response The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a `"status": "OK"` property. For error handling, refer to the "Error Response" section. Following JSON represents the most comprehensive form of the **`profile`** object in the respones. However, some properties may be omitted based on the object's internal logic. ```json { "status": "OK", "statusCode": "200", "elapsedMs": 126, "ssoTime": 120, "source": "db", "cacheKey": "hexCode", "userId": "ID", "sessionId": "ID", "requestId": "ID", "dataName": "profile", "method": "PATCH", "action": "update", "appVersion": "Version", "rowCount": 1, "profile": { "id": "ID", "summary": "Text", "headline": "String", "profilePhotoUrl": "String", "userId": "ID", "fullName": "String", "currentCompany": "String", "industry": "String", "languages": "String", "skills": "String", "location": "String", "experience": "Object", "profileVisibility": "Enum", "profileVisibility_idx": "Integer", "education": "Object", "certifications": "String", "isActive": true, "recordVersion": "Integer", "createdAt": "Date", "updatedAt": "Date", "_owner": "ID" } } ```