You can add a new document category to your domain using this API.
| URL | {{BASE_URL}}/media/v1/insert_media_category |
| Method | POST |
| Parameters |
categoryname, string minimumaccesslevel, integer bisdefault, boolean bisblockchain, boolean bischildtransferred, boolean bismergetransferred, boolean |
| Sample Request JSON |
{ "categoryname":"Test Category", "minimumaccesslevel":"100", "bisdefault":true, "bisblockchain":true, "bischildtransferred":true, "bismergetransferred":true } |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "idmediacategory": 9 } |
| Response Codes | 200: ok |
You can get a list of Document Categories using this API.
| URL | {{BASE_URL}}/media/v1/get_media_category_list |
| Method | GET |
| Parameters | |
| Sample Request JSON | |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "isadmin": true, "domid": "d7e19951-6990-402e-a1f3-357bd375ee61", "mediacategory": [ { "nidmediacategory": 4, "categoryname": "Confidential Documents", "minimumaccesslevel": 100, "isdefault": false, "ischildtransferred": true, "ismergetransferred": true, "isblockchainauthorized": true, "isreadonly": false, "categorytoken": "00000000-0000-0000-0000-000000000000" }, { "nidmediacategory": 5, "categoryname": "Honor Declaration", "minimumaccesslevel": 100, "isdefault": false, "ischildtransferred": true, "ismergetransferred": true, "isblockchainauthorized": true "isreadonly": trie, "categorytoken": "00000000-0000-0000-0000-000000000000" } ] } |
| Response Codes | 200: ok |
You can update a Document Category sing this API.
| URL | {{BASE_URL}}/media/v1/update_media_category |
| Method | POST |
| Parameters |
nidmediacategory, integer, categoryname, string minimumaccesslevel, integer bisdefault, boolean bisblockchain, boolean bischildtransferred, boolean bismergetransferred, boolean |
| Sample Request JSON |
{ "categoryname":"Test Category", "minimumaccesslevel":"100", "bisdefault":true, "bisblockchain":true, "bischildtransferred":true, "bismergetransferred":true } |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "idmediacategory": 9, "isdefaultcategorychanged": false } |
| Response Codes | 200: ok |
This API allows you to delete a document category from your domain.
| URL | {{BASE_URL}}/media/v1/delete_media_category/{nIdcat} |
| Method | GET |
| Parameters | nIdcat, number |
| Sample Request JSON | |
| Sample Response JSON |
{ "status": "ok" } |
| Response Codes | 200: ok |
You can upload a document using this API.
| URL | {{BASE_URL}}/media/v1/insert_media |
| Method | POST |
| Parameters |
DataContent, string MediaFileName, string hasmultiplechunks, boolean islastchunk, boolean mediaidfirstchunk, string |
| Sample Request JSON |
{ "DataContent":"Base64_encoded_string", "MediaFileName":"File name", "hasmultiplechunks": 1, "islastchunk": 0, "mediaidfirstchunk": "" } |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "idmedia": 142, "mediaid": "6307b305-937b-4544-adbc-299b2dc4b8fc" } |
| Response Codes | 200: ok |
| Note |
"DataContent":"Base64_encoded_string", "MediaFileName":"File name", "hasmultiplechunks": 1, "islastchunk": 1, "mediaidfirstchunk": "142" } |
You can get an uploaded document in base64 format using this API.
| URL | {{BASE_URL}}/media/v1/get_media/{sMediaid}/{bForcefulldef} |
| Method | GET |
| Parameters |
sMediaid, string bForcefulldef, boolean |
| Sample Request JSON | |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "media": { "datacontent_lod": 2, "mediaid": "e1e0c3a3-989b-48ea-8e5d-9a0e9fd3434c", "mediaid_long": "ba53cc90bdb4aa187e9c8932da19a2271769f2251c10807cc19cfa2a52a36ee7", "mediafilename": "download.png", "mediasizekb": 1.0185546875, "datecreated": "2022-07-14T12:32:04.764", "datemodified": "2022-07-14T12:32:04.764", "idmediacategory": 3, "datacontent": "data_contents_in_base64" }, "timing": 6 } |
| Response Codes | 200: ok |
| Description |
bForcefulldef = 0: Get a preview bForcefulldef = 1: Get the whole document |
You can get a document of a blockchain-exported parcel using this API.
| URL | {{BASE_URL}}/transferability/v1/get_media_global/{sMediaid}/{bForcefulldef} |
| Method | GET |
| Parameters |
sMediaid, string bForcefulldef, boolean |
| Sample Request JSON | |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "media": { "datacontent_lod": 2, "mediaid": "2cdafeee-b018-4d08-a661-8fb716f27a8d", "mediaid_long": "511108a88f03e5e6f614f2b3bc3bd62400f5b249e1bb79ff25bcc4469e349817", "mediafilename": "test image.png", "mediasizekb": 110.3271484375, "datecreated": "2022-08-03T10:43:00.243", "datemodified": "2022-08-03T10:43:00.243", "datacontent": “base64image”, }, "timing": 9 } |
| Response Codes |
200: ok E118: inaccessible media |
| NOTE |
The parcel should be exported with media (need to select the media when exporting). Then it is needed to get the parcel details with another domain (cannot use the same domain we used to export). Then it returns the “smediaidglobal” under “ledger_fields → Value_Memo” Use this “smediaidglobal” to get the media globally. |
You can set a document category to an uploaded document using this API.
| URL | {{BASE_URL}}/media/v1/update_media_set_category |
| Method | POST |
| Parameters |
nidmediacategory, integer mediaid, string |
| Sample Request JSON |
{ "nidmediacategory":4, "mediaid":"b479a21d-6703-4241-a745-ed48c9089937" } |
| Sample Response JSON |
{ "status": "ok", "isvalid": true } |
| Response Codes | 200: ok |
You can filter all the documents and get a list using this API.
| URL | {{BASE_URL}}/media/v2/get_media_list |
| Method | POST |
| Parameters |
sparcelid, string dcreatedfrom, date dcreatedto, date nlimitfrom, integer nlimitto, integer filename, string |
| Sample Request JSON |
{ "sparcelid": null, "dcreatedfrom":20230509, "dcreatedto":20230509, "nlimitfrom":0, "nlimitto":65, "sfilename": null } |
| Sample Response JSON |
{ "status": "ok", "isvalid": true, "domid": "d7e19951-6990-402e-a1f3-357bd375ee61", "media": [ { "mediaid": "e1cc564b-2fe2-48d1-90e3-0706bddd6700", "filename": "theme_demo2.zip", "numberofchunks": 14, "category_name": "Default Category", "category_token": "de9b42a4-2053-4ef6-b9e3-44f2aa13f035", "datecreated": "2023-05-09T13:23:16.845", "datemodified": "2023-05-09T13:23:16.845", "total_size_bytes": 0 }, { "mediaid": "4fc7d7c2-53fa-4856-95b7-ecbc8f8669a7", "filename": "Gemapp-Contact screen Sequence format.pdf", "numberofchunks": 1, "category_name": "Invoices", "category_token": "00000000-0000-0000-0000-000000000000", "datecreated": "2023-05-08T10:22:41.688", "datemodified": "2023-05-08T10:22:44.873", "parcel": [ { "parcelid": "408a35ed-99be-48da-8132-242d535efd1d", "reference": "6764", "weight": 110, "numberofstones": 0 } ], "total_size_bytes": 0 } ], "number_medias": 2 } |
| Response Codes | 200: ok |
| Note: | If you are not going to filter by “sparcelid” or “sfilename”, keep these parameters “empty” |
You can delete a document using this API.
| URL | {{BASE_URL}}}/media/v1/delete_media/{sMediaid}/{bForceUnlinkAll} |
| Method | GET |
| Parameters |
sMediaid, string bForcefulldef, integer (0,1) |
| Sample Request JSON | |
| Sample Response JSON |
If the given media is not linked to a parcel, you can use bForcefulldef = 0; { "status": "ok", "number_linked_parcels": 0, "info": "media deleted 853387f7-63ba-4088-9a4e-87213b585692" }
If the given media is linked to one or more parcels, by using bForcefulldef = 0 you can get the list of linked parcels; { "status": "ok", "number_linked_parcels": 3, "linked_parcels": [ { "parcelid": "8d30b77c-f500-40c6-a5ae-de070ea272ac", "reference": "Test Parcel", "weight": 0, "numberofstones": 0 } ] }
If the given media is linked to one or more parcels, by using bForcefulldef = 1 you can delete the media and unlink that media from parcels; { "status": "ok", "number_linked_parcels": 3, "linked_parcels": [ { "parcelid": "8d30b77c-f500-40c6-a5ae-de070ea272ac", "reference": "Test Parcel", "weight": 0, "numberofstones": 0 }, { "info": "Successfully deleted the association between the media and the parcel" } ], "info": "media deleted 634ae183-80df-461a-aa1a-44cd984c2b8b" }
|
| Response Codes | 200: ok |
| Note: |
bForceUnlinkAll=0: The deletion will only work if no parcel is linked to it. If this is the case, a list of linked parcels is given. bForceUnlinkAll=1: The media will be deleted, and all the linked parcels will unlinked |