Update Site
PUT /sites/{siteId}
PUT
/sites/{siteId}
Using a siteId
you can update an existing site by providing a new CID for the website content. This requires uploading the new site and the making another request with the CID.
import { PinataSDK } from "pinata-web3"
const pinata = new PinataSDK({
pinataJwt: "",
pinataGateway: ""
})
const keyReq = await fetch("https://api.orbiter.host/keys/upload_key", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Orbiter-API-Key": "<YOUR-API-KEY>"
},
body: null
})
const keyRes = await keyReq.json()
const files: File[] = [] // Get a folder of files either locally or through a front end
const upload = await pinata.upload.fileArray(files).key(keyRes.data)
const siteId = "36a7cbd9-4d48-4f4c-90f2-557299bf917f" // Can be obtains with GET /sites?domain=my=site
const updateSite = await fetch(`https://api.orbiter.host/sites/${siteId}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Orbiter-API-Key": "<YOUR-API-KEY>"
},
body: JSON.stringify({
cid: upload.IpfsHash,
})
})
Authorizations
Parameters
Path Parameters
siteId
required
string
Request Body
object
cid
string
Examples
Responses
200
Update Site
object
message
string