RESTful API in teamkube

Post on 03-Jul-2015

66 views 1 download

Transcript of RESTful API in teamkube

RESTful APIin teamKube

REST

PROTOCOLHTTP

RESOURCEURI

ACTIONGETPOST

PUTDELETE

/apple

/applePOST

/applePOST

GET/apple

GET/apple

/apple/bittenGET

GET/apple/bitten

PUT/apple/bitten

PUT/apple/bitten

DELETE/apple/bitten

DELETE/apple/bitten

SharedObject

Activity

Party

POST /{SharedObject}

GET /{SharedObject}/{id}

PUT /{SharedObject}/{id}

DELETE /{SharedObject}/{id}

POST /{SharedObject}/{id}/{relationship}

GET /{SharedObject}/{id}/{relationship}

PUT /{SharedObject}/{id}/{relationship}

task 處理紀錄

/task/d9dcf907-fcb9-4590-88d8-ece313204c9a/progressNotes

GET

/task/d9dcf907-fcb9-4590-88d8-ece313204c9a/progressNotes?pageNo=1&max=5

GET

/task/d9dcf907-fcb9-4590-88d8-ece313204c9aGET

/task/d9dcf907-fcb9-4590-88d8-ece313204c9a?fetch_minimal=true

GET

/task/d9dcf907-fcb9-4590-88d8-ece313204c9a?progressNotes.pageNo=1&progressNotes.max=5

GET

BATCH REQUEST

/task/d9dcf907-fcb9-4590-88d8-ece313204c9a?fetch_minimal=true;/task/d9dcf907-fcb9-4590-88d8-ece313204c9a/progressNotes?pageNo=1&max=5

GET

FULL-TEXT SEARCH

/sharedobject/all_objects?groupBy=type&max=10&task.orderInDescBy=modificationDate&pageNo=1&*=teamkube&types=task&searchable=true

GET

QUERY LANGUAGE

/sharedobject/all_objects?q=[type eq 'task' and coworkers[assigner].uri eq '/party/124222f9-6984-4b4b-b8f6-df68eb1f1da4' and manualDuration.endTime ge '2014-04-20T00:00:00.000 08:00' and manualDuration.endTime le '2014-04-27T00:00:00.000 08:00' and status in (drafted, responded, reopened)]&neededRoles=owners&max=10&orderInAscBy=manualDuration.endTime&pageNo=1&action=init&type=task

GET

Operator Description

eq =

ne !=

lt <

le <=

gt >

ge >=

and &

or |

in check if value occurs in the specified list

fts full-text search among structure

ftsp full-text search among primitive

/tasksPOST

REQUEST HEADERContent-Type: application/json

/task/ca06b792-4a0e-41fa-b0db-5f2c8611b302

PUT

REQUEST HEADERContent-Type: application/json

/task/ca06b792-4a0e-41fa-b0db-5f2c8611b302DELETE

SUPPORTED MIME TYPEapplication/json

multipart/form-data

STATUS CODE1xx Information

2xx Success

3xx Redirection

4xx Client Error

5xx Server Error

100 Continue, 101 Switching Protocol

200 OK, 201 Created, 202 Accept

302 Found, 304 Not Modified

400 Bad Request, 404 Not Found

500 Internal Server Error, 502 Bad Gateway

ONE MORE THING

STATELESSNESSISOLATION

Q&A