Marketplace API v0.1.0
Marketplace API v0.1.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.
Base URLs:
Asset
AssetController_createAsset
Code samples
# You can also use wget
curl -X POST /api/v1/metadata/assets/ddo \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/metadata/assets/ddo HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"@context": "https://w3id.org/did/v1",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"created": "2019-02-08T08:13:49Z",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/ddo',
{
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/metadata/assets/ddo',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/metadata/assets/ddo', 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/metadata/assets/ddo', 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/metadata/assets/ddo");
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/metadata/assets/ddo", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/metadata/assets/ddo
Create a asset entry
Body parameter
{
"@context": "https://w3id.org/did/v1",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"created": "2019-02-08T08:13:49Z",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateAssetDto | true | none |
Example responses
201 Response
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | asset is created | GetAssetDto |
403 | Forbidden | Bad Request | None |
AssetController_getDDOAllAssets
Code samples
# You can also use wget
curl -X GET /api/v1/metadata/assets/ddo \
-H 'Accept: application/json'
GET /api/v1/metadata/assets/ddo HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/ddo',
{
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 '/api/v1/metadata/assets/ddo',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/metadata/assets/ddo', 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','/api/v1/metadata/assets/ddo', 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/metadata/assets/ddo");
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", "/api/v1/metadata/assets/ddo", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/metadata/assets/ddo
Get DDO of all assets
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
query | query | string | false | execute directly queries to elasticsearch from the client |
text | query | string | false | Text to search |
offset | query | string | false | Page Size |
page | query | string | false | Page to retrieve |
sort | query | string | false | sort the response by specified parameter |
Example responses
200 Response
[
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Assets Ids | Inline |
403 | Forbidden | Bad Request | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [GetAssetDto] | false | none | none |
» @context | string | true | none | Context of the asset |
» authentication | [AuthenticationDto] | true | none | Authentication used in the asset |
»» publicKey | string | true | none | Public key of ddo |
»» type | string | true | none | Type of the signature |
» created | string | true | none | Date when the asset is created |
» updated | string | true | none | Date when the asset is created |
» id | string | true | none | ID of the asset |
» proof | ProofDto | true | none | Proof data |
»» created | string | true | none | Date of the proof |
»» creator | string | true | none | Wallet address who created the proof signature |
»» signatureValue | string | true | none | Value of the signature |
»» type | string | true | none | Type of the proof |
» publicKey | [PublicKeyDto] | true | none | Public keys that contains the asset |
»» id | string | true | none | Id of the public key |
»» owner | string | true | none | Wallet address who own the public key |
»» type | string | true | none | Type of the public key |
» service | [ServiceDto] | true | none | Services that contains the asset |
»» index | number | true | none | index of the service |
»» serviceEndpoint | string | true | none | Url of the service endpoint |
»» type | string | true | none | Service type |
»» service | string | false | none | Service name |
»» purchaseEndpoint | string | false | none | Url to purchase asset |
»» attributes | AttributesDto | false | none | Attribute of the metadata |
»»» additionalInformation | object | false | none | Aditional information of the asset |
»»» curation | CurationDto | true | none | popularity of the asset |
»»»» numVotes | number | true | none | Number of votes. 0 is the default value |
»»»» rating | number | true | none | Decimal value between 0 and 1. 0 is the default value |
»»»» schema | string | false | none | Schema applied to calculate the rating |
»»»» isListed | boolean | false | none | Flag unsuitable content. False by default. If it's true, the content must not be returned |
»»» main | MainDto | true | none | Main data of the asset |
»»»» author | string | true | none | Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.) |
»»»» dateCreated | string | true | none | The date on which the asset was created by the originator.ISO 8601 format, Coordinated Universal Time, e.g. 2019-01-31T08:38:32Z |
»»»» datePublished | string | false | none | The date on which the asset DDO is registered into the metadata store |
»»»» encryptedFiles | string | true | none | files encrytion signature |
»»»» files | [FileDto] | true | none | Array of File objects including the encrypted file urls. Further metadata about each file is stored |
»»»»» checksum | string | false | none | Checksum of the file using your preferred format (i.e. MD5). Format specified in checksumType.If it's not provided can't be validated if the file was not modified after registering |
»»»»» url | string | false | none | Content URL. Omitted from the remote metadata. Supports http(s):// and ipfs:// URLs |
»»»»» checksumType | string | false | none | Format of the provided checksum. Can vary according to server (i.e Amazon vs. Azure) |
»»»»» name | string | false | none | File name |
»»»»» compression | string | false | none | File compression (e.g. no, gzip, bzip2, etc) |
»»»»» contentLength | string | false | none | Size of the file in bytes |
»»»»» contentType | string | true | none | File format |
»»»»» encoding | string | false | none | File encoding (e.g. UTF-8) |
»»»»» index | number | true | none | Index of the file |
»»»»» resourceId | string | false | none | Remote identifier of the file in the external provider. It is typically the remote id in the cloud provider |
»»»»» encrypted | boolean | false | none | Boolean. Is the file encrypted? If is not set is assumed the file is not encrypted |
»»»»» encryptionMode | string | false | none | Encryption mode used. Just valid if encrypted=true |
»»»» license | number | true | none | Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc.). If it's not specified, the following value will be added: "No License Specified |
»»»» name | string | true | none | Descriptive name or title of the asset |
»»»» price | string | true | none | Price of the asset. It must be an integer encoded as a string, e.g. "123000000000000000000" |
»»»» type | string | true | none | Type of the asset. Helps to filter by the type of asset. It could be for example ("dataset", "algorithm") |
»»»» algorithm | AlgorithmDto | true | none | Algorithm used in the asset |
»»»»» language | string | false | none | Language used to implement the software |
»»»»» format | string | false | none | Packaging format of the software |
»»»»» version | string | false | none | Version of the software |
»»»»» container | [ContainerDto] | true | none | Object describing the Docker container image |
»»»»»» entrypoint | string | false | none | The command to execute, or script to run inside the Docker image |
»»»»»» image | string | false | none | Name of the Docker image |
»»»»»» tag | string | false | none | Tag of the Docker image |
»»» serviceAgreementTemplate | ServiceAgreementTemplateDto | false | none | Service agreement template |
»»»» conditionDependency | [ConditionDependencyDto] | true | none | none |
»»»»» access | [string] | true | none | Access |
»»»»» escrowPayment | [string] | true | none | Escrow Payment |
»»»»» execCompute | [string] | true | none | Exec Compute |
»»»»» lockPayment | [string] | true | none | Lock Payment |
»»»» conditions | [ConditionDto] | true | none | Conditions |
»»»»» contractName | string | true | none | Contract name |
»»»»» functionName | string | true | none | Function name |
»»»»» name | string | true | none | Function name |
»»»»» events | [EventDto] | true | none | Events |
»»»»»» actionType | string | true | none | Action Type |
»»»»»» handler | HandlerDto | true | none | Handler event |
»»»»»»» functionName | string | true | none | Function name |
»»»»»»» moduleName | string | true | none | Module name |
»»»»»»» version | string | true | none | Version of the handler |
»»»»»» name | string | true | none | Name of the event |
»»»»» parameters | [ParameterDto] | true | none | Parameters |
»»»»»» name | string | true | none | Parameter name |
»»»»»» type | string | true | none | Parameter type |
»»»»»» value | object | true | none | Parameter value |
»»»»» timelock | number | true | none | Time lock |
»»»»» timeout | number | true | none | Time out |
»»»» contractName | number | true | none | Contract Name |
»»»» events | [EventDto] | true | none | Events |
»»»» fulfillmentOrder | string | false | none | Fulfillment order |
AssetController_deleteAllDDOs
Code samples
# You can also use wget
curl -X DELETE /api/v1/metadata/assets/ddo
DELETE /api/v1/metadata/assets/ddo HTTP/1.1
fetch('/api/v1/metadata/assets/ddo',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/metadata/assets/ddo',
params: {
}
p JSON.parse(result)
import requests
r = requests.delete('/api/v1/metadata/assets/ddo')
print(r.json())
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/metadata/assets/ddo', 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/metadata/assets/ddo");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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("DELETE", "/api/v1/metadata/assets/ddo", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /api/v1/metadata/assets/ddo
Retire metadata of all assets
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Deleted all DDOs from marketplace | None |
AssetController_getAllAssetIds
Code samples
# You can also use wget
curl -X GET /api/v1/metadata/assets \
-H 'Accept: application/json'
GET /api/v1/metadata/assets HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets',
{
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 '/api/v1/metadata/assets',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/metadata/assets', 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','/api/v1/metadata/assets', 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/metadata/assets");
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", "/api/v1/metadata/assets", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/metadata/assets
Get all asset Ids
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
query | query | string | false | execute directly queries to elasticsearch from the client |
text | query | string | false | Text to search |
offset | query | string | false | Page Size |
page | query | string | false | Page to retrieve |
sort | query | string | false | sort the response by specified parameter |
Example responses
200 Response
[
"did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430"
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Assets Ids | Inline |
Response Schema
AssetController_listDDObyQueryPost
Code samples
# You can also use wget
curl -X POST /api/v1/metadata/assets/ddo/query \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/metadata/assets/ddo/query HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"query": {
"match_all": {}
},
"text": "Eius vel alias.",
"offset": 100,
"page": 0,
"sort": {
"created": "asc"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/ddo/query',
{
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/metadata/assets/ddo/query',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/metadata/assets/ddo/query', 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/metadata/assets/ddo/query', 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/metadata/assets/ddo/query");
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/metadata/assets/ddo/query", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/metadata/assets/ddo/query
Get a list of DDOs that match with the executed query.
Body parameter
{
"query": {
"match_all": {}
},
"text": "Eius vel alias.",
"offset": 100,
"page": 0,
"sort": {
"created": "asc"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | QueryBodyDDOdto | true | none |
Example responses
200 Response
[
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | list of DDOs | Inline |
403 | Forbidden | Bad Request | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [GetAssetDto] | false | none | none |
» @context | string | true | none | Context of the asset |
» authentication | [AuthenticationDto] | true | none | Authentication used in the asset |
»» publicKey | string | true | none | Public key of ddo |
»» type | string | true | none | Type of the signature |
» created | string | true | none | Date when the asset is created |
» updated | string | true | none | Date when the asset is created |
» id | string | true | none | ID of the asset |
» proof | ProofDto | true | none | Proof data |
»» created | string | true | none | Date of the proof |
»» creator | string | true | none | Wallet address who created the proof signature |
»» signatureValue | string | true | none | Value of the signature |
»» type | string | true | none | Type of the proof |
» publicKey | [PublicKeyDto] | true | none | Public keys that contains the asset |
»» id | string | true | none | Id of the public key |
»» owner | string | true | none | Wallet address who own the public key |
»» type | string | true | none | Type of the public key |
» service | [ServiceDto] | true | none | Services that contains the asset |
»» index | number | true | none | index of the service |
»» serviceEndpoint | string | true | none | Url of the service endpoint |
»» type | string | true | none | Service type |
»» service | string | false | none | Service name |
»» purchaseEndpoint | string | false | none | Url to purchase asset |
»» attributes | AttributesDto | false | none | Attribute of the metadata |
»»» additionalInformation | object | false | none | Aditional information of the asset |
»»» curation | CurationDto | true | none | popularity of the asset |
»»»» numVotes | number | true | none | Number of votes. 0 is the default value |
»»»» rating | number | true | none | Decimal value between 0 and 1. 0 is the default value |
»»»» schema | string | false | none | Schema applied to calculate the rating |
»»»» isListed | boolean | false | none | Flag unsuitable content. False by default. If it's true, the content must not be returned |
»»» main | MainDto | true | none | Main data of the asset |
»»»» author | string | true | none | Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.) |
»»»» dateCreated | string | true | none | The date on which the asset was created by the originator.ISO 8601 format, Coordinated Universal Time, e.g. 2019-01-31T08:38:32Z |
»»»» datePublished | string | false | none | The date on which the asset DDO is registered into the metadata store |
»»»» encryptedFiles | string | true | none | files encrytion signature |
»»»» files | [FileDto] | true | none | Array of File objects including the encrypted file urls. Further metadata about each file is stored |
»»»»» checksum | string | false | none | Checksum of the file using your preferred format (i.e. MD5). Format specified in checksumType.If it's not provided can't be validated if the file was not modified after registering |
»»»»» url | string | false | none | Content URL. Omitted from the remote metadata. Supports http(s):// and ipfs:// URLs |
»»»»» checksumType | string | false | none | Format of the provided checksum. Can vary according to server (i.e Amazon vs. Azure) |
»»»»» name | string | false | none | File name |
»»»»» compression | string | false | none | File compression (e.g. no, gzip, bzip2, etc) |
»»»»» contentLength | string | false | none | Size of the file in bytes |
»»»»» contentType | string | true | none | File format |
»»»»» encoding | string | false | none | File encoding (e.g. UTF-8) |
»»»»» index | number | true | none | Index of the file |
»»»»» resourceId | string | false | none | Remote identifier of the file in the external provider. It is typically the remote id in the cloud provider |
»»»»» encrypted | boolean | false | none | Boolean. Is the file encrypted? If is not set is assumed the file is not encrypted |
»»»»» encryptionMode | string | false | none | Encryption mode used. Just valid if encrypted=true |
»»»» license | number | true | none | Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc.). If it's not specified, the following value will be added: "No License Specified |
»»»» name | string | true | none | Descriptive name or title of the asset |
»»»» price | string | true | none | Price of the asset. It must be an integer encoded as a string, e.g. "123000000000000000000" |
»»»» type | string | true | none | Type of the asset. Helps to filter by the type of asset. It could be for example ("dataset", "algorithm") |
»»»» algorithm | AlgorithmDto | true | none | Algorithm used in the asset |
»»»»» language | string | false | none | Language used to implement the software |
»»»»» format | string | false | none | Packaging format of the software |
»»»»» version | string | false | none | Version of the software |
»»»»» container | [ContainerDto] | true | none | Object describing the Docker container image |
»»»»»» entrypoint | string | false | none | The command to execute, or script to run inside the Docker image |
»»»»»» image | string | false | none | Name of the Docker image |
»»»»»» tag | string | false | none | Tag of the Docker image |
»»» serviceAgreementTemplate | ServiceAgreementTemplateDto | false | none | Service agreement template |
»»»» conditionDependency | [ConditionDependencyDto] | true | none | none |
»»»»» access | [string] | true | none | Access |
»»»»» escrowPayment | [string] | true | none | Escrow Payment |
»»»»» execCompute | [string] | true | none | Exec Compute |
»»»»» lockPayment | [string] | true | none | Lock Payment |
»»»» conditions | [ConditionDto] | true | none | Conditions |
»»»»» contractName | string | true | none | Contract name |
»»»»» functionName | string | true | none | Function name |
»»»»» name | string | true | none | Function name |
»»»»» events | [EventDto] | true | none | Events |
»»»»»» actionType | string | true | none | Action Type |
»»»»»» handler | HandlerDto | true | none | Handler event |
»»»»»»» functionName | string | true | none | Function name |
»»»»»»» moduleName | string | true | none | Module name |
»»»»»»» version | string | true | none | Version of the handler |
»»»»»» name | string | true | none | Name of the event |
»»»»» parameters | [ParameterDto] | true | none | Parameters |
»»»»»» name | string | true | none | Parameter name |
»»»»»» type | string | true | none | Parameter type |
»»»»»» value | object | true | none | Parameter value |
»»»»» timelock | number | true | none | Time lock |
»»»»» timeout | number | true | none | Time out |
»»»» contractName | number | true | none | Contract Name |
»»»» events | [EventDto] | true | none | Events |
»»»» fulfillmentOrder | string | false | none | Fulfillment order |
AssetController_getDDO
Code samples
# You can also use wget
curl -X GET /api/v1/metadata/assets/ddo/{did} \
-H 'Accept: application/json'
GET /api/v1/metadata/assets/ddo/{did} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/ddo/{did}',
{
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 '/api/v1/metadata/assets/ddo/{did}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/metadata/assets/ddo/{did}', 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','/api/v1/metadata/assets/ddo/{did}', 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/metadata/assets/ddo/{did}");
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", "/api/v1/metadata/assets/ddo/{did}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/metadata/assets/ddo/{did}
Get DDO of a particular asset
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | string | true | none |
Example responses
200 Response
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Get a DDO | GetAssetDto |
404 | Not Found | Not found | None |
AssetController_updateDDO
Code samples
# You can also use wget
curl -X PUT /api/v1/metadata/assets/ddo/{did} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT /api/v1/metadata/assets/ddo/{did} HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"@context": "https://w3id.org/did/v1",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/ddo/{did}',
{
method: 'PUT',
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.put '/api/v1/metadata/assets/ddo/{did}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('/api/v1/metadata/assets/ddo/{did}', 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('PUT','/api/v1/metadata/assets/ddo/{did}', 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/metadata/assets/ddo/{did}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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("PUT", "/api/v1/metadata/assets/ddo/{did}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /api/v1/metadata/assets/ddo/{did}
Update DDO of an existing asset
Body parameter
{
"@context": "https://w3id.org/did/v1",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | string | true | none |
body | body | UpdateAssetDto | true | none |
Example responses
200 Response
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Get a updated DDO | GetAssetDto |
403 | Forbidden | Bad Request | None |
404 | Not Found | Not found | None |
AssetController_deleteDDO
Code samples
# You can also use wget
curl -X DELETE /api/v1/metadata/assets/ddo/{did}
DELETE /api/v1/metadata/assets/ddo/{did} HTTP/1.1
fetch('/api/v1/metadata/assets/ddo/{did}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/metadata/assets/ddo/{did}',
params: {
}
p JSON.parse(result)
import requests
r = requests.delete('/api/v1/metadata/assets/ddo/{did}')
print(r.json())
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/metadata/assets/ddo/{did}', 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/metadata/assets/ddo/{did}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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("DELETE", "/api/v1/metadata/assets/ddo/{did}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /api/v1/metadata/assets/ddo/{did}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Deleted DDO | None |
404 | Not Found | Not found | None |
default | Default | Retire metadata of an asset | None |
AssetController_getDDOMetadata
Code samples
# You can also use wget
curl -X GET /api/v1/metadata/assets/metadata/{did} \
-H 'Accept: application/json'
GET /api/v1/metadata/assets/metadata/{did} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/metadata/assets/metadata/{did}',
{
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 '/api/v1/metadata/assets/metadata/{did}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/metadata/assets/metadata/{did}', 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','/api/v1/metadata/assets/metadata/{did}', 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/metadata/assets/metadata/{did}");
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", "/api/v1/metadata/assets/metadata/{did}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/metadata/assets/metadata/{did}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | string | true | none |
Example responses
200 Response
{
"additionalInformation": {},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting",
"isListed": false
},
"main": {
"author": "Met Office",
"dateCreated": "2021-02-01T10:55:11Z",
"datePublished": "2021-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"checksum": "efb2c764274b745f5fc37f97c6b0e761",
"url": "https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt",
"checksumType": "md5",
"name": "data.txt",
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932",
"encrypted": false,
"encryptionMode": "gpg"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset",
"algorithm": {
"language": "scala",
"format": "docker-image",
"version": "0.1",
"container": [
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
]
}
},
"serviceAgreementTemplate": {
"conditionDependency": [
{
"access": [],
"escrowPayment": [
"lockPayment",
"access"
],
"execCompute": [],
"lockPayment": []
}
],
"conditions": [
{
"contractName": "LockPaymentCondition",
"functionName": "fulfill",
"name": "lockPayment",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"parameters": [
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
],
"timelock": 0,
"timeout": 0
}
],
"contractName": "EscrowAccessSecretStoreTemplate",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"fulfillmentOrder": [
"lockPayment.fulfill",
"access.fulfill",
"escrowPayment.fulfill"
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Get a metadata from asset | AttributesDto |
404 | Not Found | Not found | None |
default | Default | Get metadata of a particular asset | None |
Bookmark
BookmarkController_createBookmark
Code samples
# You can also use wget
curl -X POST /api/v1/ugc/bookmarks \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/ugc/bookmarks HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/ugc/bookmarks',
{
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/ugc/bookmarks',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/ugc/bookmarks', 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/ugc/bookmarks', 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/ugc/bookmarks");
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/ugc/bookmarks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v1/ugc/bookmarks
Create a bookmark entry
Body parameter
{
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateBookmarkDto | true | none |
Example responses
201 Response
{
"id": "b-123434",
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset",
"createdAt": "2022-03-18T13:44:00.931Z"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Bookmark is created | GetBookmarkDto |
403 | Forbidden | Bad Request | None |
BookmarkController_getBookmarkById
Code samples
# You can also use wget
curl -X GET /api/v1/ugc/bookmarks/{id} \
-H 'Accept: application/json'
GET /api/v1/ugc/bookmarks/{id} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/ugc/bookmarks/{id}',
{
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 '/api/v1/ugc/bookmarks/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/ugc/bookmarks/{id}', 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','/api/v1/ugc/bookmarks/{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/ugc/bookmarks/{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{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/ugc/bookmarks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/ugc/bookmarks/{id}
Get a bookmark entry
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
Example responses
200 Response
{
"id": "b-123434",
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset",
"createdAt": "2022-03-18T13:44:00.931Z"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return a bookmark user | GetBookmarkDto |
404 | Not Found | Not found | None |
BookmarkController_updateBookmarkById
Code samples
# You can also use wget
curl -X PUT /api/v1/ugc/bookmarks/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT /api/v1/ugc/bookmarks/{id} HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"description": "I am interesting in this asset"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/ugc/bookmarks/{id}',
{
method: 'PUT',
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.put '/api/v1/ugc/bookmarks/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('/api/v1/ugc/bookmarks/{id}', 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('PUT','/api/v1/ugc/bookmarks/{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/ugc/bookmarks/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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("PUT", "/api/v1/ugc/bookmarks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /api/v1/ugc/bookmarks/{id}
Update an existing bookmark
Body parameter
{
"description": "I am interesting in this asset"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
body | body | UpdateBookmarkDto | true | none |
Example responses
200 Response
{
"id": "b-123434",
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset",
"createdAt": "2022-03-18T13:44:00.931Z"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return a updated bookmark | GetBookmarkDto |
403 | Forbidden | Bad Request | None |
404 | Not Found | Not found | None |
BookmarkController_deleteBookmarkById
Code samples
# You can also use wget
curl -X DELETE /api/v1/ugc/bookmarks/{id}
DELETE /api/v1/ugc/bookmarks/{id} HTTP/1.1
fetch('/api/v1/ugc/bookmarks/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/ugc/bookmarks/{id}',
params: {
}
p JSON.parse(result)
import requests
r = requests.delete('/api/v1/ugc/bookmarks/{id}')
print(r.json())
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/ugc/bookmarks/{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/ugc/bookmarks/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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("DELETE", "/api/v1/ugc/bookmarks/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /api/v1/ugc/bookmarks/{id}
Delete a bookmark
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | return bookmark deleted | None |
404 | Not Found | Not found | None |
BookmarkController_getBookmarksByUserId
Code samples
# You can also use wget
curl -X GET /api/v1/ugc/bookmarks/user/{userId} \
-H 'Accept: application/json'
GET /api/v1/ugc/bookmarks/user/{userId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/ugc/bookmarks/user/{userId}',
{
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 '/api/v1/ugc/bookmarks/user/{userId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/ugc/bookmarks/user/{userId}', 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','/api/v1/ugc/bookmarks/user/{userId}', 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/ugc/bookmarks/user/{userId}");
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", "/api/v1/ugc/bookmarks/user/{userId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v1/ugc/bookmarks/user/{userId}
Get all the user bookmarks
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
userId | path | string | true | none |
query | query | string | false | execute directly queries to elasticsearch from the client |
text | query | string | false | Text to search |
offset | query | string | false | Page Size |
page | query | string | false | Page to retrieve |
sort | query | string | false | sort the response by specified parameter |
Example responses
200 Response
[
{
"id": "b-123434",
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset",
"createdAt": "2022-03-18T13:44:00.931Z"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return all bookmark from a user | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [GetBookmarkDto] | false | none | none |
» id | string | true | none | The identifier of the bookmark |
» did | string | true | none | The identifier of the asset |
» userId | string | true | none | The userId who created the bookmark |
» description | string | true | none | Description given by the user |
» createdAt | string(date-time) | true | none | When the UGC was created |
Schemas
AuthenticationDto
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
publicKey | string | true | none | Public key of ddo |
type | string | true | none | Type of the signature |
ProofDto
{
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
created | string | true | none | Date of the proof |
creator | string | true | none | Wallet address who created the proof signature |
signatureValue | string | true | none | Value of the signature |
type | string | true | none | Type of the proof |
PublicKeyDto
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | Id of the public key |
owner | string | true | none | Wallet address who own the public key |
type | string | true | none | Type of the public key |
CurationDto
{
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting",
"isListed": false
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
numVotes | number | true | none | Number of votes. 0 is the default value |
rating | number | true | none | Decimal value between 0 and 1. 0 is the default value |
schema | string | false | none | Schema applied to calculate the rating |
isListed | boolean | false | none | Flag unsuitable content. False by default. If it's true, the content must not be returned |
FileDto
{
"checksum": "efb2c764274b745f5fc37f97c6b0e761",
"url": "https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt",
"checksumType": "md5",
"name": "data.txt",
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932",
"encrypted": false,
"encryptionMode": "gpg"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
checksum | string | false | none | Checksum of the file using your preferred format (i.e. MD5). Format specified in checksumType.If it's not provided can't be validated if the file was not modified after registering |
url | string | false | none | Content URL. Omitted from the remote metadata. Supports http(s):// and ipfs:// URLs |
checksumType | string | false | none | Format of the provided checksum. Can vary according to server (i.e Amazon vs. Azure) |
name | string | false | none | File name |
compression | string | false | none | File compression (e.g. no, gzip, bzip2, etc) |
contentLength | string | false | none | Size of the file in bytes |
contentType | string | true | none | File format |
encoding | string | false | none | File encoding (e.g. UTF-8) |
index | number | true | none | Index of the file |
resourceId | string | false | none | Remote identifier of the file in the external provider. It is typically the remote id in the cloud provider |
encrypted | boolean | false | none | Boolean. Is the file encrypted? If is not set is assumed the file is not encrypted |
encryptionMode | string | false | none | Encryption mode used. Just valid if encrypted=true |
ContainerDto
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
entrypoint | string | false | none | The command to execute, or script to run inside the Docker image |
image | string | false | none | Name of the Docker image |
tag | string | false | none | Tag of the Docker image |
AlgorithmDto
{
"language": "scala",
"format": "docker-image",
"version": "0.1",
"container": [
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
language | string | false | none | Language used to implement the software |
format | string | false | none | Packaging format of the software |
version | string | false | none | Version of the software |
container | [ContainerDto] | true | none | Object describing the Docker container image |
MainDto
{
"author": "Met Office",
"dateCreated": "2021-02-01T10:55:11Z",
"datePublished": "2021-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"checksum": "efb2c764274b745f5fc37f97c6b0e761",
"url": "https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt",
"checksumType": "md5",
"name": "data.txt",
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932",
"encrypted": false,
"encryptionMode": "gpg"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset",
"algorithm": {
"language": "scala",
"format": "docker-image",
"version": "0.1",
"container": [
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
]
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
author | string | true | none | Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.) |
dateCreated | string | true | none | The date on which the asset was created by the originator.ISO 8601 format, Coordinated Universal Time, e.g. 2019-01-31T08:38:32Z |
datePublished | string | false | none | The date on which the asset DDO is registered into the metadata store |
encryptedFiles | string | true | none | files encrytion signature |
files | [FileDto] | true | none | Array of File objects including the encrypted file urls. Further metadata about each file is stored |
license | number | true | none | Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc.). If it's not specified, the following value will be added: "No License Specified |
name | string | true | none | Descriptive name or title of the asset |
price | string | true | none | Price of the asset. It must be an integer encoded as a string, e.g. "123000000000000000000" |
type | string | true | none | Type of the asset. Helps to filter by the type of asset. It could be for example ("dataset", "algorithm") |
algorithm | AlgorithmDto | true | none | Algorithm used in the asset |
ConditionDependencyDto
{
"access": [],
"escrowPayment": [
"lockPayment",
"access"
],
"execCompute": [],
"lockPayment": []
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
access | [string] | true | none | Access |
escrowPayment | [string] | true | none | Escrow Payment |
execCompute | [string] | true | none | Exec Compute |
lockPayment | [string] | true | none | Lock Payment |
HandlerDto
{
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
functionName | string | true | none | Function name |
moduleName | string | true | none | Module name |
version | string | true | none | Version of the handler |
EventDto
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
actionType | string | true | none | Action Type |
handler | HandlerDto | true | none | Handler event |
name | string | true | none | Name of the event |
ParameterDto
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Parameter name |
type | string | true | none | Parameter type |
value | object | true | none | Parameter value |
ConditionDto
{
"contractName": "LockPaymentCondition",
"functionName": "fulfill",
"name": "lockPayment",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"parameters": [
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
],
"timelock": 0,
"timeout": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
contractName | string | true | none | Contract name |
functionName | string | true | none | Function name |
name | string | true | none | Function name |
events | [EventDto] | true | none | Events |
parameters | [ParameterDto] | true | none | Parameters |
timelock | number | true | none | Time lock |
timeout | number | true | none | Time out |
ServiceAgreementTemplateDto
{
"conditionDependency": [
{
"access": [],
"escrowPayment": [
"lockPayment",
"access"
],
"execCompute": [],
"lockPayment": []
}
],
"conditions": [
{
"contractName": "LockPaymentCondition",
"functionName": "fulfill",
"name": "lockPayment",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"parameters": [
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
],
"timelock": 0,
"timeout": 0
}
],
"contractName": "EscrowAccessSecretStoreTemplate",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"fulfillmentOrder": [
"lockPayment.fulfill",
"access.fulfill",
"escrowPayment.fulfill"
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
conditionDependency | [ConditionDependencyDto] | true | none | none |
conditions | [ConditionDto] | true | none | Conditions |
contractName | number | true | none | Contract Name |
events | [EventDto] | true | none | Events |
fulfillmentOrder | string | false | none | Fulfillment order |
AttributesDto
{
"additionalInformation": {},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting",
"isListed": false
},
"main": {
"author": "Met Office",
"dateCreated": "2021-02-01T10:55:11Z",
"datePublished": "2021-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"checksum": "efb2c764274b745f5fc37f97c6b0e761",
"url": "https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt",
"checksumType": "md5",
"name": "data.txt",
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932",
"encrypted": false,
"encryptionMode": "gpg"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset",
"algorithm": {
"language": "scala",
"format": "docker-image",
"version": "0.1",
"container": [
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
]
}
},
"serviceAgreementTemplate": {
"conditionDependency": [
{
"access": [],
"escrowPayment": [
"lockPayment",
"access"
],
"execCompute": [],
"lockPayment": []
}
],
"conditions": [
{
"contractName": "LockPaymentCondition",
"functionName": "fulfill",
"name": "lockPayment",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"parameters": [
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
],
"timelock": 0,
"timeout": 0
}
],
"contractName": "EscrowAccessSecretStoreTemplate",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"fulfillmentOrder": [
"lockPayment.fulfill",
"access.fulfill",
"escrowPayment.fulfill"
]
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
additionalInformation | object | false | none | Aditional information of the asset |
curation | CurationDto | true | none | popularity of the asset |
main | MainDto | true | none | Main data of the asset |
serviceAgreementTemplate | ServiceAgreementTemplateDto | false | none | Service agreement template |
ServiceDto
{
"index": 0,
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access",
"service": "SecretStore",
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"attributes": {
"additionalInformation": {},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting",
"isListed": false
},
"main": {
"author": "Met Office",
"dateCreated": "2021-02-01T10:55:11Z",
"datePublished": "2021-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"checksum": "efb2c764274b745f5fc37f97c6b0e761",
"url": "https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt",
"checksumType": "md5",
"name": "data.txt",
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932",
"encrypted": false,
"encryptionMode": "gpg"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset",
"algorithm": {
"language": "scala",
"format": "docker-image",
"version": "0.1",
"container": [
{
"entrypoint": "node $ALGO",
"image": "node",
"tag": "10"
}
]
}
},
"serviceAgreementTemplate": {
"conditionDependency": [
{
"access": [],
"escrowPayment": [
"lockPayment",
"access"
],
"execCompute": [],
"lockPayment": []
}
],
"conditions": [
{
"contractName": "LockPaymentCondition",
"functionName": "fulfill",
"name": "lockPayment",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"parameters": [
{
"name": "_rewardAddress",
"type": "address",
"value": "0x886dE2b3F8F27eEd43bA2FD4bC2AabDc14E0d9dD"
}
],
"timelock": 0,
"timeout": 0
}
],
"contractName": "EscrowAccessSecretStoreTemplate",
"events": [
{
"actionType": "publisher",
"handler": {
"functionName": "fulfill",
"moduleName": "lockPaymentConditon",
"version": "0.1"
},
"name": "Fulfilled"
}
],
"fulfillmentOrder": [
"lockPayment.fulfill",
"access.fulfill",
"escrowPayment.fulfill"
]
}
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
index | number | true | none | index of the service |
serviceEndpoint | string | true | none | Url of the service endpoint |
type | string | true | none | Service type |
service | string | false | none | Service name |
purchaseEndpoint | string | false | none | Url to purchase asset |
attributes | AttributesDto | false | none | Attribute of the metadata |
CreateAssetDto
{
"@context": "https://w3id.org/did/v1",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"created": "2019-02-08T08:13:49Z",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
@context | string | true | none | Context of the asset |
id | string | true | none | ID of the asset |
created | string | false | none | ID of the asset |
updated | string | false | none | ID of the asset |
authentication | [AuthenticationDto] | true | none | Authentication used in the asset |
proof | ProofDto | true | none | Proof data |
publicKey | [PublicKeyDto] | true | none | Public keys that contains the asset |
service | [ServiceDto] | true | none | Services that contains the asset |
GetAssetDto
{
"@context": "https://w3id.org/did/v1",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"created": "2021-02-01T10:55:11Z",
"updated": "2021-02-01T10:55:11Z",
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e429",
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
@context | string | true | none | Context of the asset |
authentication | [AuthenticationDto] | true | none | Authentication used in the asset |
created | string | true | none | Date when the asset is created |
updated | string | true | none | Date when the asset is created |
id | string | true | none | ID of the asset |
proof | ProofDto | true | none | Proof data |
publicKey | [PublicKeyDto] | true | none | Public keys that contains the asset |
service | [ServiceDto] | true | none | Services that contains the asset |
QueryBodyDDOdto
{
"query": {
"match_all": {}
},
"text": "Eius vel alias.",
"offset": 100,
"page": 0,
"sort": {
"created": "asc"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
query | object | false | none | execute directly queries to elasticsearch from the client |
text | string | false | none | Text to search |
offset | string | false | none | Page Size |
page | string | false | none | Page to retrieve |
sort | object | false | none | sort the response by specified parameter |
UpdateAssetDto
{
"@context": "https://w3id.org/did/v1",
"updated": "2019-02-08T08:13:49Z",
"authentication": [
{
"publicKey": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "RsaSignatureAuthentication2018"
}
],
"proof": {
"created": "2022-01-08T16:02:20Z",
"creator": "2022-01-08T16:02:20Z",
"signatureValue": "0xbd7b46b3ac664167bc70ac211b1a1da0baed9ead91613a5f02dfc25c1bb6e3ff40861b455017e8a587fd4e37b703436072598c3a81ec88be28bfe33b61554a471b",
"type": "DDOIntegritySignature"
},
"publicKey": [
{
"id": "did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"owner": "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"type": "EthereumECDSAKey"
}
],
"service": [
{
"index": 0,
"service": "SecretStore",
"serviceEndpoint": "http://localhost:12001",
"type": "authorization"
},
{
"index": 1,
"purchaseEndpoint": "http://localhost:8030/api/v1/gateway/services/access/initialize",
"serviceEndpoint": "http://localhost:8030/api/v1/gateway/services/consume",
"type": "access"
},
{
"attributes": {
"additionalInformation": {
"copyrightHolder": "Met Office",
"description": "Weather information of UK including temperature and humidity",
"inLanguage": "en",
"links": [
{
"name": "Sample of Asset Data",
"type": "sample",
"url": "https://foo.com/sample.csv"
}
],
"tags": [
"weather",
"uk",
"2011",
"temperature",
"humidity"
],
"workExample": "stationId,latitude,longitude,datetime, temperature,humidity/n423432fsd,51.509865,-0.118092, 2011-01-01T10:55:11+00:00,7.2,68"
},
"curation": {
"numVotes": 123,
"rating": 0.93,
"schema": "Binary Voting"
},
"main": {
"author": "Met Office",
"dateCreated": "2012-02-01T10:55:11Z",
"encryptedFiles": "0x098213xzckasdf089723hjgdasfkjgasfv",
"files": [
{
"compression": "zip",
"contentLength": "4535431",
"contentType": "text/csv",
"encoding": "UTF-8",
"index": 0,
"resourceId": "access-log2018-02-13-15-17-29-18386C502CAEA932"
}
],
"license": "CC-BY",
"name": "UK Weather information 2011",
"price": "10",
"type": "dataset"
}
},
"index": 2,
"serviceEndpoint": "http://mymetadata.org/api/v1/provider/assets/metadata/did:nv:0c184915b07b44c888d468be85a9b28253e80070e5294b1aaed81c2f0264e430",
"type": "metadata"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
@context | string | true | none | Context of the asset |
updated | string | false | none | ID of the asset |
authentication | [AuthenticationDto] | true | none | Authentication used in the asset |
proof | ProofDto | true | none | Proof data |
publicKey | [PublicKeyDto] | true | none | Public keys that contains the asset |
service | [ServiceDto] | true | none | Services that contains the asset |
CreateBookmarkDto
{
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
did | string | true | none | The identifier of the asset |
userId | string | true | none | The userId who created the bookmark |
description | string | true | none | Description given by the user |
GetBookmarkDto
{
"id": "b-123434",
"did": "did:12345",
"userId": "u-12345",
"description": "I am interesting in this asset",
"createdAt": "2022-03-18T13:44:00.931Z"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | true | none | The identifier of the bookmark |
did | string | true | none | The identifier of the asset |
userId | string | true | none | The userId who created the bookmark |
description | string | true | none | Description given by the user |
createdAt | string(date-time) | true | none | When the UGC was created |
UpdateBookmarkDto
{
"description": "I am interesting in this asset"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | true | none | Description given by the user |