API Model for CamelCamelCamel Service
Explore the API design for the CamelCamelCamel service by defining its base URL, key endpoints, and necessary data entities. Learn to structure request and response message formats for core operations such as adding products to a watch list, listing these products, and retrieving price timelines. Understand how the API supports notification mechanisms and error handling to build a scalable and responsive system.
In this lesson, we’ll define the base URL and endpoints of the C3 service to perform different operations. We’ll examine the data entities needed to meet the functional requirements of the C3 service. We’ll analyze request and response message formats for the fundamental functional requirements.
Base URL and API endpoints
We can use the following URL as the base URL of the C3 service:
The api.c3.com represents the host URLs of the C3 service. We’ve already seen that the version is used to update different services related to the API or to fix bugs. Because this is the first C3 API that we are designing, we assume the version to be v1.0. Lastly, the service indicates the endpoint we’ll use to perform different operations. The set of operations are listed in the following illustration:
The /pubsub/product endpoint is used to add the products to the watch list, asking the service to watch the product for price drops—the service notifies the user if they happen. Similarly, the ...