Intelligent Document Processing
processmaker.comKnowledge CenterDevelopers Corner
  • ProcessMaker Intelligent Document Processing
  • What's New
  • Release Notes
  • Glossary
  • 🟦IDP User
    • Document Management
      • Files and Folders
      • Preview a Document
      • Version Control
      • Access Control
      • Elastic Search
    • Intelligent Document Processing
  • 🟪IDP Administrator
    • Entity Management
      • Create a New Entity
    • Excel Import and Export
    • OCR Service
    • Classification Service
    • Named Entity Recognition
    • Annotations
    • Authorization
      • Example Authorization Configuration
    • Importer
    • Elastic Search Configuration
    • Email Integration
    • Email Notifications
    • Audit Log
    • Retention Management
    • Power BI
    • Exports
    • Translations
  • 🟦ProcessMaker Administrator and Designer
    • IDP Admin Settings
    • IDP Connector in Processes
  • 🟩IDP Developer
    • REST API Home
    • Key Concepts
    • Authentication
    • Request Syntax
    • Endpoints for Entity Objects
    • Endpoints for Documents
    • WebSockets
Powered by GitBook
On this page
  • Subscribe
  • Notifications
  • Unsubscribe
  1. IDP Developer

WebSockets

WebSocket support makes it possible to open a two-way interactive communication session between a client and ProcessMaker IDP. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. WebSocket support requires an integration rule with Queue Name WEB_SOCKET_EVENTS and an Entity Reference to a certain entity to process events.

First, open the connection: wss://processmaker-idp.com/api/websocket/events. Then you can subscribe or unsubscribe to events of a particular entity instance defined by an ID. Notifications are received after update operations are made on the subscribed file. Each request requires an Authorization header with a Bearer token from Keycloak. Also, a second header Origin is required with the ProcessMaker IDP base URL as the value.

Subscribe

Example:

{
  "action": "subscribe",
  "entity": "file",
  "id": "fc795c7a-451f-474b-9a56-ac5ca6d140dd"
}

Notifications

The client will be notified at every value change of an attribute of that particular entity instance:

{
  "entity": "FILE",
  "id": "37c3b618-9ad8-49ef-b0af-c329dd0b3ebb",
  "name": "example.pdf",
  "action": "UPDATE",
  "attributes": ["fullText", "language", "annotatable"]
}

If you would like to get notified of new or updated files in a folder, the Event Type of the integration rule related to the child entity (in this case FILE) should be set to both CREATE and UPDATE. You will need to subscribe to the folder.

A new file:

{
  "entity": "FOLDER",
  "id": "8fe828a8-b35e-434c-abcd-a95756c8a1f5",
  "action": "CREATE_FILE",
  "child": {
    "name": "new_file.pdf",
    "entity": "FILE",
    "id": "5a021d0f-b864-413a-91b1-7e027de959b1"
  }
}

An updated file:

{
  "entity": "FOLDER",
  "id": "8fe828a8-b35e-434c-abcd-a95756c8a1f5",
  "action": "UPDATE_FILE",
  "child": {
    "name": "example.pdf",
    "entity": "FILE",
    "id": "37c3b618-9ad8-49ef-b0af-c329dd0b3ebb"
  },
  "attributes": ["fullText", "language", "annotatable"]
}

Unsubscribe

Example:

{
  "action": "unsubscribe",
  "entity": "FILE",
  "id": "37c3b618-9ad8-49ef-b0af-c329dd0b3ebb"
}
PreviousEndpoints for Documents

Last updated 11 months ago

🟩