API Model for Pub-Sub Service
Learn the API endpoints and the request and response format of the pub-sub API.
In the previous lesson, we discussed the important technical aspects that direct the design of the pub-sub API. This lesson describes the request and response format to access different endpoints for various operations.
Let's start by defining the base URL for the pub-sub API.
Base URL and API endpoints
The URL of the pub-sub API can be given as shown below:
The domain is the address of the server that has the service endpoints. It’s better to present it in either of the two formats mentioned above, though there is no restriction on defining the URL format. We address api.pubsub.com
in the rest of the sections in this lesson. The versioning shows the service's different updates or bug fixes. We use v1.0
because it's the first version of the pub-sub API. The service indicates different endpoints to perform operations.
We identify the following endpoints to perform different functionalities:
The message format for API endpoints
Let's discuss the data entities and request-response format to meet the functional ...