Designing for communication
The design of APIs, or application programming interfaces, is essential to enabling smooth communication between various software services and components. The following tips detail how an API should be created to promote efficient communication:
- Clarify goals: Make sure that you know and understand the API’s goals. What kind of information will it process or what kind of service will it offer?
- Choose the right protocol: The two primary protocols used for communication in APIs are Simple Object Access Protocol (SOAP) and Representational State Transfer (REST). Because of its ease of use, REST is the most popular protocol.
- URIs: URIs for your resources should be precisely defined in design endpoints. Always use nouns for defining the API resource path.
- Use status codes: In order to inform clients of the outcome of an API request, APIs should return standard HTTP status codes.
- Provide data in a standard format: The most widely...