REST APIs use HTTP methods to interact with resources. They are the most common API type for network automation.
HTTP methods:
- GET retrieves information. Read interface status, routing tables.
- POST creates new resources. Add a VLAN, create an ACL entry.
- PUT replaces existing resources. Update an entire configuration.
- DELETE removes resources. Delete a VLAN or route.
Example request:
GET /api/v1/interfaces HTTP/1.1
Host: switch.example.com
Authorization: Bearer <token>
Responses come as JSON. Parse with any programming language. REST APIs are stateless. Each request contains all information needed.