This file contains 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
// REQUEST | |
// transactionSets POST | |
// transactionSets/23 PUT | |
{ | |
transactionIds: [315, 311] | |
} | |
// RESPONSE |
This file contains 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
// Retrieving a TransactionGroup | |
// ------------------------------------------------------ | |
// GET /transactionGroups | |
// Content-Type: application/vnd.api+json | |
// Accept: application/vnd.api+json | |
{ | |
"links": { | |
"self": "http://chromeriver.com/transactionGroups", | |
"next": "http://chromeriver.com/transactionGroups?page[offset]=2", |
This file contains 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
// I'm proposing we use the CR version at the bottom with the flexibility | |
// to later wrap it in the JSON API envelope. | |
// JSON API | |
// GET http://chromeriver.com/transactionAggregates | |
{ | |
"links": { | |
"self": "http://chromeriver.com/transactionAggregates", | |
"next": "http://chromeriver.com/transactionAggregates?page[offset]=2", |
This file contains 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
PATCH /preapprovallinitems/1 | |
{ | |
"data": { | |
"type": "preapprovallinitems", | |
"id": "1", | |
"attributes": { | |
"name": "Updated Report" | |
} | |
}, | |
"included": [{ |
This file contains 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
//GET /expensereports/1/relationships/applicablepreapprovals HTTP/1.1 | |
//Content-Type: application/vnd.api+json | |
//Accept: application/vnd.api+json | |
{ | |
"links": { | |
"self" : "/expensereports/1/relationships/applicablepreapprovals", | |
"related": "/expensereports/1/applicablepreapprovals" | |
}, | |
"data" : [ |
This file contains 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
// GET /preapprovals/1?applyExpenseHeaderId=3 HTTP/1.1 | |
{ | |
"links": { | |
"self": "/preapprovals/1" | |
}, | |
"data" : { | |
"type" : "preapprovals", | |
"id" : "1", | |
"attributes" : { |
This file contains 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
POST preapprovalsummaries | |
{ | |
data: { | |
type: 'preapprovalsummaries', | |
attributes: { | |
expenseReportId: 1, | |
preApprovalId: 2 | |
} | |
} | |
} |
This file contains 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
{ | |
eventStream: { | |
modelChange: function(stream) { | |
stream.filter(function(val){ | |
return val.model.name == 'receiptModel' | |
}) | |
.filter(function(val){ | |
return val == val.model.isNew(); | |
}) | |
.onValue(onNewReceipt); |
This file contains 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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<style type="text/css"> | |
.container { | |
margin-top: 50px; | |
} | |
</style> |
This file contains 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
var db = $.couch.db('https://username:password@username.cloudant.com/crud'); | |
var doc = {"_id":"foo", "name": "bar"}; | |
db.saveDoc(doc, { | |
success: function(response, textStatus, jqXHR){ | |
console.log(response); | |
}, | |
error: function(jqXHR, textStatus, errorThrown){ | |
console.log(errorThrown); |
OlderNewer