What are the different types of APIs you can build with API Gateway?
Short answer
API Gateway supports REST APIs, which offer the most features including request validation and API keys, HTTP APIs, which are lighter and cheaper for simple proxy integrations, and WebSocket APIs, which allow persistent two way connections for real time applications like chat…
Advertisement
AModel answer
API Gateway supports REST APIs, which offer the most features including request validation and API keys, HTTP APIs, which are lighter and cheaper for simple proxy integrations, and WebSocket APIs, which allow persistent two way connections for real time applications like chat apps or live dashboards.
Example
aws apigatewayv2 create-api --name 'ChatAPI' --protocol-type WEBSOCKET
Real-world example
A ride sharing application uses a WebSocket API to continuously push a driver's live location to the customer's app, while using a simpler HTTP API for one time actions like booking a ride.
Likely follow-ups
- When should you choose HTTP APIs over REST APIs?
- How do WebSocket APIs maintain a persistent connection?
Related topics