I'd like to know your thoughts on which version of this endpoint will be better, and your thoughts on the general format of the response. Want to make sure we are all on board with how the meta
section will look like.
For reference: PEEPS-1612
GET /people/analytics?owner_id=WF&updated_since=2016-01-13T12:39:50Z
{
data: [
{ ... }, # account hash
{ ... }
],
errors: {},
meta: {
next_page_id: "kajsdnkaj12345rtfdchbbusw37489qiksda~-aksjdn",
total: 1000
}
}
Use the next_page_id
from the last request as a query param on the next request
GET /people/analytics?owner_id=WF&next_page_id=kajsdnkaj12345rtfdchbbusw37489qiksda~-aksjdn
{
data: [
{ ... }, # account hash
{ ... }
],
errors: {},
meta: {
next_page_id: "poiuytrewq129348reuw21qwqieh0", # when this is nil, this is the last page
total: 1000
}
}
GET /people/analytics?owner_id=WF&updated_since=2016-01-13T12:39:50Z
{
data: [
{ ... }, # account hash
{ ... }
],
errors: {},
meta: {
next_page_url: "http://secure.westfield.io/v1/people/analytics?owner_id=WF&next_page_id=oiuy67890wiury",
total: 1000
}
}
Use the next_page_url
from the last response to get to the next page of results
GET http://secure.westfield.io/v1/people/analytics?owner_id=WF&next_page_id=oiuy67890wiury
{
data: [
{ ... }, # account hash
{ ... }
],
errors: {},
meta: {
next_page_id: "http://secure.westfield.io/v1/people/analytics?owner_id=WF&next_page_id=oiuy67890wiury",, # when this is nil, this is the last page
total: 1000
}
}
Revisions tab does not seem to allow comments.
next_page_url
requires less processing by the client, and is more abstract, so I think that may be better.Supplying an empty string rather than
nil
for the end sentinel value fits with our standards (https://wiki.westfieldlabs.com/pages/viewpage.action?spaceKey=WL&title=API+Standards+and+Governance#APIStandardsandGovernance-Non-existentoremptydataempty_data) and will cause fewer bugs. It is just as unique in this context asnil
.