Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update to include artifacts and versions

...

POST http://api.staging.milkbooks.com/user HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
Host: api.staging.milkbooks.com
Content-Length: 58
{"EmailAddress":"test1@exampletest2@example.com","Password":"test1234"}

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: FriWed, 1926 AprJun 2013 0300:2129:4617 GMT
Content-Length: 4344
{"Id":230,"EmailAddress":"test1@exampletest2@example.com"}

Creating A Session

Request:

POST http://api.staging.milkbooks.com/session HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
Host: api.staging.milkbooks.com
Content-Length: 58
{"EmailAddress":"test1@exampletest2@example.com","Password":"test1234"}

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: FriWed, 1926 AprJun 2013 0300:2229:0440 GMT
Content-Length: 36
{"SessionId":"SWzj84qs39YaFMpkofnaaH41qm9/cnNEMCz3CAgs"}

Listing Products

Request:

GET http://api.staging.milkbooks.com/products HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
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: FriWed, 1926 AprJun 2013 0300:3830:5520 GMT
Content-Length: 56121
{"Products":[{"Id":105187106697,"Name":"Japanese Photobook","Price":39.9800}]9500},{"Id":108089,"Name":"Test Book","Price":39.9500}]}

Creating A Project

Request:

POST http://api.staging.milkbooks.com/project HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: SWzj84qs39YaFMpkofnaaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 42
{"Name":"Test Project","ProductId":101397106697}

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: FriWed, 1926 AprJun 2013 0300:4131:3526 GMT
Content-Length: 172479
{"Guid":"e4a6f2011a1244ca9bfad7227903be4ee92f870a47fa4326b97bb21e074fd540","Name":"Test Project","ProductId":101397106697,"CreatedDateUtcVersions":"\/Date(1366342895457)\/","LastSavedDateUtc":"\/Date(1366342895457)\/"}

Listing Projects

Request:

GET[{"Number":1,"IsComplete":false,"Artifacts":[{"Name":"small_cover_sticker","IsComplete":false,"FileMimeType":"application/pdf"},{"Name":"pages","IsComplete":false,"FileMimeType":"application/pdf"}],"CreatedDateTimeUtc":"\/Date(1372206685926)\/","LastSavedDateTimeUtc":"\/Date(1372206685926)\/"}],"CreatedDateUtc":"\/Date(1372206685926)\/","LastSavedDateUtc":"\/Date(1372206685926)\/"}

Completing A Required Artifact

Request:

PUT http://api.staging.milkbooks.com/project/e92f870a47fa4326b97bb21e074fd540/version/1/artifact/small_cover_sticker HTTP/1.1
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: aH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 238
---------------------------acebdf13572468
Content-Disposition: form-data; name="fieldNameHere"; filename="book_small_cover_sticker_32100.pdf"
Content-Type: application/pdf
PDF 1.4 etc...
---------------------------acebdf13572468--

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: Wed, 26 Jun 2013 00:33:49 GMT
Content-Length: 351
{"Number":1,"IsComplete":false,"Artifacts":[{"Name":"small_cover_sticker","IsComplete":true,"FileMimeType":"application/pdf","FileSize":14,"FileMd5":"05A188351B5848E2FD5B062D80D1A754"},{"Name":"pages","IsComplete":false,"FileMimeType":"application/pdf"}],"CreatedDateTimeUtc":"\/Date(1372231885927)\/","LastSavedDateTimeUtc":"\/Date(1372231885927)\/"}

Completing A Required Artifact which completes a Version

Request:

PUT http://api.staging.milkbooks.com/project/e92f870a47fa4326b97bb21e074fd540/version/1/artifact/pages HTTP/1.1
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: aH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 224
---------------------------acebdf13572468
Content-Disposition: form-data; name="fieldNameHere"; filename="book_pages_32100.pdf"
Content-Type: application/pdf
PDF 1.4 etc...
---------------------------acebdf13572468--

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: Wed, 26 Jun 2013 00:34:18 GMT
Content-Length: 408
{"Number":1,"IsComplete":true,"Artifacts":[{"Name":"small_cover_sticker","IsComplete":true,"FileMimeType":"application/pdf","FileSize":14,"FileMd5":"05A188351B5848E2FD5B062D80D1A754"},{"Name":"pages","IsComplete":true,"FileMimeType":"application/pdf","FileSize":14,"FileMd5":"05A188351B5848E2FD5B062D80D1A754"}],"CreatedDateTimeUtc":"\/Date(1372231885927)\/","LastSavedDateTimeUtc":"\/Date(1372231885927)\/"}

