This APIfication and SDKisation effort was broken down into standardizing REST API endpoints, automating API documentation, creating webhook services and providing client SDK in multiple languages.
1) API Standardization
It’s important to make sure that these trading related APIs are as developer-friendly as possible i.e. they should be semantically consistent and predictable. Standardization helps your users avoid bugs and code debt.
We standardized the following elements:
- API Structure - header and body
- HTTP methods
- Variable renaming to make it semantically consistent
- Merging common API endpoints
- API versioning
- API Responses
- Error reporting
- Postman collection for testing
- Open API compliance - Added Swagger UI support
2) API Documentation
We built API documentation which can become a single point of reference guide for developers. This documentation is based on a custom developed content management system that any user can use and dynamically change the description on the fly. The documentation does not need any manual efforts apart from adding description. It takes postman collection as input and dynamically generates code snippets in multiple languages while updating the UI.
3) Webhooks for real time order notifications
We developed websocket based platform for seamless communication between exchange to user via our client i.e broker's channel. We integrated order feeds in same platform so that user can utilize same bridge to receive both - ticker data i.e stock market real time feeds as well as user's order status.
Now our client has few partners who are not always online on client's web or mobile app to receive data via websocket. Instead they have their own custom web application while leveraging client's APIs. We developed webhooks so that these partners can receive a postback request for order notifications.
4) Client SDK
It contains wrapper classes that you can use to call the API from user's application without having to deal with HTTP requests and responses. We added support for encoding and decoding stock symbols and relevant payload information in SDK to reduce network egress cost and providing users the best way to fetch latest market values of subscribed stocks covering close to 25k unique stock symbols which includes Equity, F&O, Commodities, Currency of both exchanges - NSE and BSE.