Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

This page contains an example of executing an end to end order against the API with HTTP level examples.

Creating a User using Internal authentication

Request:

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":"test3@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: Thu, 18 Jul 2013 00:11:54 GMT
Content-Length: 44
{"Id":33,"EmailAddress":"test3@example.com"}

Creating A Token

Request:

POST http://api.staging.milkbooks.com/token 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":"test3@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: Thu, 18 Jul 2013 00:12:33 GMT
Content-Length: 223
{"Token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I"}

Listing Products With API Key

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: Thu, 18 Jul 2013 00:15:06 GMT
Content-Length: 63
{"Products":[{"Id":106697,"Name":"Test Book","Price":39.9500}]}

Listing Products with an Application Token

Request:

GET http://api.staging.milkbooks.com/products HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcHBsaWNhdGlvbi5leGFtcGxlLmNvbSIsImF1ZCI6ImFwaS5zdGFnaW5nLm1pbGtib29rcy5jb20iLCJleHAiOjE1MzE3ODcyODcsInR5cCI6IkpXVCJ9.v60NYIgqufZWgOVk2PaAZxKjQpIaRrwxdwWHb68n0Hk
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: Thu, 18 Jul 2013 00:29:20 GMT
Content-Length: 63
{"Products":[{"Id":113359,"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
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
Host: api.staging.milkbooks.com
Content-Length: 42
{"Name":"Test Project","ProductId":106697}

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:31:26 GMT
Content-Length: 479
{"Guid":"e92f870a47fa4326b97bb21e074fd540","Name":"Test Project","ProductId":106697,"Versions":[{"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:

POST 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
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:

POST http://api.staging.milkbooks.com/project/e92f870a47fa4326b97bb21e074fd540/version/1/artifact/pages HTTP/1.1
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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)\/"}

Deferring an Artifact

Request:

POST http://api.staging.milkbooks.com/project/b0aa62e3913e486992b5eb77d5fb6180/version/1/artifact/pages HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NTc3MDc1OSwic3ViIjoiMTY5In0.vLHVUOtanH2YNN2EAExm__qPCbTgYtCH35MhDenDd6g
Host: api.staging.milkbooks.com
Content-Length: 34
{"Deferred":{"IsAvailable":false}}

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.956 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 05 Aug 2013 20:38:17 GMT
Content-Length: 260
{"Number":1,"IsComplete":true,"IsReadOnly":false,"Artifacts":[{"Name":"pages","IsComplete":true,"FileMimeType":"application/pdf","Deferred":{"IsAvailable":false}}],"CreatedDateTimeUtc":"\/Date(1375760186660)\/","LastSavedDateTimeUtc":"\/Date(1375760186660)\/"}

Listing Projects

Request:

GET http://api.staging.milkbooks.com/projects HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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/basket HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:20 GMT
Content-Length: 157
{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1372206920892)\/","LastSavedDateUtc":"\/Date(1372206920892)\/"}

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
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
Host: api.staging.milkbooks.com
Content-Length: 63
{"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: Wed, 26 Jun 2013 00:36:28 GMT
Content-Length: 376
{"Line":{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000},"Basket":{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000}],"OrderTotal":39.95000000,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372206988626)\/"}}

Listing Baskets

Request:

GET http://api.staging.milkbooks.com/baskets HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:36:52 GMT
Content-Length: 268
{"Baskets":[{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.9500}],"OrderTotal":39.9500,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372206988000)\/"}]}

Getting a Basket (with Lines)

Request:

GET http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:38:25 GMT
Content-Length: 256
{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":7,"Total":279.6500}],"OrderTotal":279.6500,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372207083000)\/"}

Updating a Basket Line Quantity

Request:

PUT http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/line/588670 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
Host: api.staging.milkbooks.com
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: Wed, 26 Jun 2013 00:38:03 GMT
Content-Length: 379
{"Line":{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":7,"Total":279.65000000},"Basket":{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588670,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":7,"Total":279.65000000}],"OrderTotal":279.65000000,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372207083630)\/"}}

Deleting a Basket Line

Request:

DELETE http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/line/588670 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:39:06 GMT
Content-Length: 168
{"Basket":{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[],"OrderTotal":0,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372207146747)\/"}}

Add a Basket Line back in

Request:

POST http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/line HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
Host: api.staging.milkbooks.com
Content-Length: 63
{"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: Wed, 26 Jun 2013 00:40:09 GMT
Content-Length: 376
{"Line":{"Id":588671,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000},"Basket":{"Guid":"80d968618ae54b4bae699a3b39aaadf5","Lines":[{"Id":588671,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000}],"OrderTotal":39.95000000,"CreatedDateUtc":"\/Date(1372206920000)\/","LastSavedDateUtc":"\/Date(1372207209755)\/"}}

Retrieve A Checkout URL

Request:

POST http://api.staging.milkbooks.com/basket/80d968618ae54b4bae699a3b39aaadf5/checkout HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:40:27 GMT
Content-Length: 153
{"BasketGuid":"80d968618ae54b4bae699a3b39aaadf5","CheckoutUrl":"http://checkout.staging.milkbooks.com/start/0c6f80cc-f5a6-4d71-94a4-7fb423c66ab3"}

Retrieve Orders

Request:

GET http://api.staging.milkbooks.com/orders HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:40:27 GMT
Content-Length: 153
{"Orders":[{"OrderGuid":"y92f870fdfgfa4326sdfsdfsdf74fd540",
"Lines":[{"Id":588671,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000}],
"OrderTotal":39.50,"Status":"Processing","CreatedDateUtc":"\/Date(-62135596800000+1300)\/",
"CompletedDateUtc":"\/Date(-62135596800000+1300)\/","LastSavedDateUtc":"\/Date(-62135596800000+1300)\/"}]}

 

Retrieve Orders for ProjectGuid

Request:

GET http://api.staging.milkbooks.com/orders?projectguid=e92f870a47fa4326b97bb21e074fd540 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:40:27 GMT
Content-Length: 153
{"Orders":[{"OrderGuid":"y92f870fdfgfa4326sdfsdfsdf74fd540",
"Lines":[{"Id":588671,"ProjectGuid":"e92f870a47fa4326b97bb21e074fd540","Quantity":1,"Total":39.95000000}],
"OrderTotal":39.50,"Status":"Processing","CreatedDateUtc":"\/Date(-62135596800000+1300)\/",
"CompletedDateUtc":"\/Date(-62135596800000+1300)\/","LastSavedDateUtc":"\/Date(-62135596800000+1300)\/"}]}

 

Retrieve Order

Request:

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:40:27 GMT
Content-Length: 153
{"OrderGuid":"93624257685e4c4293e64029c0881f86","Lines":[{"Id":535798,"ProjectGuid":"15574278972747b0b773395fdd570319","ProjectVersion":0,
"Quantity":1,"SubTotal":35.0000,"Total":35.0000,"AddOns":[]}],"OrderTotal":35.0000,"Status":"OrderReceived","CreatedDateUtc":"\/Date(1372908059000)\/",
"CompletedDateUtc":"\/Date(1372908059000)\/","LastSavedDateUtc":"\/Date(1372908209000)\/"}

 

Retrieve A Portal URL

Request:

POST http://api.staging.milkbooks.com/portal HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuc3RhZ2luZy5taWxrYm9va3MuY29tIiwiYXVkIjoiYXBpLnN0YWdpbmcubWlsa2Jvb2tzLmNvbSIsImV4cCI6MTM3NDE0MjM1Mywic3ViIjoiMzMifQ.CcMJDeRRaASEasdVbac1uqs2WYvnUQSmgt3DnuCYv_I
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:40:27 GMT
Content-Length: 153
{"PortalUrl":"http://portal.staging.milkbooks.com/start/0c6f80cc-f5a6-4d71-94a4-7fb423c66ab3"}
  • No labels