API Model for Connections and Job Search
Explore how to define API endpoints and message formats for a professional networking platform. Learn to model profiles, connections, job search, applications, feeds, messaging, and posts while applying pagination, caching, idempotency, WebSockets, and error handling.
We are now familiar with the services involved in a professional networking platform’s API and their workflow. Let’s 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 some crucial 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 professional networking platform services. The api.linkedinclone.com is the host URL, v1 represents the version of our API, and services represents the service that a specific API call targets.
While most of the endpoints are self-explanatory, we'll focus on three services in particular. The feed service assembles ranked content from across the network and is the most read-heavy endpoint on the platform. The connection service is the backbone of the networking model, every feed ranking signal, job recommendation, and messaging permission is gated on the connection graph. The messaging service introduces real-time constraints (read receipts, typing indicators) that differ from the stateless request-response model used by the other endpoints.
We can use the following endpoints and methods to access different services of LinkedIn platform’s API.
Message format for API endpoints
Let's discuss the data entities involved in the LinkedIn-like platform API and the message format for them in detail. Since the platform spans six functional areas — profiles, connections, jobs, feed, messaging, and posts — our focus will be on the endpoints that carry the most design complexity: profile management, connection handling, job application, feed retrieval, messaging, and post interactions.
Data entities
Let's start by highlighting the core data entities that will be of use to us in the LinkedIn-like platform API.
Manage user profile
In this section we discuss the message format for creating and updating a professional profile, including handling media attachments such as a profile photo or a portfolio document.
HTTP method: The
POSTmethod is suitable for creating a new resource. The PATCH method is used for partial updates to an existing profile.
Create user profile
Request format (HTTP): Following is the request format for creating a user profile.
Response format: If the profile is successfully created, the 201 Created status and the created profile's attributes return in the response.
Upload profile media
For attaching a profile photo or portfolio document, an initial upload request is sent to the media endpoint to obtain a mediaID. That mediaID is then included in a subsequent PATCH /v1/profiles/{profile_id} request to associate the media with the profile.
Request format (HTTP): The client sends
POST /v1/profiles/prf_00x91z/mediawith the headers and body shown below to upload ...