Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update the line examples to show the inclusion of the basket details.

...

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

Request:

POST http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28791692a778ad4837a421e4a06ae1d6b6/line HTTP/1.1
contentContent-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccdiqbQfKWTlXrQS96GXa8M
Host: api.staging.milkbooks.com
Content-Length: 63
{"ProjectGuid":"2babab85eaac428a9614d30e06daf737359b5bb8229d499dbb5d8f9dd3e70f3a","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, 1724 May 2013 0402:2139:1127 GMT
Content-Length: 95376
{"Line":{"Id":485630557249,"ProjectGuid":"2babab85eaac428a9614d30e06daf737359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":1,"Total":39.98000000}

Getting a Basket (with Lines)

Request:

GET http://95000000},"Basket":{"Guid":"791692a778ad4837a421e4a06ae1d6b6","Lines":[{"Id":557249,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":1,"Total":39.95000000}],"OrderTotal":39.95000000,"CreatedDateUtc":"\/Date(1369363064000)\/","LastSavedDateUtc":"\/Date(1369363167793)\/"}}

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/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
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/791692a778ad4837a421e4a06ae1d6b6/line/557249 HTTP/1.1
Content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: iqbQfKWTlXrQS96GXa8M
Host: api.staging.milkbooks.com
Content-Length: 63
{"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","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, 24 May 2013 02:41:55 GMT
Content-Length: 379
{"Line":{"Id":557249,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":7,"Total":279.65000000},"Basket":{"Guid":"791692a778ad4837a421e4a06ae1d6b6","Lines":[{"Id":557249,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":7,"Total":279.65000000}],"OrderTotal":279.65000000,"CreatedDateUtc":"\/Date(1369363064000)\/","LastSavedDateUtc":"\/Date(1369363315104)\/"}}

Listing Baskets (with Lines)

...

Deleting a Basket Line

Request:

DELETE http://api.staging.milkbooks.com/basket/0accd97500e2431e97d5d951f18a6f28791692a778ad4837a421e4a06ae1d6b6/line/485630557249 HTTP/1.1
contentContent-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccdiqbQfKWTlXrQS96GXa8M
Host: api.staging.milkbooks.com
Content-Length: 0

Response:

HTTP/1.1 204200 Line deletedOK
Cache-Control: private
Transfer-Encoding: chunked
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:28 GMT

...

-By: ASP.NET
Date: Fri, 24 May 2013 02:42:53 GMT
Content-Length: 168
{"Basket":{"Guid":"791692a778ad4837a421e4a06ae1d6b6","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1369363064000)\/","LastSavedDateUtc":"\/Date(1369363373666)\/"}}