API Model for LeetCode Service
Understand the use of data entities and API endpoints for the LeetCode API service.
This lesson models the LeetCode API by discussing its base URL, the endpoints of various services, the data entities, and the messages exchanging these data entities to fulfill different user requests. The design considerations from the preceding lesson will inform our API modeling.
Base URL and API endpoints
The following is the base URL of the LeetCode service:
We’ll use api.leetcode.com
as the host URL for requesting distinct LeetCode services.
The endpoints for each operation are defined against the respective service in the following diagram. You can view the remaining endpoints by unfolding each service.
Below, we discuss the endpoints of each service individually:
User service: The
/register
,/login
, and ...