Skip to content

Instantly share code, notes, and snippets.

@nicwise
Created November 6, 2011 13:15
Show Gist options
  • Save nicwise/1342861 to your computer and use it in GitHub Desktop.
Save nicwise/1342861 to your computer and use it in GitHub Desktop.
json stuff
GIST #1:
Many:
/v2/tasks
{ "tasks":[
{
"path":"/v2/tasks/1",
"project":"/v2/projects/1",
"name":"Sample Task",
"is_billable":true,
"billing_rate":"0.0",
"billing_period":"hour",
"status":"Active",
"created_at":"2011-08-16T11:06:57Z",
"updated_at":"2011-08-16T11:06:57Z"
}
]}
Just one:
/v2/tasks/1
{ "task":
{
"project":"/v2/projects/1",
"name":"Sample Task",
"is_billable":true,
"billing_rate":"0.0",
"billing_period":"hour",
"status":"Active",
"created_at":"2011-08-16T11:06:57Z",
"updated_at":"2011-08-16T11:06:57Z"
}
}
GIST #2 - what I would prefer:
in BOTH cases above:
{
[
{
"path":"/v2/tasks/1",
"project":"/v2/projects/1",
"name":"Sample Task",
"is_billable":true,
"billing_rate":"0.0",
"billing_period":"hour",
"status":"Active",
"created_at":"2011-08-16T11:06:57Z",
"updated_at":"2011-08-16T11:06:57Z"
}
]}
GIST #3: multiple things:
{
tasks: [{ .... }, {......}],
users: [{ .... }, {......}]
}
GIST #4 - this is what I think needs to come back from /v2/users/1
{
"path":"/v2/users/1",
"first_name":"Development",
"last_name":"Team",
"email":"dev@freeagentcentral.com",
"role":"Director",
"permission_level":8,
"opening_mileage":0,
"updated_at":"2011-08-24T08:10:23Z",
"created_at":"2011-07-28T11:25:11Z"
}
GIST #5: this is what actually comes back - note lack of path
{
"first_name":"Development",
"last_name":"Team",
"email":"dev@freeagentcentral.com",
"role":"Director",
"permission_level":8,
"opening_mileage":0,
"updated_at":"2011-08-24T08:10:23Z",
"created_at":"2011-07-28T11:25:11Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment