API Reference
Overview
JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.
JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format.
Djib API is mainly implemented as JSON RPC 2.0 with two exceptions:
The health check endpoint that provides a health-check mechanism for load balancers or other network infrastructure use.
Regular HTTP post to ensure large file support and multiple files supporting the upload and download endpoint.
Endpoints
Error Codes
JSON-RPC standard error code
Standard error codes and their corresponding meanings are as follows:
Djib RPC Error Code
Non-RPC API
Health Check
GET
https://{api_url}/health
Provides a health-check mechanism for load balancers or other network infrastructure use. It always returns HTTP 200 OK response with a body of "ok", "degraded", or "unknown".
Upload file(s)
POST
https://{api_url}/upload
This method enables users to upload their files on the IPFS network and their drive.
Path Parameters
Headers
Download file
GET
https://{api_url}/download
This method enables users to download their file on their drive.
Path Parameters
Headers
raw binary file
Download shared file
GET
https://{api_url}/download-shared
This method enables users to download their shared file on their drive.
Path Parameters
Headers
Confirm email
GET
https://{api_url}/email-confirm/:token
This method confirm user email
Path Parameters
RPC Methods
handshake
Creates a message for signing private drive session authorization
Parameters
<string>
- A PublickKey of account as base-58 encoded string
Results
<string>
- An string message for signing on client wallet
Example
Request:
Result:
auth
Returns an access token for authorizing a private drive session
Parameters
<string>
- A PublicKey of account as base-58 encoded string<string>
- A signed message signature as base-58 encoded string
Results
<string>
- An access token as base-58 encoded string
Example
Request:
Result:
estimate
Estimates file storage price based on Djib Token for use on private drive storage or public drive uploading
Parameters
<string>
- Token<number>
- Requested size<string>
- Unit of size ["KB
", "MB
", "GB
", "TB
"]
Results
<float>
- Estimated price based on Djib Token
Example
Request:
Result:
createPayment
Creates Solana Pay standard URL for paying Djib Token used on buying storage.
Parameters
<string>
- An access token as base-58 encoded string<number>
- Requested size<string>
- Unit of size ["KB
", "GB
", "TB
"]
Results
<object>
- A JSON object containing:payment_url: <number>
- Solana Pay standard URLtracking_code: <string>
- A code to track transaction status
Example
Request:
Result:
confirmPayment
Confirms the storage payment and returns the final status of payment.
Parameters
<string>
- An access token as base-58 encoded string<string>
- A code to track transaction status
Results
<object>
- A JSON object containing:finalized: <string>
- Status of finalizationsignature: <string>
- Signature of transaction
Example
Request:
Result:
buyStorage
Buy drive storage on Djib private network. You can use a payment tracking code or credit balance.
Parameters
<string>
- An access token as base-58 encoded string<object>
- A JSON object containing:tracking_code: <string>
- TrackingCode of paymentsize: <string>
- Requested sizeunit: <string>
- Unit of size ["KB
", "MB
", "GB
", "TB
"]ref_code: <string>
- PublicKey of invitation
Results
<object>
- A JSON object containing:<string>
- A status message ["success
" or "failed
"]
Example
Request:
Result:
status
Returns status of drive.
Parameters
<string>
- An access token as base-58 encoded string
Results
<object>
- A JSON object containing:cloud: <object>
- A JSON object containingused_size_kb: <float>
- Used size of drive storage in KBtotal_size_kb: <float>
- Total size of drive storage in KBcreated_at: <date>
- Date of drive creationupdated_at: <date>
- Date of last modification on drive
prizes: <array>
- Set of prizescredit: <float>
- Credit balance
Example
Request:
Result:
claimPrize
Claims prizes for participatory activities
Parameters
<string>
- An access token as base-58 encoded string
Results
<string>
- A success message
Example
Request:
Result:
createFolder
Creates new folder on drive.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to folder<string>
- Folder name
Results
<string>
- Created folder path
Example
Request:
Result:
lsDrive
Returns list of stored objects on drive.
Parameters
<string>
- An access token as base-58 encoded string<string>
- A Path of stored objects on drive
Results
<array>
- An array of JSON objects containing:file_name: <string>
- Path of stored object on driveextension: <string>
- Extension of stored object on drivesize_byte: <float>
- Size of stored object on drive in bytesis_folder: <bool>
- Is stored object is folder or notis_favourite: <bool>
- Is stored object selected as favourite or notpath: <string>
- A path to listed objectparent: <string>
- A path to parent of listed objectcontent_type: <string>
- The content_type header of selcted filepublic_link: <string>
- Link of file on IPFS public network if file has been shared publiclycreated_at: <date>
- Date of object creationupdated_at: <date>
- Date of last modification on object
Example
Request:
Result:
destroyDrive
Destroys user drive and all contents except publicly shared files.
Parameters
<string>
- An access token as base-58 encoded string
Results
<string>
- A success message
Example
Request:
Result:
shareFromDrive
Shares private objects on Djib public network.
Parameters
<string>
- An access token as base-58 encoded string<string>
- A path to file
Results
<string>
- shared objects public URL
Example
Request:
Result:
search
Searches objects on drive.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Keyword<object>
- A JSON object containing:extension: <string>
- Extension of target objectpath: <string>
- Path to target object
<string>
- Name of object
Results
<array>
- An array of JSON objects containing:file_name: <string>
- Path of stored object on driveextension: <string>
- Extension of stored object on drivesize_byte: <float>
- Size of stored object on drive in bytesis_folder: <bool>
- Is stored object is folder or notpath: <string>
- A path to listed objectparent: <string>
- A path to parent of listed objectpublic_link: <string>
- Link of file on IPFS public network if file has been shared publiclycreated_at: <date>
- Date of object creationupdated_at: <date>
- Date of last modification on object
Example
Request:
Result:
recentFiles
Returns list of recently interacted files on private drive.
Parameters
<string>
- An access token as base-58 encoded string<int>
- Number of recent files
Results
<array>
- An array of JSON objects containing:file_name: <string>
- Path of stored object on driveextension: <string>
- Extension of stored object on drivesize_byte: <float>
- Size of stored object on drive in bytesis_folder: <bool>
- Is stored object is folder or notpath: <string>
- A path to listed objectparent: <string>
- A path to parent of listed objectpublic_link: <string>
- Link of file on IPFS public network if file has been shared publiclycreated_at: <date>
- Date of object creationupdated_at: <date>
- Date of last modification on object
Example
Request:
Result:
moveTrash
Moves objects into trash.
Parameters
<string>
- An access token as base-58 encoded string<array>
- An array containing objects paths
Results
<string>
- A success message
Example
Request:
Result:
lsTrash
Returns list of moved objects on trash.
Parameters
<string>
- An access token as base-58 encoded string
Results
<array>
- An array of JSON objects containing:file_name: <string>
- Path of stored object on driveextension: <string>
- Extension of stored object on drivesize_byte: <float>
- Size of stored object on drive in bytesis_folder: <bool>
- Is stored object is folder or notis_favourite: <bool>
- Is stored object selected as favourite or notpath: <string>
- A path to listed objectparent: <string>
- A path to parent of listed objectcontent_type: <string>
- The content_type header of selcted filepublic_link: <string>
- Link of file on IPFS public network if file has been shared publiclycreated_at: <date>
- Date of object creationupdated_at: <date>
- Date of last modification on objectdeleted_at: <date>
- Date of moving to trash
Example
Request:
Result:
restoreFromTrash
Restores object from trash.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Object path on trash<string>
- Delete date of object
Results
<string>
- A success message
Example
Request:
Result:
setFavorite
Marks object as favorite.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Object path on drive
Results
<string>
- A success message
Example
Request:
Result:
lsFavorite
Returns list of marked objects as favorite on drive.
Parameters
<string>
- An access token as base-58 encoded string
Results
<array>
- An array of JSON objects containing:file_name: <string>
- Path of stored object on driveextension: <string>
- Extension of stored object on drivesize_byte: <float>
- Size of stored object on drive in bytesis_folder: <bool>
- Is stored object is folder or notis_favourite: <bool>
- Is stored object selected as favourite or notpath: <string>
- A path to listed objectparent: <string>
- A path to parent of listed objectcontent_type: <string>
- The content_type header of selcted filepublic_link: <string>
- Link of file on IPFS public network if file has been shared publiclycreated_at: <date>
- Date of object creationupdated_at: <date>
- Date of last modification on object
Example
Request:
Result:
unsetFavorite
Unsets the object mark from favorite.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive
Results
<string>
- A success message
Example
Request:
Result:
rename
Renames an object on private drive.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<string>
- New name for specified object
Results
<string>
- A success message
Example
Request:
Result:
move
Moves an object to another directory.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<string>
- New directory to move in
Results
<string>
- A success message
Example
Request:
Result:
copy
Copies an object to another directory.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<string>
- New directory to copy in
Results
<string>
- A success message
Example
Request:
Result:
duplicate
Duplicates an object .
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive
Results
<string>
- A success message
Example
Request:
Result:
lsPublic
Returns list of publicly shared files.
Parameters
<string>
- An access token as base-58 encoded string<bool>
- Flag to set only public files
Results
<array>
- An array of JSON objects containing:cid: <string>
- Cid of shared filelink: <string>
- Link to object on public networkfile_name: <string>
- Name of filesize_byte <float>
- Size of stored object on drive in bytescontent_type: <string>
- The content_type header of selcted filedrive_path: <string>
- Path to object on private drivecreated_at: <date>
- Date of object creation
Example
Request:
Result:
savePublic
Saves list of public files on private drive.
Parameters
<string>
- An access token as base-58 encoded string<array>
- An array of publicly shared objects<string>
- Path on private drive to save public files
Results
<string>
- A success message
Example
Request:
Result:
lsFileShares
List all sharing records of a file.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive
Results
<string>
- A success message
Example
Request:
Result:
lsShareWithMe
List of all objects that shared with user.
Parameters
<string>
- An access token as base-58 encoded string<object>
- A JSON objects containing:path: <string>
- Path to object on private driveowner: <string>
- Email address of file ownerpassword: <string>
- Password of file if the file locked
Results
<string>
- A success message
Example
Request:
Result:
lsShareByMe
List of all objects that shared by user.
Parameters
<string>
- An access token as base-58 encoded string
Results
<string>
- A success message
Example
Request:
Result:
shareObject
Share an object.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<object>
- A JSON objects containing:path: <string>
- Path to object on private driveowner: <string>
- Email address of file ownerpassword: <string>
- Password of file if the file locked
Results
<string>
- Sharing code/link of object
Example
Request:
Result:
revokeShares
Delete sharing records of an object.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<array>
- An array of sharing codes/links
Results
<string>
- A success message
Example
Request:
Result:
getSharedByLink
Get shared record by link/code.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<object>
- A JSON objects containing:path: <string>
- Path to object on private driveowner: <string>
- Email address of file ownerpassword: <string>
- Password of file if the file locked
Results
<string>
- A sharing path for exploring by lsShareWithMe
Example
Request:
Result:
rmSharedWithMe
Remove sharing record.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<string>
- Owner email address
Results
<string>
- A success message
Example
Request:
Result:
deleteTrash
Delete an object from trash permanently.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path to object on private drive<string>
- Object deleted at date
Results
<string>
- A success message
Example
Request:
Result:
emptyTrash
Erase all trash objects permanently.
Parameters
<string>
- An access token as base-58 encoded string
Results
<string>
- A success message
Example
Request:
Result:
getProfile
Get user profile information.
Parameters
<string>
- An access token as base-58 encoded string
Results
<object>
- A JSON objects containing:email: <string>
- User email addressname: <string>
- User full nameavatar: <string>
- Base64 encoded avatar fileref_code: <string>
- User referral codeconfirmation: <string>
- User email confirmation token
Example
Request:
Result:
setProfile
Set profile information.
Parameters
<string>
- An access token as base-58 encoded string<object>
- A JSON objects containing:email: <string>
- User email addressname: <string>
- User full nameavatar: <string>
- Base64 encoded avatar file
Results
<string>
- A success message
Example
Request:
Result:
resendVerificationEmail
Resend verification email for confirming.
Parameters
<string>
- An access token as base-58 encoded string
Results
<string>
- A success message
Example
Request:
Result:
createTopUpPayment
Creates Solana Pay standard URL for increasing credits balance on Djib Token.
Parameters
<string>
- An access token as base-58 encoded string<number>
- Requested size
Results
<object>
- A JSON object containing:payment_url: <number>
- Solana Pay standard URLtracking_code: <string>
- A code to track transaction status
Example
Request:
Result:
confirmTopUpPayment
Confirms the storage payment and returns the final status of payment.
Parameters
<string>
- An access token as base-58 encoded string<string>
- A code to track transaction status
Results
<object>
- A JSON object containing:finalized: <string>
- Status of finalizationsignature: <string>
- Signature of transaction
Example
Request:
Result:
lsPayments
Returns list of payment records
Parameters
<string>
- An access token as base-58 encoded string<number>
- Margin<number>
- Count
Results
<object>
- A JSON object containing:payments: <array>
- A JSON object containing:method: <string>
- Payment method ['PAYMENT
', 'TOPUP
']price: <float>
- Payed priceamount: <float>
- Requested sizeunit: <string>
- Unit of request ['KB
', 'MB
', 'GB
', 'TB
', 'NFT
']status: <string>
- Status of payment ['pending
', 'success
', 'failed
']signature: <string>
- Signature of the transactionmessage: <string>
- Message of statuspayed_at: <string>
- ISO date timecreated_at: <string>
- ISO date timeupdated_at: <string>
- ISO date time
options: <object>
- A JSON object containing:total: <number>
- Total number of all recordscount: <number>
- Countmargin: <number>
- Margin
Example
Request:
Result:
lsDailyBalance
Returns balance changes.
Parameters
<string>
- An access token as base-58 encoded string<number>
- Days ago
Results
<object>
- A JSON object containing:time: <string>
- YYYY-MM-DDbalance: <float>
- Balance
Example
Request:
Result:
createNftPayment
Creates Solana Pay standard URL for paying Djib Token used saving a file as an NFT
Parameters
<string>
- An access token as base-58 encoded string<number>
- Count of requested NFT
Results
<string>
- A success message
Example
Request:
Result:
saveAsNft
Saves a file as an NFT.
Parameters
<string>
- An access token as base-58 encoded string<string>
- Path of the object<object>
- A JSON object containing:thumbnail: <string>
- An IPFS cid of the thumbnailname: <string>
- Name of NFTsymbol: <string>
- Symbol of NFTdescription: <string>
- Description of NFTseller_fee_basis_points: <number>
- Seller fee in percentageexternal_url: <string>
- An external URLattributes: <array>
- Array of JSON object containing:trait_type: <string>
- Attribute namevalue: <string>
- Value of attribute
collection: <string>
- Collection namefamily: <string>
- Family name
Results
<object>
- A JSON object containing:cid: <string>
- An IPFS cid of the thumbnailcreated_at: <string>
- ISO date time of NFT creation time
Example
Request:
Result:
uploadAsset
Uploads NFT asset after saving NFT
Parameters
<string>
- An access token as base-58 encoded string<string>
- An IPFS cid of NFT file<string>
- ISO date time of NFT creation time<string>
- Tracking code of payment (Optional)
Results
<string>
- An IPFS cid of NFT file
Example
Request:
Result:
lsNfts
Returns list of all NFTs
Parameters
<string>
- An access token as base-58 encoded string<object>
- A JSON object containing:family: <string>
- Name of special familycount: <number>
- Countmargin: <string>
- Margin
Results
<object>
- A JSON object containing:nfts: <object>
- A JSON object containingtoken: <string>
- Token address of NFTsignature: <string>
- Signature of NFT creationmetadata: <object>
- The NFT metadata saved on blockchainmessage: <string>
- Message of NFT creation processcreated_at: <date>
- Date of drive creationupdated_at: <date>
- Date of last modification on drive
options: <object>
- A JSON object containing:family: <string>
- Family name of filtertotal: <number>
- Total number of all recordscount: <number>
- Countmargin: <number>
- Margin
Example
Request:
Result:
lsNftFamilies
Returns status of drive.
Parameters
<string>
- An access token as base-58 encoded string
Results
<array>
- cfamily: <string>
- Family namecollections: <array>
- An array of string
Example
Request:
Result:
Last updated