Webhooks

Create a webhook (Subscribe)

Before configuring this API endpoint, you must configure Enadoc settings which are required for document upload events.

Pre-requisites from Enadoc:

  • Create library

First, create library/s to store various types of documents separately.

  • Create indexes for the library

You must create specific indexes under each library to insert document metadata while uploading documents.

  • Create document permission

Document accessibility is managed by document permission.

  • Create tag profiles

Tag Profiles are required to upload documents to the library. While uploading documents, you must select a tag profile. You can create multiple tag profiles for one library with different security levels and different permission scopes. The document permission and security level are identified by the system through the tag profile you have selected while uploading. Therefore, you must create tag profiles before starting the upload document process to the new library.

  • Configure tag profile accessibility and other library level user permission

Hence you keep user groups globally, you are required to manage their library level permission. You must assign accessible tag profiles for each user group otherwise that user group has no permission to upload documents via tag profile.

  • You can define library level user rights for each user individually. If you expect to manage index accessibility for each user, configure it before uploading documents.

Create a webhook (Subscribe)

POST [ENADOC_URL] /api/v3/hooks/subscribe/{event-name}

Using this API endpoint, application can make a hook for document upload event, which is a specific event to Enadoc.

Path Parameters

Name
Type
Description

event-name

string

Event-name should be key-word which is extracted from Event-list table. Below are the event list table. Here the event-name is Document upload event

Headers

Name
Type
Description

Authorization

string

Type - Bearer Access token will be sent in request headers

Request Body

Name
Type
Description

rule_libraryid

integer

Enadoc library id

rule_tagprofileid

integer

Enadoc tag profile id

rule_userid

integer

Enadoc user id

Callbackurl

string

Application endpoint which is event payload capture, Enadoc server events will send the payloads to this endpoint. You should add the callback url to the request body because when event triggered, the notification will receive to the call back url.

Event-name should be a keyword that is extracted from the Event-list table. Below is the event list table.

Event list:

Name

Key-word

Description

Document upload event

documentupload

Document upload event name

You can subscribe to a hook with or without defining the set of rules. If you subscribe without any rule, every time event occurs, the Enadoc server will send the payload. You can define rules as library rule, tag profile rule and user rule. These rules can be used as a filter. The Below table describes the list of rules available to create a document upload hook.

Ruleset:

Rule Name

Key

Description

Library rule

rule_libraryid

Enadoc library id

Tag profile rule

rule_tagprofileid

Enadoc tag profile id

User rule

rule_userid

Enadoc user id

If you define a hook with a library rule, then the Enadoc server sends notifications when events occur according to the library rule. This hook will be triggered every time document is uploaded to the defined specific library.

If you define a hook with the tag profile rule, then the Enadoc server sends notifications when events occur according to the tag profile rule. This hook will be triggered every time document is uploaded via the defined specific tag profile.

If you define a hook with a user id, then the Enadoc server sends notifications when an event occurs according to the user rule. This hook will be triggered every time document is uploaded to the Enadoc through a defined specific user ID.

When you define a hook, you can use a combination of these rules.

Refer request headers and body from the API code block.

Get webhooks

GET [ENADOC_URL] /api/v3/hooks

Pre-requisites: Must create hooks first

Path Parameters

Name
Type
Description

Authorization

string

Type - Bearer Access token will be sent in request headers

Get specific webhook

GET [ENADOC_URL] /api/v3/hooks/{id}

Pre-requisites from Enadoc - Must create hooks first.

Path Parameters

Name
Type
Description

id

integer

Hook id

Headers

Name
Type
Description

Authorization

string

Type - Bearer Access token will be sent in request headers

Delete hook

DELETE [ENADOC_URL] /api/v3/hooks/{id}

Pre-requisites from Enadoc: Must create hooks first

Path Parameters

Name
Type
Description

id

integer

Hook id

Headers

Name
Type
Description

Authorization

string

Type - Bearer Access token will be sent in request headers

Event payload

Pre-requisites: Must create hooks first (Refer section 8.1 in Enadoc API document)

Document Upload Event

GET

Document upload event is occurred when there are subscribed applications for the event and set of rules matched and then server will send notifications. Notifying response headers will having client_id and client_secret. These keys are used to identify who is notifying the current application. These keys will have when the application is success. Note: This is an event trigger the response only. No request contain here.

Path Parameters

Name
Type
Description

string

Error:

Error code

Error

Error description

Reason

011.004

Call back url required

Call back url is required

Does not contain callback url

Last updated

Was this helpful?