-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapiary.apib
1643 lines (1119 loc) · 48 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
FORMAT: 1A
HOST: https://www.ascribe.ninja/api
# SPOOL API
**Private** & **internal** documentation for the **SPOOL API** to be used by **developers**.
In order to reflect the current state of our API, the structure of this
documentation may differ substantially from our [public version](http://docs.ascribe.apiary.io).
This is intentional, and it is hoped that this will help us improve our API.
As an example, the API paths (url routings) will be reflected in this documentation.
Hence, `/editions` and `/ownership/transfers` will be listed under different groups.
# Group Coa
## Coa [/coa/]
### Create a Certificate of Authenticity [POST]
+ Request (application/json)
+ Attributes
+ bitcoin_id (string, required) - Bitcoin address of the edition for which a certificate is requested
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "1FJb5Db74oAZSkhA7aPu8haWQNVw9ZBWE8"
}
+ Response 201 (application/json)
+ Attributes
+ coa (object, required) - Coa pseudo object containing three fields ("coa_file", "url", "url_safe")
+ success (boolean, required) - A flag indicating whether the request succeeded or not
+ Body
{
"coa": {
"coa_file": "staging/eb1e78328c46506b46a4ac4a1e378b91/img_2477.jpg/coa/coa-2016-03-01t12-13-20.pdf",
"url":"https://d1qjsxua1o9x03.cloudfront.net/staging/eb1e78328c46506b46a4ac4a1e378b91/img_2477.jpg/coa/coa-2016-03-01t12-13-20.pdf",
"url_safe":"https://d1qjsxua1o9x03.cloudfront.net/staging%2Feb1e78328c46506b46a4ac4a1e378b91%2Fimg_2477.jpg%2Fcoa%2Fcoa-2016-03-01t12-13-20.pdf"
},
"success":true
}
### List Certificates of Authenticity [GET]
Lists the certificate of authenticity associated with the requesting user.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Retrieve a Certificate of Authenticity [GET /coa/{pk}/]
Retrieves a certificate of authenticity for the given primary key.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
# Group Pieces
## Pieces [/pieces/]
### Register a Piece [POST]
When creating a piece with our API, the piece is automatically registered on the blockchain.
For marketplaces that act as a middle-man for registering pieces on ascribe.io, it is possible
to register the piece as a consignee (someone that has the right to sell the piece on the
owner's behalf).
**Note**: If you don't specify `num_editions` there will be no editions associated with the piece.
You can specify the number of editions for the piece later (see Register number of editions).
+ Request (application/json)
+ Attributes
+ file_url (string) - The url of the digital file
+ title (string) - The title of the artwork
+ artist_name (string) - The artist name
+ date_created (string, optional) - <YYYY> The year of the creation date
+ num_editions (number, optional) - The number of editions (will create as many pieces)
+ consign (boolean, optional) - Set to True if the marketplace acts as a consignee
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"file_url": "https://ascribe0.s3.amazonaws.com/local/admin@makx.com/elmo/digitalworkfile/elmo.jpg",
"title": "New Piece",
"artist_name": "New Artist"
}
+ Response 201 (application/json)
+ Attributes
+ notification (string) - A message describing the result of the request.
+ success (boolean) - A flag indicating whether the request succeeded or not
+ edition (object) - The registered piece/edition
+ Body
{
"notification": "You have successfully registered \"New Piece\" by New Artist, 1 editions.",
"success": true,
"edition": {
"id": 8542,
"title": "New Piece",
"artist_name": "New Artist",
"num_editions": 1,
"user_registered": "foo2",
"datetime_registered": "2015-07-01T13:40:28.635Z",
"date_created": "2015-01-01",
"thumbnail": "https://d1qjsxua1o9x03.cloudfront.net/local/foo2/ascribe_animated_medium/thumbnail/ascribe_animated_medium.gif.png",
"license_type": {
"name": "Attribution without restriction",
"code": "default",
"organization": "ascribe",
"url": "https://www.ascribe.io/faq/#legals"
},
"edition_number": 0,
"bitcoin_id": "13Ftd8yNMJPwRA9EaYpctd2TSjKgi9duoz",
"acl": [
"edit",
"consign",
"transfer",
"loan",
"share",
"download",
"view",
"delete",
"coa"
],
"request_action": null,
"parent": 8532
}
}
### List Pieces [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
+ Body
{
"success": true,
"count": 1,
"unfiltered_count": 1,
"next": null,
"previous": null,
"pieces": [
{
"id": 12578,
"title": "elmo",
"artist_name": "the cranberry being",
"num_editions": 10,
"user_registered": "cranberry",
"datetime_registered": "2015-09-18T12:16:47.384245Z",
"date_created": "2015-01-01",
"thumbnail": {
"id": 3726,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/eb1e78328c46506b46a4ac4a1e378b91/elmo.jpg/thumbnail/100x100/thumbnail.png",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Feb1e78328c46506b46a4ac4a1e378b91%2Felmo.jpg%2Fthumbnail%2F100x100%2Fthumbnail.png",
"mime": "image",
"thumbnail_sizes": {
"600x600": "https://d1qjsxua1o9x03.cloudfront.net/live%2Feb1e78328c46506b46a4ac4a1e378b91%2Felmo.jpg%2Fthumbnail%2F600x600%2Fthumbnail.png",
"300x300": "https://d1qjsxua1o9x03.cloudfront.net/live%2Feb1e78328c46506b46a4ac4a1e378b91%2Felmo.jpg%2Fthumbnail%2F300x300%2Fthumbnail.png",
"100x100": "https://d1qjsxua1o9x03.cloudfront.net/live%2Feb1e78328c46506b46a4ac4a1e378b91%2Felmo.jpg%2Fthumbnail%2F100x100%2Fthumbnail.png"
}
},
"license_type": {
"name": "Attribution without restriction",
"code": "default",
"organization": "ascribe",
"url": "https://www.ascribe.io/faq/#legals"
},
"bitcoin_id": "1EAuSbAGL64EwfJfPKJnZ7HPKJfbKgwsCx",
"acl": {
"acl_view_editions": true
},
"request_action": [],
"first_edition": {
"edition_number": 1,
"num_editions_available": 1,
"bitcoin_id": "1E2Ya9YT9nFphNSinz8TAkpDH5Fj32GHGi"
}
}
]
}
### Retrieve a Piece [GET /pieces/{piece_id}/]
+ Parameters
+ piece_id (integer) - The id of the Piece.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
+ Body
{
"success": true,
"piece": {
"id": 12566,
"title": "elmo",
"artist_name": "alice",
"num_editions": -1,
"user_registered": "alice",
"datetime_registered": "2015-09-18T08:15:11.853945Z",
"date_created": "2015-01-01",
"thumbnail": {
"id": 3714,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/d56b9fc4b0f1be8871f5e1c40c0067e7/elmo.jpg/thumbnail/100x100/thumbnail.png",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fd56b9fc4b0f1be8871f5e1c40c0067e7%2Felmo.jpg%2Fthumbnail%2F100x100%2Fthumbnail.png",
"mime": "image",
"thumbnail_sizes": {
"100x100": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fd56b9fc4b0f1be8871f5e1c40c0067e7%2Felmo.jpg%2Fthumbnail%2F100x100%2Fthumbnail.png",
"300x300": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fd56b9fc4b0f1be8871f5e1c40c0067e7%2Felmo.jpg%2Fthumbnail%2F300x300%2Fthumbnail.png",
"600x600": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fd56b9fc4b0f1be8871f5e1c40c0067e7%2Felmo.jpg%2Fthumbnail%2F600x600%2Fthumbnail.png"
}
},
"license_type": {
"name": "Attribution without restriction",
"code": "default",
"organization": "ascribe",
"url": "https://www.ascribe.io/faq/#legals"
},
"bitcoin_id": "1EDinmq4SNQUafkLrriSU3B3zFqSrREMpy",
"acl": {
"piece": 12566,
"edition": null,
"acl_view": true,
"acl_edit": true,
"acl_download": true,
"acl_delete": true,
"acl_create_editions": true,
"acl_view_editions": true,
"acl_share": true,
"acl_unshare": false,
"acl_transfer": false,
"acl_withdraw_transfer": false,
"acl_consign": false,
"acl_withdraw_consign": false,
"acl_unconsign": false,
"acl_request_unconsign": false,
"acl_loan": true,
"acl_loan_request": false,
"acl_coa": false
},
"request_action": [],
"extra_data": {},
"digital_work": {
"id": 4249,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/d56b9fc4b0f1be8871f5e1c40c0067e7/elmo.jpg/digitalwork/elmo.jpg",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fd56b9fc4b0f1be8871f5e1c40c0067e7%2Felmo.jpg%2Fdigitalwork%2Felmo.jpg",
"mime": "image",
"hash": "03f4ef27b84947caac6e1293a2c86324",
"encoding_urls": null,
"isEncoding": 0
},
"other_data": [],
"loan_history": [],
"private_note": null,
"public_note": null
}
}
### Retrieve all Editions of Piece [GET /pieces/{piece_id}/editions/]
+ Parameters
+ piece_id (integer) - The id of the Piece.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Delete a Piece [DELETE /pieces/{piece_id}/]
+ Parameters
+ piece_id (integer) - The id of the Piece.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
{
"notification": "You have successfully deleted <your_piece> by <yourself>.",
"success": true
}
### Retrieve COA of a Piece [GET /pieces/{pk}/coa/]
Returns the certificate of authenticity of a piece.
+ Parameters
+ pk (string) - The bitcoin address of the piece.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
# Group Editions
## Editions [/editions/]
### Register a Number of Editions [POST]
+ Request (application/json)
+ Attributes
+ piece_id (number) - The ID of the piece
+ num_editions (number) - Number of editions for the piece
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"piece_id": 1071,
"num_editions": 10
}
+ Response 201 (application/json)
{
"success": true,
"notification": "You successfully registered 10 editions for piece with ID 1ADJ5fYt1Hq4acL3e7gVr7st6SD8rZq51d."
}
### List Editions [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
+ Body
{
"success": true,
"count": 10,
"unfiltered_count": 10,
"next": null,
"previous": null,
"editions": [
{
{
"id": 10700,
"title": "soleil",
"artist_name": "The Photon Machine",
"num_editions": 5,
"user_registered": "photon",
"datetime_registered": "2015-07-14T13:58:15.060Z",
"date_created": "2013-01-01",
"thumbnail": {
"id": 1861,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/sbellem/soleil-maison-hiver/thumbnail/soleil-maison-hiver.jpg.png",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fsbellem%2Fsoleil-maison-hiver%2Fthumbnail%2Fsoleil-maison-hiver.jpg.png",
"mime": "image",
"thumbnail_sizes": null
},
"license_type": {
"name": "Attribution without restriction",
"code": "default",
"organization": "ascribe",
"url": "https://www.ascribe.io/faq/#legals"
},
"bitcoin_id": "1DtFReB1ev4vpsLyxp4ktgVV8eeK1UJDbC",
"acl": {
"piece": 10698,
"edition": 10700,
"acl_view": true,
"acl_edit": true,
"acl_download": true,
"acl_delete": true,
"acl_create_editions": false,
"acl_view_editions": true,
"acl_share": true,
"acl_unshare": false,
"acl_transfer": true,
"acl_withdraw_transfer": false,
"acl_consign": true,
"acl_withdraw_consign": false,
"acl_unconsign": false,
"acl_request_unconsign": false,
"acl_loan": true,
"acl_loan_request": false,
"acl_coa": true
},
"request_action": [],
"edition_number": 3,
"parent": 10698
}
]
}
### Retrieve an Edition [GET /editions/{bitcoin_id}/]
+ Parameters
+ bitcoin_id (string) - The bitcoin ID of the edition
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
+ Body
{
"success": true,
"edition": {
"id": 10700,
"title": "soleil",
"artist_name": "The Photon Machine",
"num_editions": 5,
"user_registered": "photon",
"datetime_registered": "2015-07-14T13:58:15.060Z",
"date_created": "2013-01-01",
"thumbnail": {
"id": 1861,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/sbellem/soleil-maison-hiver/thumbnail/soleil-maison-hiver.jpg.png",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fsbellem%2Fsoleil-maison-hiver%2Fthumbnail%2Fsoleil-maison-hiver.jpg.png",
"mime": "image",
"thumbnail_sizes": null
},
"license_type": {
"name": "Attribution without restriction",
"code": "default",
"organization": "ascribe",
"url": "https://www.ascribe.io/faq/#legals"
},
"bitcoin_id": "1DtFReB1ev4vpsLyxp4ktgVV8eeK1UJDbC",
"acl": {
"piece": 10698,
"edition": 10700,
"acl_view": true,
"acl_edit": true,
"acl_download": true,
"acl_delete": true,
"acl_create_editions": false,
"acl_view_editions": true,
"acl_share": true,
"acl_unshare": false,
"acl_transfer": true,
"acl_withdraw_transfer": false,
"acl_consign": true,
"acl_withdraw_consign": false,
"acl_unconsign": false,
"acl_request_unconsign": false,
"acl_loan": true,
"acl_loan_request": false,
"acl_coa": true
},
"request_action": [],
"edition_number": 3,
"parent": 10698,
"extra_data": {},
"digital_work": {
"id": 2115,
"url": "https://d1qjsxua1o9x03.cloudfront.net/live/sbellem/soleil-maison-hiver/digitalwork/soleil-maison-hiver.jpg",
"url_safe": "https://d1qjsxua1o9x03.cloudfront.net/live%2Fsbellem%2Fsoleil-maison-hiver%2Fdigitalwork%2Fsoleil-maison-hiver.jpg",
"mime": "image",
"hash": "e87f25b707d32e983a46da9a23aae7a2",
"encoding_urls": null,
"isEncoding": 0
},
"other_data": [],
"loan_history": [],
"private_note": null,
"public_note": null,
"hash_as_address": "128QA4dnN4pVX1U5dKNmReQMXpY7X2Mz9X",
"owner": "photon",
"btc_owner_address_noprefix": "1DtFReB1ev4vpsLyxp4ktgVV8eeK1UJDbC",
"ownership_history": [
[
"Jul. 14, 2015, 13:58:15",
"Registered by photon"
]
],
"consign_history": [],
"coa": null,
"status": [],
"pending_new_owner": null,
"consignee": null
}
}
### Delete an Edition [DELETE /editions/{bitcoin_id}/]
+ Parameters
+ bitcoin_id (string) - The bitcoin ID of the edition
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
{
"notification": "You have successfully deleted 1 editions.",
"success": true
}
# Group Ownership
## Registrations [/ownership/registrations/]
A piece is registered in the blockchain upon creation. When the number of editions
is specified, each edition is only registered in the blockchain right before any
ownership action (transfer, consign, loan, ...) has been performed.
### List all Registrations [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Retrieve a Registration [GET /ownership/registrations/{id}/]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Parameters
+ id (integer) - The ID of the registration.
+ Response 200 (application/json)
## Transfers [/ownership/transfers/]
### Initiate a Transfer of Ownership [POST]
+ Attributes
+ bitcoin_id (string, required) - The ID as the registration address of the edition
+ transferee (string, required) - The email of the new owner
+ password (string, required) - Your ascribe password
+ transfer_message (string, optional) - Additional message
+ Request (application/json)
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
"transferee": "foo@mailinator.com",
"password": "mypassword",
"transfer_message": "I would like to transfer this piece to you"
}
+ Response 201 (application/json)
{
"notification": "You have successfully transfered 1 edition(s) to foo2@mailinator.com.",
"success": true
}
### List all Transfers [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Retrieve a Transfer [GET /ownership/transfers/{id}/]
+ Parameters
+ id (integer) - The ID of the transfer.
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
## Consignments [/ownership/consigns/]
When consigning a piece, you assign the right to the consignee to sell the piece on your
behalve. Hereto, one needs to send a request for consignment to the consignee. Once
accepted by the consignee, the consignment will change state and is recorded on the blockchain.
### Consign an Edition [POST]
Send a request for consignment to the consignee.
+ Attributes
+ bitcoin_id (string, required) - The ID as the registration address of the edition
+ consignee (string, required) - The email of the consignee
+ password (string, required) - Your ascribe password
+ consign_message (string, optional) - Additional message
+ Request (application/json)
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
"consignee": "foo@mailinator.com",
"password": "mypassword",
"consign_message": "I consign this edition to you"
}
+ Response 201 (application/json)
{
"notification": "You have successfully consigned 1 edition(s), pending their confirmation(s).",
"success": true
}
+ Response 400 (application/json)
{
"errors": {"bitcoin_id": ["You don't have the appropriate rights to consign this piece"]},
"success": false
}
### List all consignments [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Confirm a Consignment [POST /ownership/consigns/confirm/]
Allows a consignee to confirm a request for consignment.
+ Attributes
+ bitcoin_id (string, required) - The bitcoin id of the edition for which consignment is being confirmed.
+ Request (application/json)
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
}
+ Response 201 (application/json)
+ Body
{
"notification": "You have succesfully confirmed consignment of art1 by art1, edition 3.",
"success": true
}
+ Response 400 (application/json)
+ Body
{
"errors": {"bitcoin_id": ["This piece is not pending for actions"]},
"success": false
}
### Deny a Consignment [POST /ownership/consigns/deny/]
Allows a consignee to deny a request for consignment.
+ Attributes
+ bitcoin_id (string, required) - The bitcoin id of the edition for which consignment is being denied.
+ Request (application/json)
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
}
+ Response 201 (application/json)
+ Body
{
"notification": "You have denied consignment of art1 by art1, edition 4.",
"success": true
}
+ Response 400 (application/json)
+ Body
{
"errors": {"bitcoin_id": ["This piece is not pending for actions"]},
"success": false
}
### Retrieve a consignment [GET /ownership/consigns/{id}/]
+ Parameters
+ id (integer) - The ID of the consignment
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
## Unconsignments [/ownership/unconsigns/]
When the consignee or owner decide that there is no more need to manage the sales of the
edition. The consignee can unconsign immediately, the owner needs to request the consignee
for an unconsignment.
### Unconsign an Edition [POST]
(Or confirm an unconsignment request.)
+ Attributes
+ bitcoin_id (string, required) - The ID as the registration address of the edition
+ password (string, required) - Your ascribe password
+ unconsign_message (string, optional) - Additional message
+ Request (application/json)
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
"password": "mypassword",
"unconsign_message": "I unconsign this piece from you. This is, I no longer manage the sales of your piece"
}
+ Response 201 (application/json)
+ Body
{
"notification": "You have successfully unconsigned 1 edition(s).",
"success": true
}
+ Response 400 (application/json)
+ Body
{
"errors": {"bitcoin_id": ["You don't have the appropriate rights to unconsign this piece"]},
"success": false
}
### List all Unconsignments [GET]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Response 200 (application/json)
### Request an unconsignment [POST /ownership/unconsigns/request/]
Action to be taken by the owner. He requests the consignee to no longer manage the sales
of the edition. The consignee needs to confirm or deny the unconsignment.
+ Attributes
+ bitcoin_id (string, required) - The ID as the registration address of the edition
+ unconsign_request_message (string, optional) - Additional message
+ Request (application/json)
+ Header
Authorization: Bearer 2GJT0yFOnHYKtp9sgNak4GURL9jpKD
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W",
"unconsign_request_message": "I unconsign this piece from you. This is, you no longer manage the sales of my piece"
}
+ Response 201 (application/json)
+ Body
{
"notification": "You have requested foo2@mailinator.com to unconsign \"art1\".",
"success": true
}
+ Response 400 (application/json)
An error will occur when trying to consign a piece that's not yours:
+ Body
{
"errors": {"bitcoin_id": ["This piece is not consigned"]},
"success": false
}
### Deny an unconsignment [POST /ownership/unconsigns/deny/]
Action taken by the consignee when the owner requests to unconsign the edition.
You can confirm or deny the unconsignment. The confirmation is treated above.
+ Attributes
+ bitcoin_id (string, required) - The ID as the registration address of the edition
+ Request (application/json)
+ Header
Authorization: Bearer 2GJT0yFOnHYKtp9sgNak4GURL9jpKD
+ Body
{
"bitcoin_id": "157od1WGsmh7ctYXEstTbsA7pzx6BoWU9W"
}
+ Response 201 (application/json)
+ Body
{
"notification": "You have denied unconsignment of art1 by art1, edition 5.",
"success": true
}
### Retrieve an Unconsignment [GET /ownership/unconsigns/{id}/]
+ Request
+ Header
Authorization: Bearer <your_api_token>
+ Parameters
+ id (integer) - The ID of the unconsignment
+ Response 200 (application/json)
## Loans for Pieces [/ownership/loans/pieces/]
### Loan a Piece [POST]
+ Request (application/json)
+ Attributes
+ piece_id (number, required) - The small integer id of the piece
+ loanee (string, required) - The email of the loanee
+ password (string, required) - Your ascribe password
+ startdate (string, required) - <YYYY-MM-DD> The start date of the loan
+ enddate (string, required) - <YYYY-MM-DD> The end date of the loan
+ terms (boolean, required) - Whether to accept the terms and conditions
+ loan_message (string, optional) - Additional message
+ gallery (string, optional) - Name of the gallery where the piece will be displayed
+ bitcoin_id (string, optional) - The ID as the registration address of the piece
+ contract_key (string, optional) - Identifier of the contract
+ Header
Authorization: Bearer <your_api_token>
+ Body
{
"piece_id": 3,
"loanee": "alice@wonderland.xyz",
"password": "secret",
"startdate": "2015-09-19",
"enddate": "2015-09-20",
"terms": true,
"loan_message": "I loan this piece to you"
}
+ Response 201 (application/json)
{
"loan": {
"startdate": "2015-09-19",
"enddate": "2015-09-20",
"btc_tx": null,
"datetime": "2016-03-24T13:47:23.864767Z",
"id": 2,
"new_btc_address": null,
"new_owner": "alice@wonderland.xyz",
"piece": {