In this article:
How to retrieve event data through your subscription
To assist in consuming the payload sent to your webhook from the subscription service, TradeLens provides the JSON schema in the GET .../subscriptions/event/schema - Get subscription event schema API, that can be found in the Event Subscription API section of the Swagger.
The API is for documentation purposes only. You can read the Swagger documentation and open the Model in the Responses section of the Swagger to see the superset of fields possible in events that are posted to configured event subscriptions. Descriptions are also provided for each field.
Note that subscription data consists of data from the event payload as provided by the publisher, plus additional data from TradeLens to assist the subscribers.
When creating a new subscription from the UI, you will notice a link to Schema (in the example screen images below). The schema can also be found at the following links in the Event Subscription API Swagger.
Sandbox Subscription Event Schema: https://platform-sandbox.tradelens.com/documentation/swagger/?urls.primaryName=Event%20Subscription%20API
Production Subscription Event Schema: https://platform.tradelens.com/documentation/swagger/?urls.primaryName=Event%20Subscription%20API
Document retrieval through subscription
Document retrieval through your subscription can be set up following the below steps:
Step 1: Subscribe to the document event. You can learn more here: How to subscribe to TradeLens Data
Step 2: Once the document is uploaded and available in the TradeLens platform, the corresponding document event is sent to your webhook. Below is an example of the event payload. You need to use the docId value from this and use it in step 3
Step 3: Call the API GET/api/v1/documents/{documentId}/content to fetch document content using the docId
The API can be found at the following links in the Document Sharing API Swagger:
Production - https://platform.tradelens.com/documentation/swagger/?urls.primaryName=Document%20Sharing%20API
More details about data structure at TradeLens can be found in this set of articles on the TradeLens Event Model