10. Create the perfect url
▪ POST http://www.example.com/customers
▪ GET http://www.example.com/customers/33245
▪ POST http://www.example.com/customers/33245/orders
APICONF 2017 – Gabriele Mittica
11. Don’t be an artist!
Don’t do that:
▪ GET
http://api.example.com/services?op=update_customer&i
d=12345&format=json
▪ PUT http://api.example.com/customers/12345/update
APICONF 2017 – Gabriele Mittica
12. Use headers and body in the right way
RIGHT
[
{…},
{…},
{…},
{…}
]
//pagination in header
WRONG
{
‘’pagination’’: { ‘’from’’: 0, ‘’to’’: 10},
‘’data’’: [
{…},
{…},
{…}
]
}
APICONF 2017- Gabriele Mittica
13. In few words
▪ Work on resources
▪ Use headers, body and query params in the right way
▪ Find the best auth method for your needs
▪ Design layered APIs
APICONF 2017- Gabriele Mittica