Description
In the Nevermined ecosystem, the Nevermined Node is the technical component executed by the Publishers allowing them to provide extended data services (e.g. storage and compute).
Nevermined Node, as part of the Publisher ecosystem, includes the credentials to interact with the infrastructure (initially cloud, but could be on-premise).
Nevermined Node v0.1.5
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Authentication
- HTTP Authentication, scheme: bearer
Info
InfoController_getInfo
Code samples
# You can also use wget
curl -X GET / \
-H 'Accept: application/json'
GET / HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /
Public
Get API info
Example responses
200 Response
{
"APIversion": "1.0.4",
"docs": "http://localhost:3100/api/v1/docs"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return API Info | GetInfoDto |
Encrypt
EncryptController_doEncrypt
Code samples
# You can also use wget
curl -X POST /api/v1/node/services/encrypt \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/node/services/encrypt HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"method": "PSK-ECDSA",
"message": "Hello!"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/node/services/encrypt',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/node/services/encrypt',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/node/services/encrypt', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/node/services/encrypt', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/encrypt");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/encrypt", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/node/services/encrypt
Public
Encrypt
Body parameter
{
"method": "PSK-ECDSA",
"message": "Hello!"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | EncryptDto | true | none |
Example responses
200 Response
{}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return encrypted stuff | EncryptResult |
Access
AccessController_doAccess
Code samples
# You can also use wget
curl -X GET /api/v1/node/services/access/{agreement_id}/{index} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/node/services/access/{agreement_id}/{index} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v1/node/services/access/{agreement_id}/{index}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/api/v1/node/services/access/{agreement_id}/{index}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/node/services/access/{agreement_id}/{index}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/node/services/access/{agreement_id}/{index}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/access/{agreement_id}/{index}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/access/{agreement_id}/{index}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/node/services/access/{agreement_id}/{index}
Public
Access asset
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
index | path | number | true | none |
Example responses
200 Response
{}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return the url of asset | StreamableFile |
AccessController_doAccessProof
Code samples
# You can also use wget
curl -X GET /api/v1/node/services/access-proof/{agreement_id}/{index} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/node/services/access-proof/{agreement_id}/{index} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v1/node/services/access-proof/{agreement_id}/{index}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/api/v1/node/services/access-proof/{agreement_id}/{index}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/node/services/access-proof/{agreement_id}/{index}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/node/services/access-proof/{agreement_id}/{index}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/access-proof/{agreement_id}/{index}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/access-proof/{agreement_id}/{index}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/node/services/access-proof/{agreement_id}/{index}
Public
Access asset w/ DTP proof
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
index | path | number | true | none |
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return the url of asset | string |
AccessController_doNftAccess
Code samples
# You can also use wget
curl -X GET /api/v1/node/services/nft-access/{agreement_id}/{index} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/node/services/nft-access/{agreement_id}/{index} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v1/node/services/nft-access/{agreement_id}/{index}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/api/v1/node/services/nft-access/{agreement_id}/{index}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/node/services/nft-access/{agreement_id}/{index}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/node/services/nft-access/{agreement_id}/{index}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/nft-access/{agreement_id}/{index}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/nft-access/{agreement_id}/{index}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/node/services/nft-access/{agreement_id}/{index}
Public
Access asset
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
index | path | number | true | none |
Example responses
200 Response
{}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return the url of asset | StreamableFile |
AccessController_doNftTransfer
Code samples
# You can also use wget
curl -X POST /api/v1/node/services/nft-transfer \
-H 'Content-Type: application/json'
POST /api/v1/node/services/nft-transfer HTTP/1.1
Content-Type: application/json
const inputBody = '{
"agreementId": "0x...",
"nftHolder": "0x...",
"nftReceiver": "0x...",
"nftAmount": "1",
"nftType": "721"
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/node/services/nft-transfer',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.post '/api/v1/node/services/nft-transfer',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.post('/api/v1/node/services/nft-transfer', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/node/services/nft-transfer', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/nft-transfer");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/nft-transfer", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/node/services/nft-transfer
Public
Access asset
Body parameter
{
"agreementId": "0x...",
"nftHolder": "0x...",
"nftReceiver": "0x...",
"nftAmount": "1",
"nftType": "721"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | TransferDto | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return "success" if transfer worked | None |
AccessController_doDownload
Code samples
# You can also use wget
curl -X GET /api/v1/node/services/download/{index} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/node/services/download/{index} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('/api/v1/node/services/download/{index}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/api/v1/node/services/download/{index}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('/api/v1/node/services/download/{index}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/node/services/download/{index}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/download/{index}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/download/{index}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/node/services/download/{index}
Public
Download asset
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
index | path | number | true | none |
Example responses
200 Response
{}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return the asset | StreamableFile |
AccessController_doUpload
Code samples
# You can also use wget
curl -X POST /api/v1/node/services/upload/{backend} \
-H 'Content-Type: application/json'
POST /api/v1/node/services/upload/{backend} HTTP/1.1
Content-Type: application/json
const inputBody = '{
"encrypt": "false"
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/node/services/upload/{backend}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.post '/api/v1/node/services/upload/{backend}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.post('/api/v1/node/services/upload/{backend}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/node/services/upload/{backend}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/upload/{backend}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/upload/{backend}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/node/services/upload/{backend}
Public
Access asset
Body parameter
{
"encrypt": "false"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
backend | path | string | true | none |
body | body | UploadDto | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return the url of asset | None |
Auth
AuthController_token
Code samples
# You can also use wget
curl -X POST /api/v1/node/services/oauth/token \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/node/services/oauth/token HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"assertion": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjIyIn0.eyJpc3Mi[...omitted for brevity...]"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/node/services/oauth/token',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/node/services/oauth/token',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/node/services/oauth/token', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/node/services/oauth/token', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/node/services/oauth/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/oauth/token", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/node/services/oauth/token
Public
Login using a JWT claim for client authentication
Body parameter
{
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"assertion": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjIyIn0.eyJpc3Mi[...omitted for brevity...]"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ClientAssertionDto | true | none |
Example responses
201 Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjIyIn0.eyJpc3Mi[...omitted for brevity...]"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | The access_token | LoginDto |
401 | Unauthorized | Unauthorized access | None |
Schemas
GetInfoDto
{
"APIversion": "1.0.4",
"docs": "http://localhost:3100/api/v1/docs"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
APIversion | string | true | none | Marketplace API Version |
docs | string | true | none | API docs url |
EncryptDto
{
"method": "PSK-ECDSA",
"message": "Hello!"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
method | string | true | none | Encryption method |
message | string | true | none | Encrypted message |
EncryptResult
{}
Properties
None
StreamableFile
{}
Properties
None
TransferDto
{
"agreementId": "0x...",
"nftHolder": "0x...",
"nftReceiver": "0x...",
"nftAmount": "1",
"nftType": "721"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
agreementId | string | true | none | The agreement for NFT transfer |
nftHolder | string | true | none | NFT holder address |
nftReceiver | string | true | none | NFT receiver address |
nftAmount | number | true | none | Number of NFTs to transfer |
nftType | number | true | none | Type of NFT |
UploadDto
{
"encrypt": "false"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
encrypt | string | false | none | Encrypt uploaded data |
ClientAssertionDto
{
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"assertion": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjIyIn0.eyJpc3Mi[...omitted for brevity...]"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
grant_type | string | true | none | Type type of JWT client assertion. Must be urn:ietf:params:oauth:grant-type:jwt-bearer |
assertion | string | true | none | A single JWT |
LoginDto
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjIyIn0.eyJpc3Mi[...omitted for brevity...]"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
access_token | string | true | none | The Authorization Bearer token |