IPFS APIs¶
This section shows the Rest API end-points of IPFS.
Table of contents
Download Firmware¶
- GET /firmware:id¶
Get a device.
- Request Headers
Content-Type – application/json
x-access-token – JWT-TOKEN
Example request:
$ curl -X GET 'https://ipfs-server/firmware/:cid' \ -H 'x-access-token: <JWT-TOKEN>' \ --header 'Content-Type: application/json'
var request = require('request'); var options = { 'method': 'GET', 'url': 'https://ipfs-server/firmware/:cid', 'headers': { 'x-access-token': '<JWT-TOKEN>', }, }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
import requests url = "https://ipfs-server/firmware/:cid" headers = { 'x-access-token': '<JWT-TOKEN>', } response = requests.request("GET", url, headers=headers) print(response.text)
<?php $client = new http\Client; $request = new http\Client\Request; $request->setRequestUrl('https://ipfs-server/firmware/:cid'); $request->setRequestMethod('GET'); $body = new http\Message\Body; $request->setOptions(array()); $request->setHeaders(array( 'x-access-token' => '<JWT-TOKEN>', )); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody();
Example response:
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – OK
404 Not Found – Not Found