Listing Projects

Request:

GET http://api.staging.milkbooks.com/projects HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id:
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: Wed, 26 Jun 2013 00:35:01 GMT
Content-Length: 609
{"Projects":[{"Guid":"e92f870a47fa4326b97bb21e074fd540","Name":"Test Project","ProductId":106697,"Versions":[{"Number":1,"IsComplete":true,"Artifacts":[{"Name":"small_cover_sticker","IsComplete":true,"FileMimeType":"application/pdf","FileSize":14,"FileMd5":"05A188351B5848E2FD5B062D80D1A754"},{"Name":"pages","IsComplete":true,"FileMimeType":"application/pdf","FileSize":14,"FileMd5":"05A188351B5848E2FD5B062D80D1A754"}],"CreatedDateTimeUtc":"\/Date(1372231885927)\/","LastSavedDateTimeUtc":"\/Date(1372231885927)\/"}],"CreatedDateUtc":"\/Date(1372231885927)\/","LastSavedDateUtc":"\/Date(1372231885927)\/"}]}

Creating A Version

Request:

POST http://api.staging.milkbooks.com/project/e92f870a47fa4326b97bb21e074fd540/version HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: aH41qm9/cnNEMCz3CAgs
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: Wed, 26 Jun 2013 01:17:23 GMT
Content-Length: 293
{"Number":2,"IsComplete":false,"Artifacts":[{"Name":"small_cover_sticker","IsComplete":false,"FileMimeType":"application/pdf"},{"Name":"pages","IsComplete":false,"FileMimeType":"application/pdf"}],"CreatedDateTimeUtc":"\/Date(1372209443625)\/","LastSavedDateTimeUtc":"\/Date(1372209443625)\/"}

Creating A Basket

Request:

POST http://api.staging.milkbooks.com/projectsbasket HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: SWzj84qs39YaFMpkofnaaH41qm9/cnNEMCz3CAgs
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: FriWed, 1926 AprJun 2013 0300:4235:3320 GMT
Content-Length: 197157
{"Projects":[{"Guid":"e4a6f2011a1244ca9bfad7227903be4e80d968618ae54b4bae699a3b39aaadf5","NameLines":"Test Project"[],"ProductIdOrderTotal":1013970,"CreatedDateUtc":"\/Date(1366368095457-07001372206920892)\/","LastSavedDateUtc":"\/Date(1366368095457-07001372206920892)\/"}]}

...

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

Request:

