Skip to main content

Send Collectibles Requests

Generating Collectibles Requests

POST /collectibles/requests

Generate a collectibles request.

Endpoint URL

https://api.mixin.one/collectibles/requests

Authentication and options

Authorization
Authorized
LimitationNo limitation

Payload

{
"action": "Operations: could be 'sign' or 'unlock'",
"raw": "For transactions generated in accordance with the mainnet specifications"
}
info

raw is a transaction with mainnet specification. Refer to the implementation in Go and JS provided by our code

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/collectibles/requests --data '{"action": "sign", "raw": "298281....4952f95768b7d1a925c4189b912c343dbb000180e"}'

Request body data of the request

{
"data": {
"type": "non_fungible_request",
"request_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"token_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "10",
"senders_threshold": 2,
"senders": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"receivers_threshold": 2,
"receivers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"signers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"action": "sign",
"state": "spent",
"transaction_hash": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"raw_transaction": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"created_at": "2018-05-03T10:08:34.859542588Z",
"code_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35"
}
}

Initiating A Collectible signature

POST /collectibles/requests/:id/:action

Endpoint URL

https://api.mixin.one/collectibles/requests/:id/:action

Authentication and options

Authorization
Authorized
LimitationNo limitation

Parameters

action
*required
Operations: could be `sign`, `cancel`, and `unlock`
pin
*required
Encrypted PIN.

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/collectibles/requests/:id/:action --data '{"pin": "YOUR_PIN"}'

Request body data of the request

{
"data": {
"type": "non_fungible_request",
"request_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"token_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "10",
"senders_threshold": 2,
"senders": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"receivers_threshold": 2,
"receivers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"signers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"action": "sign",
"state": "spent",
"transaction_hash": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"raw_transaction": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"created_at": "2018-05-03T10:08:34.859542588Z",
"code_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35"
}
}

Operations

Initiate or participate in signing

// Generate collectible request.
POST /collectibles/requests
{
"action": "sign",
"raw": "298281....000180e"
}

// Sign collectible request.
POST /collectibles/requests/:id/sign

Cancel my signature

// Generate collectible request.
POST /collectibles/requests
{
"action": "cancel",
"raw": "298281....000180e"
}

// Send collectible cancelling request.
POST /collectibles/requests/:id/cancel

Cancel collectibles

// Generate collectible request.
POST /collectibles/requests
{
"action": "unlock",
"raw": "298281....000180e"
}

// Send collectible unlocking request.
POST /collectibles/requests/:id/unlock