Contract Publishing
Publish Contract
Example request:
{ "data": { "type": "contract", "attributes": { "public_until": "2038-02-03T09:08:23Z" } }}
Example response:
{ "data": { "id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93", "type": "contract", "attributes": { ... } }}
This endpoint publishes a contract. If the public_until
attribute is not
specified or null
, the contract will be made public for seven days by default.
HTTP Request
POST /api/v1/contracts/:contract_id/publish
URL Parameters
Parameter | Description |
---|---|
contract_id | The ID of the contract to publish |
Update Duration of the Published State
Example request:
{ "data": { "type": "contract", "attributes": { "public_until": "2038-02-03T09:08:23Z" } }}
Example response:
{ "data": { "type": "contract", "attributes": { ... } }}
This endpoint updates the time until which the contract is public.
HTTP Request
PUT /api/v1/contracts/:contract_id/publish
URL Parameters
Parameter | Description |
---|---|
contract_id | The ID of the contract to update |
Unpublish Contract
Example response:
{ "data": { "id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93", "type": "contract", "attributes": { ... } }}
This endpoint unpublishes a contract.
HTTP Request
DELETE /api/v1/contracts/:contract_id/publish
URL Parameters
Parameter | Description |
---|---|
contract_id | The ID of the contract to unpublish |
View Published Contract
Example response:
{ "data": { "id": "1e9f83a6-51a7-445a-bd6e-5e0350f24c93", "type": "published_contract", "attributes": { ... } }}
This endpoint returns the published contract.
HTTP Request
GET /public/v1/published-contract/:contract_token
URL Parameters
Parameter | Description |
---|---|
contract_token | The token of the published contract |