POST http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/line HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: SWzj84qs39YaFMpkofnaaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
contentContent-lengthLength: 063
{"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","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, 19 Apr 2013 03:43:44 GMT
Content-Length: 131Wed, 26 Jun 2013 00:36:28 GMT
Content-Length: 376
{"Line":{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000},"Basket":{"Guid":"30296cecb5f54694923ede68545c6d7280d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000}],"OrderTotal":039.95000000,"CreatedDateUtc":"\/Date(13663430242821372206920000)\/","LastSavedDateUtc":"\/Date(13663430242821372206988626)\/"}}

Listing Baskets

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: SWzj84qs39YaFMpkofnaaH41qm9/cnNEMCz3CAgs
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: FriWed, 1926 AprJun 2013 0300:4536:0852 GMT
Content-Length: 277268
{"Baskets":[{"Guid":"1ef8dc7d86a14454b3b0b880b36c82ff80d968618ae54b4bae699a3b39aaadf5","Lines":[],{"OrderTotal":0,"CreatedDateUtc":"\/Date(1366341815000)\/","LastSavedDateUtc":"\/Date(1366341815000)\/"},{"Guid":"30296cecb5f54694923ede68545c6d72","Lines":[Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.9500}],"OrderTotal":039.9500,"CreatedDateUtc":"\/Date(13663430240001372206920000)\/","LastSavedDateUtc":"\/Date(13663430240001372206988000)\/"}]}

...

Getting a Basket (

...

with Lines)

Request:

POSTGET http://api.staging.milkbooks.com/basket/791692a778ad4837a421e4a06ae1d6b6/line80d968618ae54b4bae699a3b39aaadf5 HTTP/1.1
Contentcontent-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: iqbQfKWTlXrQS96GXa8MaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 63{"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":1}
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: FriWed, 2426 MayJun 2013 0200:3938:2725 GMT
Content-Length: 376{"Line":{"Id":557249,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":1,"Total":39.95000000},"Basket":-Length: 256
{"Guid":"791692a778ad4837a421e4a06ae1d6b680d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":557249588670,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3ae92f870a47fa4326b97bb21e074fd540","Quantity":17,"Total":39279.950000006500}],"OrderTotal":39279.950000006500,"CreatedDateUtc":"\/Date(13693630640001372206920000)\/","LastSavedDateUtc":"\/Date(13693631677931372207083000)\/"}}

...

Updating a Basket

...

Line Quantity

Request:

GETPUT http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/0accd97500e2431e97d5d951f18a6f28line/588670 HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccdaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 0
Content-Length: 63
{"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","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: FriWed, 1726 MayJun 2013 0400:2138:1903 GMT
Content-Length: 254Length: 379
{"Line":{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":7,"Total":279.65000000},"Basket":{"Guid":"0accd97500e2431e97d5d951f18a6f2880d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":485630588670,"ProjectGuid":"2babab85eaac428a9614d30e06daf737e92f870a47fa4326b97bb21e074fd540","Quantity":17,"Total":39279.980065000000}],"OrderTotal":39279.980065000000,"CreatedDateUtc":"\/Date(13687643720001372206920000)\/","LastSavedDateUtc":"\/Date(13687644710001372207083630)\/"}}

...

Deleting a Basket Line

...

Request:

PUTDELETE http://api.staging.milkbooks.com/basket/791692a778ad4837a421e4a06ae1d6b680d968618ae54b4bae699a3b39aaadf5/line/557249588670 HTTP/1.1
Contentcontent-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: iqbQfKWTlXrQS96GXa8MaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 63
{"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":7}
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: FriWed, 2426 MayJun 2013 0200:4139:5506 GMT
Content-Length: 379168
{"Line":{"Id":557249,"ProjectGuid":"359b5bb8229d499dbb5d8f9dd3e70f3a","Quantity":7,"Total":279.65000000},"Basket":{"Guid":"791692a778ad4837a421e4a06ae1d6b6","Lines":[{"Id":557249,"ProjectGuid":{"359b5bb8229d499dbb5d8f9dd3e70f3aGuid",:"Quantity80d968618ae54b4bae699a3b39aaadf5":7,"TotalLines":279.65000000}[],"OrderTotal":279.650000000,"CreatedDateUtc":"\/Date(13693630640001372206920000)\/","LastSavedDateUtc":"\/Date(13693633151041372207146747)\/"}}

...

Add a Basket Line back in

Request:

GETPOST http://api.staging.milkbooks.com/basketsbasket/80d968618ae54b4bae699a3b39aaadf5/line HTTP/1.1
content-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: +hJC5TsZW2JvaoEelccdaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 063
{"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","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: FriWed, 1726 MayJun 2013 0400:2240:0209 GMT
Content-Length: 270376
{"Baskets":["Line":{"Id":588671,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000},"Basket":{"Guid":"0accd97500e2431e97d5d951f18a6f2880d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":485630588671,"ProjectGuid":"2babab85eaac428a9614d30e06daf737e92f870a47fa4326b97bb21e074fd540","Quantity":71,"Total":27939.860095000000}],"OrderTotal":27939.860095000000,"CreatedDateUtc":"\/Date(13687643720001372206920000)\/","LastSavedDateUtc":"\/Date(13687645120001372207209755)\/"}]}

...

Retrieve A Checkout URL

Request:

DELETEPOST http://api.staging.milkbooks.com/basket/791692a778ad4837a421e4a06ae1d6b680d968618ae54b4bae699a3b39aaadf5/line/557249checkout HTTP/1.1
Contentcontent-type: application/json
accept: application/json
x-milk-api-key: 12345678-1234-1234-1234-123456789012
x-milk-session-id: iqbQfKWTlXrQS96GXa8MaH41qm9/cnNEMCz3CAgs
Host: api.staging.milkbooks.com
Content-Length: 063
{"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","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: FriWed, 2426 MayJun 2013 0200:4240:5327 GMT
Content-Length: 168{"Basket":153
{"GuidBasketGuid":"791692a778ad4837a421e4a06ae1d6b680d968618ae54b4bae699a3b39aaadf5","LinesCheckoutUrl":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1369363064000)\/","LastSavedDateUtc":"\/Date(1369363373666)\/"}http://checkout.api.staging.milkbooks.com/start.aspx?token=3456bbc7-0494-435f-b7da-e37d0e696500"}