Skip to content

Thing API Documentation

jholt456 edited this page Jun 21, 2012 · 27 revisions

Get a List of Things

Gets all things in the team thing system

End point
GET /api/thing
Example

Request Parameters
None

Response
Returns an array of things

[{"id":3,
  "description":"Get the team ready",
  "isStarred":false,
  "status":"InProgress",
  "dateCreated":"2012-03-23T17:40:06.527",
  "owner":{"id":10,
           "imagePath":"/images/GenericUserImage.gif",
           "emailAddress":"holt@telerik.com"},
  "team":{"name":"A-Team",
          "id":2,
          "ownerId":10,
          "administrators":[10],
          "isPublic":false,
          "imagePath":"/images/GenericUserImage.gif"},
   "assignedTo":[{"id":18,
                  "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                  "emailAddress":"demo@demo.com"}]},
 {"id":4,
  "description":"vcdfasdfasdf",
  "isStarred":false,
  "status":"InProgress",
  "dateCreated":"2012-03-27T13:03:44.317",
  "owner":{"id":10,
           "imagePath":"/images/GenericUserImage.gif",
           "emailAddress":"holt@telerik.com"},
  "team":{"name":"A Sweet Team",
          "id":20,
          "ownerId":10,
          "administrators":[10],
          "isPublic":false,
          "imagePath":"/images/GenericUserImage.gif"},
  "assignedTo":[{"id":18,
                 "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                 "emailAddress":"demo@demo.com"}]}]

Get a Thing

Get the thing with the specified thingId

End point
GET api/thing/{thingId}
Example

Request Parameters
None

Response
Returns a single thing and all associated data

{"id":3,
 "description":"Get the team ready",
 "isStarred":false,
 "status":"InProgress",
 "dateCreated":"2012-03-23T17:40:06.527",
 "owner":{"id":10,
          "imagePath":"/images/GenericUserImage.gif",
          "emailAddress":"holt@telerik.com"},
 "team":{"name":"A-Team",
         "id":2,
         "ownerId":10,
         "administrators":[12],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":18,
                "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                "emailAddress":"demo@demo.com"}]}

Create a Thing

Create a new thing in the team thing application.

End point
POST api/thing

Request Parameters
* = Required
*createdById : int ex: 2 (current user id usually)
description : string ex: "My New Thing"
*assignedTo : int array ex: [5,6]
*teamId : int ex: 5

Example Request

{"CreatedById":5,
 "Description":"My New Thing", 
 "AssignedTo":[5,6], 
 "teamId":10}

Response
Returns the created thing

{"id":30,
 "description":"My New Thing",
 "isStarred":false,
 "status":"InProgress",
 "dateCreated":"2012-06-15T17:40:06.527",
 "owner":{"id":2,
          "imagePath":"/images/GenericUserImage.gif",
          "emailAddress":"holt@telerik.com"},
 "team":{"name":"A-Team",
         "id":5,
         "ownerId":10,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
  "assignedTo":[{"id":18,
                 "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                 "emailAddress":"demo@demo.com"}]}

Update a Thing

Updates various data about a thing, except for status, status is handled in methods shown below.

End point
PUT api/thing/{thingId}

Request Parameters
* = Required
*editedById: int ex: 2 (current user id usually)
description : string ex: "My New Thing"
*assignedTo : int array ex: [5,6]

Example Request

{"EditedById":5,
 "Description":"My Updated Thing", 
 "AssignedTo":[5,6]}

Response
Returns the updated thing

{"id":30,
 "description":"My Updated Thing",
 "isStarred":false,
 "status":"InProgress",
 "dateCreated":"2012-06-15T17:40:06.527",
 "owner":{"id":2,
          "imagePath":"/images/GenericUserImage.gif",
          "emailAddress":"holt@telerik.com"},
 "team":{"name":"A-Team",
         "id":5,
         "ownerId":10,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":5,
                "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                "emailAddress":"demo@demo.com"},
               {"id":6,
                "imagePath":"http://teamthing.apphb.com:16167/images/GenericUserImage.gif",
                "emailAddress":"test@demo.com"}]}

Update a Thing's Status

Updates the status of a thing with the specified thingId .
This can only be done by a thing's owner, someone assigned to the thing, or someone that is an admin on a team in which this team is assigned.

End point
PUT api/thing/{thingId}/updatestatus

Request Parameters
* = Required
*userId: int
*status: string

Example Request

{"UserId":10, "Status":"Completed"}

Valid Statuses
Completed
Delayed
InProgress

Response
Returns the updated thing

{"id":10,
 "isStarred":false,
 "description":null,
 "status":"Completed",
 "dateCreated":"2012-05-11T17:12:02.143",
 "owner":{"id":11,
          "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
          "emailAddress":"jholt456@gmail.com"},
 "team":{"name":"Matt's Team",
         "id":23,
         "ownerId":11,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":11,
                "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
                "emailAddress":"jholt456@gmail.com"}]}

Complete a Thing

Completes the thing with the specified thingId. Is a shortcut method for updating a things status
This can only be done by a thing's owner, someone assigned to the thing, or someone that is an admin on a team in which this team is assigned.

End point
PUT api/thing/{thingId}/complete

Request Parameters
* = Required
*userId: int

Example Request

{"userId":10}

Response
Returns the completed thing

{"id":141,
 "isStarred":false,
 "description":null,
 "status":"Completed",
 "dateCreated":"2012-05-11T17:12:02.143",
 "owner":{"id":11,
          "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
          "emailAddress":"jholt456@gmail.com"},
 "team":{"name":"Matt's Team",
         "id":23,
         "ownerId":11,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":11,
                "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
                "emailAddress":"jholt456@gmail.com"}]}

Star a Thing

Stars the thing with the specified thingId in the team thing application.

End point
PUT api/thing/{thingId}/star

Request Parameters
* = Required
*userId: int

Example Request

{ userId: 12 }

Response
Returns the starred thing

{"id":141,
 "description":null,
 "status":"Completed",
 "isStarred":true,
 "dateCreated":"2012-05-11T17:12:02.143",
 "owner":{"id":11,
          "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
          "emailAddress":"jholt456@gmail.com"},
 "team":{"name":"Matt's Team",
         "id":23,
         "ownerId":11,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":11,
                "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
                "emailAddress":"jholt456@gmail.com"}]}

Unstar a Thing

Unstars the thing with the specified thingId in the team thing application.

End point
PUT api/thing/{thingId}/unstar

Request Parameters
* = Required
*userId: int

Example Request

{ userId: 12 }

Response
Returns the unstarred thing

{"id":141,
 "description":null,
 "status":"Completed",
 "isStarred":true,
 "dateCreated":"2012-05-11T17:12:02.143",
 "owner":{"id":11,
          "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
          "emailAddress":"jholt456@gmail.com"},
 "team":{"name":"Matt's Team",
         "id":23,
         "ownerId":11,
         "administrators":[11],
         "isPublic":false,
         "imagePath":"/images/GenericUserImage.gif"},
 "assignedTo":[{"id":11,
                "imagePath":"https://lh6.googleusercontent.com/-ZE3J3PaJ9hY/AAAAAAAAAAI/AAAAAAAAABM/pjdMLXkiz2g/photo.jpg",
                "emailAddress":"jholt456@gmail.com"}]}

Delete a Thing

Deletes the thing with the specified thingId from the team thing application.
This can only be done by a thing's owner

End point
DELETE api/thing/{thingId}

Request Parameters
* = Required
*deletedById : int

Example Request

{"DeletedById":6}

Response
204 Indicates Success