API Model for Twitter Service
Learn how to interact with Twitter's API by identifying the endpoints and determining the message format.
We are now familiar with the services involved in Twitter's API and their workflow. Let us now shift our focus to discussing the API endpoints required to fulfill our functional requirements. Moreover, we will discuss the essential data entities and the message format for each endpoint in detail.
Let's start with the base URL of our API.
Base URL and API endpoints
The following URL is used as the base URL for our Twitter services. The api.twitter.com
is the host URL, and v1.0
represents the version of our API.
Users can use the following endpoints and methods to access different services of Twitter's API.
While most of the endpoints are self-explanatory, we’ll focus on the timeline service. As we can see above, the timeline is available through multiple endpoints. These endpoints go to the same timeline service but return different types of timelines.
Point to Ponder
Why is not better to use just one endpoint for the timeline and some parameter to differentiate between different types of timelines, especially when, ultimately, they go to the same service?