Project Artifact Examples

Completing A Required Artifact

Request:

POST https://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 https://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 https://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)\/"}

Getting Events for an Artifact

Request:

GET https://api.staging.milkbooks.com/project/e3286b26c0dc4b3ab22abdedc9d6ff59/version/1/artifact/pages/events HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZGV2Lm1pbGtib29rc3dlYnNpdGUuZWlkLmNvLm56IiwiYXVkIjoiYXBpLmRldi5taWxrYm9va3N3ZWJzaXRlLmVpZC5jby5ueiIsImV4cCI6MTM3ODgyMDI0Niwic3ViIjoiMSJ9.CNrzzyjkLo5mC9rYyEkInishBLhRVP36khY9prV527c
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/8.0
X-Powered-By: ServiceStack/3.956 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 10 Sep 2013 03:40:41 GMT
Content-Length: 125
{"Events":[{"Id":1,"EventType":"PreflightError","Message":"URL not available","EventDateTimeUtc":"\/Date(1378741227070)\/"}]}