Market 2.0 API
OpenAPI spec of Market 2.0 API.
These APIs can change without any notice as they are still being developed. This page is meant to be a reference for client libraries and SDK to allow parallel development.
List of supported DDO contracts
id
GET /status/{id} HTTP/1.1
Host:
Accept: */*
text
Make a mk20 deal
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
POST /store HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 775
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}
200
Useful for adding adding additional products and updating PoRep duration
id
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
GET /update/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 775
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}
200
Finalizes the upload process once all the chunks are uploaded.
id
Client wallet for the deal
Data represents the source of piece data and associated metadata.
Identifier represents a unique identifier for the deal in UUID format.
Products represents a collection of product-specific information associated with a deal
POST /upload/finalize/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 775
{
"client": {},
"data": {
"format": {
"aggregate": "[Circular Reference]",
"car": {},
"raw": {}
},
"piece_cid": {},
"source_aggregate": {
"pieces": [
"[Circular Reference]"
]
},
"source_http": {
"urls": [
{
"fallback": true,
"headers": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"priority": 1,
"url": "text"
}
]
},
"source_httpput": {},
"source_offline": {}
},
"identifier": [
1
],
"products": {
"ddo_v1": {
"allocation_id": 0,
"contract_address": "text",
"contract_verify_method": "text",
"contract_verify_method_params": [
1
],
"duration": 1,
"notification_address": "text",
"notification_payload": [
1
],
"piece_manager": {},
"provider": {}
},
"pdp_v1": {
"add_root": true,
"create_proof_set": true,
"delete_proof_set": true,
"delete_root": true,
"extra_data": [
1
],
"proof_set_id": 1
},
"retrieval_v1": {
"announce_payload": true,
"announce_piece": true,
"indexing": true
}
}
}
200
Return a json struct detailing the current status of a deal upload.
id
GET /upload/{id} HTTP/1.1
Host:
Accept: */*
200
Initializes the upload for a deal. Each upload must be initialized before chunks can be uploaded for a deal.
id
POST /upload/{id} HTTP/1.1
Host:
Accept: */*
200
Allows uploading chunks for a deal file. Method can be called in parallel to speed up uploads.
id
chunkNum
PUT /upload/{id}/{chunkNum} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 3
[
1
]
200
Last updated