Skip to main content

GATEWAY v1.0.0

GATEWAY v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Gateway is the technical component executed by Publishers allowing them to provide extended data services. When running with our Docker images, it is exposed under http://localhost:8030.

services

get_api_v1_gateway_services_access-proof{agreement_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/access-proof/{agreement_id} \
-H 'Authorization: string'

GET /api/v1/node/services/access-proof/{agreement_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/access-proof/{agreement_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/access-proof/{agreement_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/access-proof/{agreement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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}', 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}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/access-proof/{agreement_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/access-proof/{agreement_id}

Allows to get access to an asset data file.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_access-proof{agreementid}{index}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/access-proof/{agreement_id}/{index} \
-H 'Authorization: string'

GET /api/v1/node/services/access-proof/{agreement_id}/{index} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

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 = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/access-proof/{agreement_id}/{index}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/access-proof/{agreement_id}/{index}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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{
"Authorization": []string{"string"},
}

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}

Allows to get access to an asset data file.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_access{agreement_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/access/{agreement_id} \
-H 'Authorization: string'

GET /api/v1/node/services/access/{agreement_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/access/{agreement_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/access/{agreement_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/access/{agreement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/access/{agreement_id}', 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}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/access/{agreement_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/access/{agreement_id}

Allows to get access to an asset data file.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_access{agreementid}{index}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/access/{agreement_id}/{index} \
-H 'Authorization: string'

GET /api/v1/node/services/access/{agreement_id}/{index} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

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 = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/access/{agreement_id}/{index}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/access/{agreement_id}/{index}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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{
"Authorization": []string{"string"},
}

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}

Allows to get access to an asset data file.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_compute_logs{agreementid}{execution_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/compute/logs/{agreement_id}/{execution_id} \
-H 'Authorization: string'

GET /api/v1/node/services/compute/logs/{agreement_id}/{execution_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/compute/logs/{agreement_id}/{execution_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/compute/logs/{agreement_id}/{execution_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/compute/logs/{agreement_id}/{execution_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/compute/logs/{agreement_id}/{execution_id}', 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/compute/logs/{agreement_id}/{execution_id}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/compute/logs/{agreement_id}/{execution_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/compute/logs/{agreement_id}/{execution_id}

Allows to get access to logs associated to a compute execution

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
execution_idpathstringtrueThe ID of the execution associated to a service agreement.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the execution logsNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_compute_status{agreementid}{execution_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/compute/status/{agreement_id}/{execution_id} \
-H 'Authorization: string'

GET /api/v1/node/services/compute/status/{agreement_id}/{execution_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/compute/status/{agreement_id}/{execution_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/compute/status/{agreement_id}/{execution_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/compute/status/{agreement_id}/{execution_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/compute/status/{agreement_id}/{execution_id}', 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/compute/status/{agreement_id}/{execution_id}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/compute/status/{agreement_id}/{execution_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/compute/status/{agreement_id}/{execution_id}

Allows to get access to logs associated to a compute execution

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
execution_idpathstringtrueThe ID of the execution associated to a service agreement.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the execution logsNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get__api_v1_gateway_services_consume

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/consume?consumerAddress=string&serviceAgreementId=string&url=string

GET /api/v1/node/services/consume?consumerAddress=string&serviceAgreementId=string&url=string HTTP/1.1


fetch('/api/v1/node/services/consume?consumerAddress=string&serviceAgreementId=string&url=string',
{
method: 'GET'

})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

result = RestClient.get '/api/v1/node/services/consume',
params: {
'consumerAddress' => 'string',
'serviceAgreementId' => 'string',
'url' => 'string'
}

p JSON.parse(result)

import requests

r = requests.get('/api/v1/node/services/consume', params={
'consumerAddress': 'string', 'serviceAgreementId': 'string', 'url': 'string'
})

print(r.json())

<?php

require 'vendor/autoload.php';

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/consume', 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/consume?consumerAddress=string&serviceAgreementId=string&url=string");
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() {

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/consume", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/consume

Allows download of asset data file.

Method deprecated, it will be replaced by /access in further versions

Parameters

NameInTypeRequiredDescription
consumerAddressquerystringtrueThe consumer address.
serviceAgreementIdquerystringtrueThe ID of the service agreement.
urlquerystringtrueThis URL is only valid if Nevermined Gateway acts as a proxy. Consumer can't download using the URL if it's not through Nevermined Gateway.
signaturequerystringfalseSignature of the documentId to verify that the consumer has rights to download the asset.
indexquerystringfalseIndex of the file in the array of files.

Responses

StatusMeaningDescriptionSchema
200OKRedirect to valid asset url.None
400Bad RequestOne of the required attributes is missing.None
401UnauthorizedInvalid asset data.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_download{index}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/download/{index} \
-H 'Authorization: string'

GET /api/v1/node/services/download/{index} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

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 = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/download/{index}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/download/{index}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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{
"Authorization": []string{"string"},
}

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}

Allows to download the files of an asset if you are the owner or provider of the asset.

Parameters

NameInTypeRequiredDescription
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the valid file binary.None
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

post__api_v1_gateway_services_encrypt

Code samples

# You can also use wget
curl -X POST /api/v1/node/services/encrypt \
-H 'Content-Type: application/json'

POST /api/v1/node/services/encrypt HTTP/1.1

Content-Type: application/json

const inputBody = '{
"did": "did:nv:08a429b8529856d59867503f8056903a680935a76950bb9649785cc97869a43d",
"message": "{\"url\":\"https://keyko.io/\",\"index\":0,\"checksum\":\"efb21\",\"contentLength\":\"45\",\"contentType\":\"text/csv\"}",
"method": "PSK-RSA"
}';
const headers = {
'Content-Type':'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'
}

result = RestClient.post '/api/v1/node/services/encrypt',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Content-Type': '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',
);

$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"},
}

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

Encrypt a Secret using the Secret Store, ECDSA or RSA methods

Body parameter

{
"did": "did:nv:08a429b8529856d59867503f8056903a680935a76950bb9649785cc97869a43d",
"message": "{\"url\":\"https://keyko.io/\",\"index\":0,\"checksum\":\"efb21\",\"contentLength\":\"45\",\"contentType\":\"text/csv\"}",
"method": "PSK-RSA"
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueAsset urls encryption.
» didbodystringfalseIdentifier of the asset.
» messagebodystringtrueThe message to encrypt
» methodbodystringtrueThe encryption method to use. Options (SecretStore, PSK-ECDSA, PSK-RSA)

Responses

StatusMeaningDescriptionSchema
200OKdocument successfully encrypted.None
500Internal Server ErrorErrorNone

post__api_v1_gateway_services_exec

Code samples

# You can also use wget
curl -X POST /api/v1/node/services/exec?consumerAddress=string&serviceAgreementId=string

POST /api/v1/node/services/exec?consumerAddress=string&serviceAgreementId=string HTTP/1.1


fetch('/api/v1/node/services/exec?consumerAddress=string&serviceAgreementId=string',
{
method: 'POST'

})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

result = RestClient.post '/api/v1/node/services/exec',
params: {
'consumerAddress' => 'string',
'serviceAgreementId' => 'string'
}

p JSON.parse(result)

import requests

r = requests.post('/api/v1/node/services/exec', params={
'consumerAddress': 'string', 'serviceAgreementId': 'string'
})

print(r.json())

<?php

require 'vendor/autoload.php';

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('POST','/api/v1/node/services/exec', 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/exec?consumerAddress=string&serviceAgreementId=string");
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() {

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/exec", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /api/v1/node/services/exec

Call the execution of a workflow.

Method deprecated, it will be replaced by /execute in further versions

Parameters

NameInTypeRequiredDescription
consumerAddressquerystringtrueThe consumer address.
serviceAgreementIdquerystringtrueThe ID of the service agreement.
signaturequerystringfalseSignature of the documentId to verify that the consumer has rights to download the asset.
workflowDIDquerystringfalseDID of the workflow that is going to start to be executed.

Responses

StatusMeaningDescriptionSchema
200OKCall to the nevermined-compute-api was successful.None
400Bad RequestOne of the required attributes is missing.None
401UnauthorizedInvalid asset data.None
500Internal Server ErrorErrorNone

post_api_v1_gateway_services_execute{agreement_id}

Code samples

# You can also use wget
curl -X POST /api/v1/node/services/execute/{agreement_id} \
-H 'Authorization: string'

POST /api/v1/node/services/execute/{agreement_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/execute/{agreement_id}',
{
method: 'POST',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.post '/api/v1/node/services/execute/{agreement_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.post('/api/v1/node/services/execute/{agreement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('POST','/api/v1/node/services/execute/{agreement_id}', 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/execute/{agreement_id}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/node/services/execute/{agreement_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /api/v1/node/services/execute/{agreement_id}

Call the execution of a workflow.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKCall to the compute-api was successful.None
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_nft-access-proof{agreement_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/nft-access-proof/{agreement_id} \
-H 'Authorization: string'

GET /api/v1/node/services/nft-access-proof/{agreement_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/nft-access-proof/{agreement_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/nft-access-proof/{agreement_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/nft-access-proof/{agreement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/nft-access-proof/{agreement_id}', 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-proof/{agreement_id}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/nft-access-proof/{agreement_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/nft-access-proof/{agreement_id}

Allows to get access to an asset data file holding a NFT.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_nft-access-proof{agreementid}{index}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/nft-access-proof/{agreement_id}/{index} \
-H 'Authorization: string'

GET /api/v1/node/services/nft-access-proof/{agreement_id}/{index} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/nft-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 = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/nft-access-proof/{agreement_id}/{index}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/nft-access-proof/{agreement_id}/{index}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
$response = $client->request('GET','/api/v1/node/services/nft-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/nft-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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/nft-access-proof/{agreement_id}/{index}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/nft-access-proof/{agreement_id}/{index}

Allows to get access to an asset data file holding a NFT.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_nft-access{agreement_id}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/nft-access/{agreement_id} \
-H 'Authorization: string'

GET /api/v1/node/services/nft-access/{agreement_id} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

fetch('/api/v1/node/services/nft-access/{agreement_id}',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

require 'rest-client'
require 'json'

headers = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/nft-access/{agreement_id}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/nft-access/{agreement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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}', 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}");
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{
"Authorization": []string{"string"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/node/services/nft-access/{agreement_id}", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /api/v1/node/services/nft-access/{agreement_id}

Allows to get access to an asset data file holding a NFT.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

get_api_v1_gateway_services_nft-access{agreementid}{index}

Code samples

# You can also use wget
curl -X GET /api/v1/node/services/nft-access/{agreement_id}/{index} \
-H 'Authorization: string'

GET /api/v1/node/services/nft-access/{agreement_id}/{index} HTTP/1.1

Authorization: string


const headers = {
'Authorization':'string'
};

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 = {
'Authorization' => 'string'
}

result = RestClient.get '/api/v1/node/services/nft-access/{agreement_id}/{index}',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Authorization': 'string'
}

r = requests.get('/api/v1/node/services/nft-access/{agreement_id}/{index}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
'Authorization' => 'string',
);

$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{
"Authorization": []string{"string"},
}

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}

Allows to get access to an asset data file holding a NFT.

Parameters

NameInTypeRequiredDescription
agreement_idpathstringtrueThe ID of the service agreement.
indexpathstringtrueIndex of the file in the array of files.
AuthorizationheaderstringtrueThe bearer token.

Responses

StatusMeaningDescriptionSchema
200OKReturns the file binaryNone
401UnauthorizedInvalid bearer token.None
500Internal Server ErrorErrorNone

post__api_v1_gateway_services_nft-transfer

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": "0x659a580e03df7896b35b2cde4668d26801a6eb09bb5604483e588a719d1d747a",
"nftAmount": 1,
"nftHolder": "0xA99D43d86A0758d5632313b8fA3972B6088A21BB",
"nftReceiver": "0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0"
}';
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

Asks to perform the transfer of an NFT on behalf of an nft holder.

Body parameter

{
"agreementId": "0x659a580e03df7896b35b2cde4668d26801a6eb09bb5604483e588a719d1d747a",
"nftAmount": 1,
"nftHolder": "0xA99D43d86A0758d5632313b8fA3972B6088A21BB",
"nftReceiver": "0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0"
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe request object
» agreementIdbodystringtrueThe ID of the NFT Sales service agreement.
» nftAmountbodyintegertrueThe amount of NFTs to transfer.
» nftHolderbodystringtrueThe address of the current NFT holder.
» nftReceiverbodystringtrueThe address of the intended NFT receiver.

Responses

StatusMeaningDescriptionSchema
200OKThe gateway successfuly transfered the NFTNone
400Bad RequestThe asset associated with the agreementId does not contain an NFT Sales service.None
402Payment RequiredThe nftReceiver has not locked the payment.None
405Method Not AllowedThe nftHolder has not approved the gateway to perform the NFT transfer.None
406Not AcceptableThe nftHolder does not have enough nfts to transfer.None
500Internal Server ErrorErrorNone

post__api_v1_gateway_services_nft-transfer-with-access

Code samples

# You can also use wget
curl -X POST /api/v1/node/services/nft-transfer-with-access \
-H 'Content-Type: application/json'

POST /api/v1/node/services/nft-transfer-with-access HTTP/1.1

Content-Type: application/json

const inputBody = '{
"agreementId": "0x659a580e03df7896b35b2cde4668d26801a6eb09bb5604483e588a719d1d747a",
"nftAmount": 1,
"nftHolder": "0xA99D43d86A0758d5632313b8fA3972B6088A21BB",
"nftReceiver": "0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0"
}';
const headers = {
'Content-Type':'application/json'
};

fetch('/api/v1/node/services/nft-transfer-with-access',
{
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-with-access',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Content-Type': 'application/json'
}

r = requests.post('/api/v1/node/services/nft-transfer-with-access', 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-with-access', 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-with-access");
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-with-access", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /api/v1/node/services/nft-transfer-with-access

Asks to perform the transfer of an NFT on behalf of an nft holder.

Body parameter

{
"agreementId": "0x659a580e03df7896b35b2cde4668d26801a6eb09bb5604483e588a719d1d747a",
"nftAmount": 1,
"nftHolder": "0xA99D43d86A0758d5632313b8fA3972B6088A21BB",
"nftReceiver": "0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0"
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueThe request object
» agreementIdbodystringtrueThe ID of the NFT Sales service agreement.
» nftAmountbodyintegertrueThe amount of NFTs to transfer.
» nftHolderbodystringtrueThe address of the current NFT holder.
» nftReceiverbodystringtrueThe address of the intended NFT receiver.

Responses

StatusMeaningDescriptionSchema
200OKThe gateway successfuly transfered the NFTNone
400Bad RequestThe asset associated with the agreementId does not contain an NFT Sales service.None
402Payment RequiredThe nftReceiver has not locked the payment.None
405Method Not AllowedThe nftHolder has not approved the gateway to perform the NFT transfer.None
406Not AcceptableThe nftHolder does not have enough nfts to transfer.None
500Internal Server ErrorErrorNone

post__api_v1_gateway_services_publish

Code samples

# You can also use wget
curl -X POST /api/v1/node/services/publish \
-H 'Content-Type: application/json'

POST /api/v1/node/services/publish HTTP/1.1

Content-Type: application/json

const inputBody = '{
"document": "/some-url",
"documentId": "did:nv:08a429b8529856d59867503f8056903a680935a76950bb9649785cc97869a43d",
"publisherAddress": "0x00a329c0648769A73afAc7F9381E08FB43dBEA72",
"signature": ""
}';
const headers = {
'Content-Type':'application/json'
};

fetch('/api/v1/node/services/publish',
{
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/publish',
params: {
}, headers: headers

p JSON.parse(result)

import requests
headers = {
'Content-Type': 'application/json'
}

r = requests.post('/api/v1/node/services/publish', 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/publish', 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/publish");
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/publish", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /api/v1/node/services/publish

Encrypt document using the SecretStore and keyed by the given documentId.


This can be used by the publisher of an asset to encrypt the urls of the
asset data files before publishing the asset ddo. The publisher to use this
service is one that is using a front-end with a wallet app such as MetaMask.
In such scenario the publisher is not able to encrypt the urls using the
SecretStore interface and this service becomes necessary.

Body parameter

{
"document": "/some-url",
"documentId": "did:nv:08a429b8529856d59867503f8056903a680935a76950bb9649785cc97869a43d",
"publisherAddress": "0x00a329c0648769A73afAc7F9381E08FB43dBEA72",
"signature": ""
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueAsset urls encryption.
» documentbodystringtruedocument
» documentIdbodystringtrueIdentifier of the asset to be registered in ocean.
» publisherAddressbodystringfalsePublisher address.
» signaturebodystringtruePublisher signature of the documentId

Responses

StatusMeaningDescriptionSchema
201Createddocument successfully encrypted.None
500Internal Server ErrorErrorNone