Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add examples of manipulating Basket Lines

...

{"Guid":"30296cecb5f54694923ede68545c6d72","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1366343024282)\/","LastSavedDateUtc":"\/Date(1366343024282)\/"}

...

{"Baskets":[{"Guid":"1ef8dc7d86a14454b3b0b880b36c82ff","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1366341815000)\/","LastSavedDateUtc":"\/Date(1366341815000)\/"},{"Guid":"30296cecb5f54694923ede68545c6d72","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1366343024000)\/","LastSavedDateUtc":"\/Date(1366343024000)\/"}]}

Adding a Project to a Basket (creating a Basket Line)

Request:

POST http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28/line HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccd
Host: api.staging.milkbooks.com
Content-Length: 63
{"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":1}

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3.938 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 17 May 2013 04:21:11 GMT
Content-Length: 95
{"Id":485630,"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":1,"Total":39.98000000}

Getting a Basket (with Lines)

Request:

GET http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28 HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccd
Host: api.staging.milkbooks.com
Content-Length: 0

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3.938 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 17 May 2013 04:21:19 GMT
Content-Length: 254
{"Guid":"0accd97500e2431e97d5d951f18a6f28","Lines":[{"Id":485630,"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":1,"Total":39.9800}],"OrderTotal":39.9800,"CreatedDateUtc":"\/Date(1368764372000)\/","LastSavedDateUtc":"\/Date(1368764471000)\/"}

Updating a Basket Line Quantity

Request:

PUT http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28/line/485630 HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccd
Host: api.staging.milkbooks.com
Content-Length: 63
{"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":7}

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3.938 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 17 May 2013 04:21:52 GMT
Content-Length: 96
{"Id":485630,"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":7,"Total":279.86000000}

Listing Baskets (with Lines)

Request:

GET http://api.staging.milkbooks.com/baskets HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccd
Host: api.staging.milkbooks.com
Content-Length: 0

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3.938 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 17 May 2013 04:22:02 GMT
Content-Length: 270
{"Baskets":[{"Guid":"0accd97500e2431e97d5d951f18a6f28","Lines":[{"Id":485630,"ProjectGuid":"2babab85eaac428a9614d30e06daf737","Quantity":7,"Total":279.8600}],"OrderTotal":279.8600,"CreatedDateUtc":"\/Date(1368764372000)\/","LastSavedDateUtc":"\/Date(1368764512000)\/"}]}

Deleting a Basket Line

Request:

DELETE http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28/line/485630 HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccd
Host: api.staging.milkbooks.com
Content-Length: 0

Response:

HTTP/1.1 204 Line deleted
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3.938 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 17 May 2013 04:22:28 GMT