Market 2.0 API

OpenAPI spec of Market 2.0 API.

List of supported DDO contracts

get

List of supported DDO contracts

Responses
200

Array of contract addresses supported by a system or application.

application/json
get
/contracts
GET /contracts HTTP/1.1
Host: 
Accept: */*
{
  "contracts": [
    "text"
  ]
}

List of supported products

get

List of supported products

Responses
200

Array of products supported by the SP

application/json
get
/products
GET /products HTTP/1.1
Host: 
Accept: */*
{
  "products": [
    "text"
  ]
}

List of supported dats sources

get

List of supported data sources

Responses
200

Array of dats sources supported by the SP

application/json
get
/sources
GET /sources HTTP/1.1
Host: 
Accept: */*
{
  "sources": [
    "text"
  ]
}

List of supported DDO contracts

get

List of supported DDO contracts

Path parameters
idstringRequired

id

Responses
200

the status response for deal products with their respective deal statuses

application/json
get
/status/{id}
GET /status/{id} HTTP/1.1
Host: 
Accept: */*
{
  "ddo_v1": {
    "error_msg": "text",
    "status": "accepted"
  },
  "pdp_v1": {
    "error_msg": "text",
    "status": "accepted"
  }
}

Make a mk20 deal

post

Make a mk20 deal

Body
clientall ofOptional

Client wallet for the deal

objectOptional
dataall ofOptional

Data represents the source of piece data and associated metadata.

identifierinteger[]Optional

Identifier represents a unique identifier for the deal in UUID format.

productsall ofOptional

Products represents a collection of product-specific information associated with a deal

Responses
200

Ok represents a successful operation with an HTTP status code of 200

application/json
Responseinteger · enumPossible values:
post
/store
POST /store HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 813

{
  "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,
      "record_keeper": "text",
      "root_ids": [
        1
      ]
    },
    "retrieval_v1": {
      "announce_payload": true,
      "announce_piece": true,
      "indexing": true
    }
  }
}
200

Update the deal details of existing deals.

get

Useful for adding adding additional products and updating PoRep duration

Path parameters
idstringRequired

id

Body
clientall ofOptional

Client wallet for the deal

objectOptional
dataall ofOptional

Data represents the source of piece data and associated metadata.

identifierinteger[]Optional

Identifier represents a unique identifier for the deal in UUID format.

productsall ofOptional

Products represents a collection of product-specific information associated with a deal

Responses
200

Ok represents a successful operation with an HTTP status code of 200

application/json
Responseinteger · enumPossible values:
get
/update/{id}
GET /update/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 813

{
  "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,
      "record_keeper": "text",
      "root_ids": [
        1
      ]
    },
    "retrieval_v1": {
      "announce_payload": true,
      "announce_piece": true,
      "indexing": true
    }
  }
}
200

Finalizes the serial upload process

post

Finalizes the serial upload process once data has been uploaded

Path parameters
idstringRequired

id

Body
clientall ofOptional

Client wallet for the deal

objectOptional
dataall ofOptional

Data represents the source of piece data and associated metadata.

identifierinteger[]Optional

Identifier represents a unique identifier for the deal in UUID format.

productsall ofOptional

Products represents a collection of product-specific information associated with a deal

Responses
200

Ok represents a successful operation with an HTTP status code of 200

application/json
Responseinteger · enumPossible values:
post
/upload/{id}
POST /upload/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 813

{
  "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,
      "record_keeper": "text",
      "root_ids": [
        1
      ]
    },
    "retrieval_v1": {
      "announce_payload": true,
      "announce_piece": true,
      "indexing": true
    }
  }
}
200

Upload the deal data

put

Allows uploading data for deals in a single stream. Suitable for small deals.

Path parameters
idstringRequired

id

Bodyinteger[]
integer[]Optional
Responses
200

UploadOk indicates a successful upload operation, represented by the HTTP status code 200

application/json
Responseinteger · enumPossible values:
put
/upload/{id}
PUT /upload/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 3

[
  1
]
200

Finalizes the upload process

post

Finalizes the upload process once all the chunks are uploaded.

Path parameters
idstringRequired

id

Body
clientall ofOptional

Client wallet for the deal

objectOptional
dataall ofOptional

Data represents the source of piece data and associated metadata.

identifierinteger[]Optional

Identifier represents a unique identifier for the deal in UUID format.

productsall ofOptional

Products represents a collection of product-specific information associated with a deal

Responses
200

Ok represents a successful operation with an HTTP status code of 200

application/json
Responseinteger · enumPossible values:
post
/uploads/finalize/{id}
POST /uploads/finalize/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 813

{
  "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,
      "record_keeper": "text",
      "root_ids": [
        1
      ]
    },
    "retrieval_v1": {
      "announce_payload": true,
      "announce_piece": true,
      "indexing": true
    }
  }
}
200

Status of deal upload

get

Return a json struct detailing the current status of a deal upload.

Path parameters
idstringRequired

id

Responses
200

The status of a file upload process, including progress and missing chunks

application/json
get
/uploads/{id}
GET /uploads/{id} HTTP/1.1
Host: 
Accept: */*
{
  "missing": 1,
  "missing_chunks": [
    1
  ],
  "total_chunks": 1,
  "uploaded": 1,
  "uploaded_chunks": [
    1
  ]
}

Starts the upload process

post

Initializes the upload for a deal. Each upload must be initialized before chunks can be uploaded for a deal.

Path parameters
idstringRequired

id

Body
chunk_sizeintegerOptional

ChunkSize defines the size of each data chunk to be used during the upload process.

raw_sizeintegerOptional

RawSize indicates the total size of the data to be uploaded in bytes.

Responses
200

UploadStartCodeOk indicates a successful upload start request with status code 200

application/json
Responseinteger · enumPossible values:
post
/uploads/{id}
POST /uploads/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "chunk_size": 1,
  "raw_size": 1
}
200

Upload a file chunk

put

Allows uploading chunks for a deal file. Method can be called in parallel to speed up uploads.

Path parameters
idstringRequired

id

chunkNumstringRequired

chunkNum

Bodyinteger[]
integer[]Optional
Responses
200

UploadOk indicates a successful upload operation, represented by the HTTP status code 200

application/json
Responseinteger · enumPossible values:
put
/uploads/{id}/{chunkNum}
PUT /uploads/{id}/{chunkNum} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 3

[
  1
]
200

Last updated