This is a proposal for adding _link attributes to API resources as per the HAL specification.
I propose the following standard links using customers as an example;
{
customer: {
ID: 123,
...
},
_link: {
self: { href: '/customers?page=2' },
next: { href: '/customers?page=3' },
prev: { href: '/customers?page=1' },
},
// Contains useful relations to other resources
_embed: {
orders: { href: '/orders?customer_id=123' }
}
}