Skip to main content

URL#

https://<endpoint-api-host>/pinning/pinByHash

For example, pinByHash API URL of Endpoint 'Hong Kong' is:

https://api-hk.decoo.io/pinning/pinByHash

Description#

Asynchronously pin an IPFS content to Decoo cloud by its content identifier. Each API call will generate a pin job, which will be picked and processed by a periodically running job. You can query the status of the job using pinJobs API.

note

In order for the job to be successfully processed, the content for the hash you provide must already be pinned by another node on the IPFS network.

Type#

POST

Headers#

"UserAccessToken": "<YOUR_ACCESS_TOKEN>"

Body#

The basic request body should be like:

{
"hashToPin": "<Hash value of the content to pin>",
"secret": "<User's digital signature>"
}

Optionally, some metadata could be attached:

"decooMetadata": {
"name": "<A custom name of the content>"
}

Response#

{
"HashToPin": "<This is the hash provided to Decoo to pin>",
"JobId": "<This is the id of the generated pin job>",
"JobStatus": "<Current status of the pin job. If the request was successful, the status should be 'queued'>"
}

Curl Example#

curl -X POST "https://api-hk.decoo.io/pinning/pinByHash" \
-H "UserAccessToken: <YOUR_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"hashToPin": "<HASH_TO_PIIN>", "decooMetadata": {"name": "My File"}, "secret": "<DIGITAL_SIGNATURE>"}'