Created
August 14, 2013 01:31
-
-
Save walesmd/6227290 to your computer and use it in GitHub Desktop.
Correct JSON-API Example Our response consists of a single array with the same name as our table. Notice this is using the ID format in that foreign keys return the primary key to the joined table. A URL format is available and preferred, so that the client can be completely unaware / agnostic in regards to the backend. In ID format, we must har…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"datacenters": [{ | |
"id": "1", | |
"name": "Albany Center", | |
"lat": "42.64957", | |
"lng": "-73.77459", | |
"city": "Albany", | |
"state": "NY", | |
"zip": "12208", | |
"createdAt": "2013-06-24", | |
"updatedAt": "2013-06-30", | |
"ownershiptype_id": "4" | |
}, { | |
"id": "2", | |
"name": "Albany Backup", | |
"lat": "42.64957", | |
"lng": "-73.77459", | |
"city": "Albany", | |
"state": "NY", | |
"zip": "12208", | |
"createdAt": "2013-06-24", | |
"updatedAt": "2013-06-30", | |
"ownershiptype_id": "4" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"datacenter": { | |
"id": "1", | |
"name": "Albany Center", | |
"lat": "42.64957", | |
"lng": "-73.77459", | |
"city": "Albany", | |
"state": "NY", | |
"zip": "12208", | |
"createdAt": "2013-06-24", | |
"updatedAt": "2013-06-30", | |
"ownershiptype_id": "4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment