Phu Quoc Dog
Search…
⌃K

Web3 store

This documentation describes the HTTP API for Web3.Storage, which allows you to quickly and easily build applications using decentralized data storage persisted by Filecoin and available over IPFS.

Store files

To store a file on decentralized data storage, you need send a POST request. Method parameters are supplied in positional order.
curl "https://api.phuquoc.dog/web3/storage" \
-X POST \
-F '[email protected]/path/to/pictures/picture.jpg'
-H "Authorization: Bearer 74305f35862b76db" \
-H "Content-Type: multipart/form-data"
Result:
// Some code
{
"status": true,
"message": "File is uploaded",
"data": {
"name": "13edf243597e9e92f809ab030147cdde.png",
"mimetype": "image/png",
"size": 610388,
"cid": "bafybeidzrwd5wj64hku4sr6egkhr4wksy67s52wx7qzrgowdt7fcgsyaau",
"dwebLink": "https://bafybeidzrwd5wj64hku4sr6egkhr4wksy67s52wx7qzrgowdt7fcgsyaau.ipfs.dweb.link/13edf243597e9e92f809ab030147cdde.png"
}
}

Retrieve files

Retrieve files using the get() method. You will need the CID you obtained at upload time that references the CAR for your uploaded files.
Retrieve an IPFS DAG (Directed Acyclic Graph) packaged in a CAR file by using /web3/storage{cid}, supplying the CID of the data you are interested in.
// Some code
curl -X GET https://api.phuquoc.dog/web3/storage/bafybeidzrwd5wj64hku4sr6egkhr4wksy67s52wx7qzrgowdt7fcgsyaau
-H "Content-Type: application/json" \
-H "Authorization : Bearer eyJ0eXAiOi"
Result:
// Some code
{
"status": true,
"message": "File is uploaded",
"data": {
"name": "13edf243597e9e92f809ab030147cdde.png",
"size": 610388,
"cid": "bafybeidzrwd5wj64hku4sr6egkhr4wksy67s52wx7qzrgowdt7fcgsyaau",
"dwebLink": "https://bafybeidzrwd5wj64hku4sr6egkhr4wksy67s52wx7qzrgowdt7fcgsyaau.ipfs.dweb.link/13edf243597e9e92f809ab030147cdde.png"
}
}