cURL JavaScript Python PHP Go

Dock API v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Dock provides a complete solution for creating and managing verifiable credentials on the blockchain. This includes a free trial and simple, monthly pricing. Get started here: https://console.api.dock.io/

Authentication

dids

Operations about DIDs

Get DID

Code samples

# You can also use wget
curl -X GET /dids/{did} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/dids/{did}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/dids/{did}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/dids/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/dids/{did}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /dids/{did}

Resolves a specific DID into a DID document.

Parameters

Name In Type Required Description
did path DID true A DID

Example responses

200 Response

{
  "@context": [
    "string"
  ],
  "id": "did:dock:xyz",
  "authentication": [
    {}
  ]
}

Responses

Status Meaning Description Schema
200 OK The DIDDoc DIDDoc
404 Not Found DID was not found. Error

Update DID

Code samples

# You can also use wget
curl -X PATCH /dids/{did} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "controller": "did:dock:xyz",
  "keyType": "sr25519"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/dids/{did}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.patch('/dids/{did}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/dids/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/dids/{did}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /dids/{did}

Updates the DID's key or controller on the blockchain.

Body parameter

{
  "controller": "did:dock:xyz",
  "keyType": "sr25519"
}

Parameters

Name In Type Required Description
body body object false Properties of DID
» controller body DID false DID as fully qualified, eg. did:dock: or 32 byte hex string
» keyType body KeyType false Type of public key for DID
did path DID true A DID

Enumerated Values

Parameter Value
» keyType sr25519
» keyType ed25519
» keyType secp256k1

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Will update DID. JobId
401 Unauthorized Does not own the DID Error
404 Not Found DID does not exist Error

Delete DID

Code samples

# You can also use wget
curl -X DELETE /dids/{did} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/dids/{did}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.delete('/dids/{did}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/dids/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/dids/{did}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /dids/{did}

Deletes a DID from the blockchain, further attempts to resolve this DID will fail.

Parameters

Name In Type Required Description
did path DID true A DID

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Will remove DID. JobId
401 Unauthorized Does not own the DID Error
404 Not Found DID does not exist Error

List DIDs

Code samples

# You can also use wget
curl -X GET /dids/ \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/dids/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/dids/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/dids/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/dids/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /dids/

Example responses

200 Response

[
  {
    "@context": [
      "string"
    ],
    "id": "did:dock:xyz",
    "authentication": [
      {}
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK All of a user's DIDs fully resolved into DID documents Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [DIDDoc] false none [DID document. The current set of properties is incomplete]
» @context any false none JSON-LD context

oneOf

Name Type Required Restrictions Description
»» anonymous [string] false none none

xor

Name Type Required Restrictions Description
»» anonymous string false none none

continued

Name Type Required Restrictions Description
» id DIDQualified(uri) false none DID as fully qualified, eg. did:dock:.
» authentication [oneOf] false none none

oneOf

Name Type Required Restrictions Description
»» anonymous object false none none

xor

Name Type Required Restrictions Description
»» anonymous string false none none

Create DID

Code samples

# You can also use wget
curl -X POST /dids/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "did": "did:dock:xyz",
  "controller": "did:dock:xyz",
  "keyType": "sr25519"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/dids/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/dids/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/dids/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/dids/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /dids/

Creates a new DID on chain with an auto generated keypair, the controller will be the same as the DID unless otherwise specified.

Body parameter

{
  "did": "did:dock:xyz",
  "controller": "did:dock:xyz",
  "keyType": "sr25519"
}

Parameters

Name In Type Required Description
body body object false Properties of DID
» did body DID false DID as fully qualified, eg. did:dock: or 32 byte hex string
» controller body DID false DID as fully qualified, eg. did:dock: or 32 byte hex string
» keyType body KeyType false Type of public key for DID

Enumerated Values

Parameter Value
» keyType sr25519
» keyType ed25519
» keyType secp256k1

Example responses

200 Response

{
  "id": "string",
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK Will try to create DID. DID does not exist on network as of now. JobStartedResult
400 Bad Request Invalid params Error

credentials

Operations about credentials

Issue a credential

Code samples

# You can also use wget
curl -X POST /credentials/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "credential": {
    "id": "http://example.com",
    "context": [
      "string"
    ],
    "type": [
      "string"
    ],
    "subject": {},
    "issuer": "did:dock:xyz",
    "issuanceDate": "2019-08-24T14:15:22Z",
    "expirationDate": "2019-08-24T14:15:22Z",
    "status": {}
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/credentials/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/credentials/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/credentials/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/credentials/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /credentials/

Creates and issues a verifiable credential with supplied data. Issuing counts as a paid transaction.

Body parameter

{
  "credential": {
    "id": "http://example.com",
    "context": [
      "string"
    ],
    "type": [
      "string"
    ],
    "subject": {},
    "issuer": "did:dock:xyz",
    "issuanceDate": "2019-08-24T14:15:22Z",
    "expirationDate": "2019-08-24T14:15:22Z",
    "status": {}
  }
}

Parameters

Name In Type Required Description
body body object true JSON-schema
» credential body Credential false Credential format expected by API caller. The current set of is almost complete
»» id body string(uri) false none
»» context body [string] false none
»» type body [string] false none
»» subject body object false none
»» issuer body any false none
»»» anonymous body DIDQualified(uri) false DID as fully qualified, eg. did:dock:.
»»» anonymous body object false none
»» issuanceDate body string(date-time) false none
»» expirationDate body string(date-time) false none
»» status body any false Revocation registry id or user supplied status object
»»» anonymous body object false none
»»» anonymous body string false none

Example responses

200 Response

{
  "@context": [
    "string"
  ],
  "id": "http://example.com",
  "type": [
    "string"
  ],
  "credentialSubject": {},
  "issuer": "did:dock:xyz",
  "issuanceDate": "2019-08-24T14:15:22Z",
  "expirationDate": "2019-08-24T14:15:22Z",
  "credentialStatus": {},
  "proof": {
    "type": "Sr25519Signature2020",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "string",
    "created": "2019-08-24T14:15:22Z",
    "proofValue": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK A VC. VerifiableCredential
400 Bad Request Invalid/insufficient credential params. Error
401 Unauthorized User does not own DID. Error

presentations

Operations about presentations

Create a presentation

Code samples

# You can also use wget
curl -X POST /presentations/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "holder": "did:dock:xyz",
  "challenge": "string",
  "domain": "string",
  "credentials": [
    {
      "@context": [
        "string"
      ],
      "id": "http://example.com",
      "type": [
        "string"
      ],
      "credentialSubject": {},
      "issuer": "did:dock:xyz",
      "issuanceDate": "2019-08-24T14:15:22Z",
      "expirationDate": "2019-08-24T14:15:22Z",
      "credentialStatus": {},
      "proof": {
        "type": "Sr25519Signature2020",
        "proofPurpose": "assertionMethod",
        "verificationMethod": "string",
        "created": "2019-08-24T14:15:22Z",
        "proofValue": "string"
      }
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/presentations/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/presentations/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/presentations/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/presentations/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /presentations/

Creates and signs a verifiable presentation out of one or more Verifiable Credentials. Signing counts as a paid transaction.

Body parameter

{
  "holder": "did:dock:xyz",
  "challenge": "string",
  "domain": "string",
  "credentials": [
    {
      "@context": [
        "string"
      ],
      "id": "http://example.com",
      "type": [
        "string"
      ],
      "credentialSubject": {},
      "issuer": "did:dock:xyz",
      "issuanceDate": "2019-08-24T14:15:22Z",
      "expirationDate": "2019-08-24T14:15:22Z",
      "credentialStatus": {},
      "proof": {
        "type": "Sr25519Signature2020",
        "proofPurpose": "assertionMethod",
        "verificationMethod": "string",
        "created": "2019-08-24T14:15:22Z",
        "proofValue": "string"
      }
    }
  ]
}

Parameters

Name In Type Required Description
body body object true JSON-schema
» holder body DIDQualified(uri) false DID as fully qualified, eg. did:dock:.
» challenge body string false none
» domain body string false none
» credentials body [VerifiableCredential] false [Verifiable (signed) Credential returned by API. The current set of properties is almost complete]
»» @context body any false JSON-LD context
»»» anonymous body [string] false none
»»» anonymous body string false none
»» id body string(uri) false none
»» type body [string] false none
»» credentialSubject body any false none
»»» anonymous body object false none
»»» anonymous body [object] false none
»» issuer body any false none
»»» anonymous body DIDQualified(uri) false DID as fully qualified, eg. did:dock:.
»»» anonymous body object false none
»» issuanceDate body string(date-time) false none
»» expirationDate body string(date-time) false none
»» credentialStatus body any false Revocation registry id or user supplied status object
»»» anonymous body object false none
»»» anonymous body string false none
»» proof body object false none
»»» type body SigType false Type of signature
»»» proofPurpose body ProofPurpose false Purpose of credential
»»» verificationMethod body string false none
»»» created body string(date-time) false none
»»» proofValue body string false none

Enumerated Values

Parameter Value
»»» type Sr25519Signature2020
»»» type Ed25519Signature2018
»»» type EcdsaSecp256k1Signature2019
»»» proofPurpose assertionMethod
»»» proofPurpose authentication

Example responses

200 Response

{
  "@context": [
    "string"
  ],
  "id": "http://example.com",
  "type": [
    "string"
  ],
  "credentialSubject": {},
  "issuer": "did:dock:xyz",
  "issuanceDate": "2019-08-24T14:15:22Z",
  "expirationDate": "2019-08-24T14:15:22Z",
  "credentialStatus": {},
  "proof": {
    "type": "Sr25519Signature2020",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "string",
    "created": "2019-08-24T14:15:22Z",
    "proofValue": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK A VC. VerifiableCredential
400 Bad Request Invalid/insufficient credential params. Error
401 Unauthorized User does not own DID. Error

registries

Operations about registries

Delete registry

Code samples

# You can also use wget
curl -X DELETE /registries/{id} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/registries/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.delete('/registries/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/registries/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/registries/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /registries/{id}

Deletes a specific registry

Parameters

Name In Type Required Description
id path Hex32 true Revocation registry id

Example responses

200 Response

{
  "id": "string",
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK Revocation Registry will be deleted JobStartedResult
404 Not Found Registry was not found. Error

Get registry

Code samples

# You can also use wget
curl -X GET /registries/{id} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/registries/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/registries/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/registries/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/registries/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /registries/{id}

Get the registry details like policy, controller(s)

Parameters

Name In Type Required Description
id path Hex32 true Revocation registry id

Example responses

200 Response

{
  "addOnly": true,
  "policy": [
    "did:dock:xyz"
  ]
}

Responses

Status Meaning Description Schema
200 OK Revocation Registry metadata Registry
404 Not Found Registry was not found. Error

Revoke/unrevoke credential

Code samples

# You can also use wget
curl -X POST /registries/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "action": "revoke",
  "credentialIds": [
    "http://example.com"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/registries/{id}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/registries/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/registries/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/registries/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /registries/{id}

Revoke or unrevoke one or more credential ids

Body parameter

{
  "action": "revoke",
  "credentialIds": [
    "http://example.com"
  ]
}

Parameters

Name In Type Required Description
body body object true Specify action and credential ids
» action body string false none
» credentialIds body [string] false none
id path Hex32 true Revocation registry id

Enumerated Values

Parameter Value
» action revoke
» action unrevoke

Example responses

200 Response

{
  "id": "string",
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK Will try to revoke/unrevoke the credential. JobStartedResult
400 Bad Request Invalid params Error
404 Not Found Registry was not found. Error

List registries

Code samples

# You can also use wget
curl -X GET /registries/ \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/registries/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/registries/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/registries/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/registries/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /registries/

Get all registries created by user

Example responses

200 Response

[
  {
    "id": "string",
    "registry": {
      "addOnly": true,
      "policy": [
        "did:dock:xyz"
      ]
    }
  }
]

Responses

Status Meaning Description Schema
200 OK All registries by user Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id Hex32 false none 32 byte hex string. Ignoring higher base (base64) for similicity.
» registry Registry false none Revocation registry
»» addOnly boolean false none none
»» policy [DID] false none Only one policy supported as of now called OneOf

Create registry

Code samples

# You can also use wget
curl -X POST /registries/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{
  "addOnly": true,
  "policy": [
    "did:dock:xyz"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/registries/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/registries/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/registries/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/registries/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /registries/

Create a Revocation registry on the blockchain

Body parameter

{
  "addOnly": true,
  "policy": [
    "did:dock:xyz"
  ]
}

Parameters

Name In Type Required Description
body body Registry true Revocation registry
» addOnly body boolean false none
» policy body [DID] false Only one policy supported as of now called OneOf

Example responses

200 Response

{
  "id": "string",
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK Will try to create registry. JobStartedResult
400 Bad Request Invalid params like policy not supported. Error

revocationStatus

Operations about revocation_status

Get revocation status

Code samples

# You can also use wget
curl -X GET /revocationStatus/{regId}/{revId} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/revocationStatus/{regId}/{revId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/revocationStatus/{regId}/{revId}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/revocationStatus/{regId}/{revId}', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/revocationStatus/{regId}/{revId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /revocationStatus/{regId}/{revId}

Get the revocation status of a credential

Parameters

Name In Type Required Description
regId path Hex32 true Revocation registry id
revId path Hex32 true Credential revocation id

Example responses

200 Response

{
  "type": true
}

Responses

Status Meaning Description Schema
200 OK Returns true of credential is revoked, false otherwise Inline
404 Not Found Registry was not found. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» type boolean false none none

schemas

Operations about schemas

Get schema

Code samples

# You can also use wget
curl -X GET /schemas/{schemaId} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/schemas/{schemaId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/schemas/{schemaId}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/schemas/{schemaId}', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/schemas/{schemaId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /schemas/{schemaId}

Returns the JSON schema for a specific ID

Parameters

Name In Type Required Description
schemaId path Hex32 true A schema id

Example responses

200 Response

{
  "id": "string",
  "schema": {}
}

Responses

Status Meaning Description Schema
200 OK Schema Inline
404 Not Found Schema was not found. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» id Hex32 false none 32 byte hex string. Ignoring higher base (base64) for similicity.
» schema object false none none

List schemas

Code samples

# You can also use wget
curl -X GET /schemas/ \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/schemas/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/schemas/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/schemas/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/schemas/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /schemas/

Get all schemas created by user

Example responses

200 Response

[
  {}
]

Responses

Status Meaning Description Schema
200 OK All schemas by user Inline

Response Schema

Create schema

Code samples

# You can also use wget
curl -X POST /schemas/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/schemas/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/schemas/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/schemas/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/schemas/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /schemas/

Creates a JSON schema on the blockchain

Body parameter

{}

Parameters

Name In Type Required Description
body body object true JSON-schema

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Will try to create schema. JobId
400 Bad Request Invalid params like size not supported or not JSON. Error

anchors

Operations about anchors

Get anchor

Code samples

# You can also use wget
curl -X GET /anchors/{anchor} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/anchors/{anchor}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/anchors/{anchor}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/anchors/{anchor}', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/anchors/{anchor}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /anchors/{anchor}

Gets a specific anchor by ID

Parameters

Name In Type Required Description
anchor path Hex32 true An anchor

Example responses

200 Response

{
  "anchor": "string",
  "blockHash": "string",
  "root": "string"
}

Responses

Status Meaning Description Schema
200 OK Anchor Anchor
404 Not Found Anchor was not found. Error

List anchors

Code samples

# You can also use wget
curl -X GET /anchors/ \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/anchors/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/anchors/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/anchors/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/anchors/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /anchors/

Get all anchors created by user

Example responses

200 Response

[
  {}
]

Responses

Status Meaning Description Schema
200 OK All anchors by user Inline

Response Schema

Create anchor

Code samples

# You can also use wget
curl -X POST /anchors/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '[
  "string"
]';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/anchors/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/anchors/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/anchors/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/anchors/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /anchors/

Anchor one or more documents. If more than one docs are given, a merkle tree is created and root is anchored

Body parameter

[
  "string"
]

Parameters

Name In Type Required Description
body body any true Documents

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK Will try to create Anchor. Anchor does not exist on network as of now. JobId
400 Bad Request Invalid params Error

jobs

Operations about jobs

Get job status and data

Code samples

# You can also use wget
curl -X GET /jobs/{id} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'


const headers = {
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/jobs/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.get('/jobs/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/jobs/{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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/jobs/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /jobs/{id}

Returns information related to the job being processed and its associated blockchain transaction. On completion or failure, the job data will be updated with a response from the blockchain.

Parameters

Name In Type Required Description
id path JobId true A Job id

Example responses

200 Response

{
  "id": "string",
  "status": "todo",
  "result": {}
}

Responses

Status Meaning Description Schema
200 OK Job desc JobDesc
404 Not Found Job id was not found. Error

verify

Verify a credential or presentation

Code samples

# You can also use wget
curl -X POST /verify/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

const inputBody = '{}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'DOCK-API-TOKEN':'API_KEY'
};

fetch('/verify/',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'DOCK-API-TOKEN': 'API_KEY'
}

r = requests.post('/verify/', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'DOCK-API-TOKEN' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/verify/', 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());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "DOCK-API-TOKEN": []string{"API_KEY"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/verify/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /verify/

Verifies a VCDM credential or presentation JSON-LD object.

Body parameter

{}

Parameters

Name In Type Required Description
body body object true JSON-schema

Example responses

200 Response

{
  "verified": true
}

Responses

Status Meaning Description Schema
200 OK The verification result VerificationResponse
400 Bad Request Invalid/insufficient credential params. Error

Schemas

Error

{
  "status": 0,
  "type": "string",
  "message": "string"
}

An API Error

Properties

Name Type Required Restrictions Description
status integer false none none
type string false none none
message string false none none

Hex32

"string"

32 byte hex string. Ignoring higher base (base64) for similicity.

Properties

Name Type Required Restrictions Description
anonymous string false none 32 byte hex string. Ignoring higher base (base64) for similicity.

JobStartedResult

{
  "id": "string",
  "data": {}
}

Object containing unique id of the background task and associated data. This id can be used to query the job status

Properties

Name Type Required Restrictions Description
id JobId false none Unique id of the background task. This id can be used to query the job status
data object false none none

JobId

"string"

Unique id of the background task. This id can be used to query the job status

Properties

Name Type Required Restrictions Description
anonymous string false none Unique id of the background task. This id can be used to query the job status

JobStatus

"todo"

Status of the job.

Properties

Name Type Required Restrictions Description
anonymous string false none Status of the job.

Enumerated Values

Property Value
anonymous todo
anonymous finalized
anonymous in_progress
anonymous error

JobDesc

{
  "id": "string",
  "status": "todo",
  "result": {}
}

Description of the job including result if available

Properties

Name Type Required Restrictions Description
id JobId false none Unique id of the background task. This id can be used to query the job status
status JobStatus false none Status of the job.
result object false none none

DIDQualified

"did:dock:xyz"

DID as fully qualified, eg. did:dock:.

Properties

Name Type Required Restrictions Description
anonymous string(uri) false none DID as fully qualified, eg. did:dock:.

DID

"did:dock:xyz"

DID as fully qualified, eg. did:dock: or 32 byte hex string

Properties

Name Type Required Restrictions Description
anonymous string false none DID as fully qualified, eg. did:dock: or 32 byte hex string

KeyType

"sr25519"

Type of public key for DID

Properties

Name Type Required Restrictions Description
anonymous string false none Type of public key for DID

Enumerated Values

Property Value
anonymous sr25519
anonymous ed25519
anonymous secp256k1

SigType

"Sr25519Signature2020"

Type of signature

Properties

Name Type Required Restrictions Description
anonymous string false none Type of signature

Enumerated Values

Property Value
anonymous Sr25519Signature2020
anonymous Ed25519Signature2018
anonymous EcdsaSecp256k1Signature2019

ProofPurpose

"assertionMethod"

Purpose of credential

Properties

Name Type Required Restrictions Description
anonymous string false none Purpose of credential

Enumerated Values

Property Value
anonymous assertionMethod
anonymous authentication

Context

[
  "string"
]

JSON-LD context

Properties

oneOf

Name Type Required Restrictions Description
anonymous [string] false none none

xor

Name Type Required Restrictions Description
anonymous string false none none

DIDDoc

{
  "@context": [
    "string"
  ],
  "id": "did:dock:xyz",
  "authentication": [
    {}
  ]
}

DID document. The current set of properties is incomplete

Properties

Name Type Required Restrictions Description
@context Context false none JSON-LD context
id DIDQualified false none DID as fully qualified, eg. did:dock:.
authentication [oneOf] false none none

oneOf

Name Type Required Restrictions Description
» anonymous object false none none

xor

Name Type Required Restrictions Description
» anonymous string false none none

Credential

{
  "id": "http://example.com",
  "context": [
    "string"
  ],
  "type": [
    "string"
  ],
  "subject": {},
  "issuer": "did:dock:xyz",
  "issuanceDate": "2019-08-24T14:15:22Z",
  "expirationDate": "2019-08-24T14:15:22Z",
  "status": {}
}

Credential format expected by API caller. The current set of is almost complete

Properties

Name Type Required Restrictions Description
id string(uri) false none none
context [string] false none none
type [string] false none none
subject object false none none
issuer any false none none

oneOf

Name Type Required Restrictions Description
» anonymous DIDQualified false none DID as fully qualified, eg. did:dock:.

xor

Name Type Required Restrictions Description
» anonymous object false none none

continued

Name Type Required Restrictions Description
issuanceDate string(date-time) false none none
expirationDate string(date-time) false none none
status any false none Revocation registry id or user supplied status object

oneOf

Name Type Required Restrictions Description
» anonymous object false none none

xor

Name Type Required Restrictions Description
» anonymous string false none none

VerifiablePresentation

{
  "@context": [
    "string"
  ],
  "id": "http://example.com",
  "type": [
    "string"
  ],
  "verifiableCredential": {
    "@context": [
      "string"
    ],
    "id": "http://example.com",
    "type": [
      "string"
    ],
    "credentialSubject": {},
    "issuer": "did:dock:xyz",
    "issuanceDate": "2019-08-24T14:15:22Z",
    "expirationDate": "2019-08-24T14:15:22Z",
    "credentialStatus": {},
    "proof": {
      "type": "Sr25519Signature2020",
      "proofPurpose": "assertionMethod",
      "verificationMethod": "string",
      "created": "2019-08-24T14:15:22Z",
      "proofValue": "string"
    }
  },
  "proof": {
    "type": "Sr25519Signature2020",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "string",
    "created": "2019-08-24T14:15:22Z",
    "proofValue": "string"
  }
}

Verifiable (signed) Presentation returned by API. The current set of properties is almost complete

Properties

Name Type Required Restrictions Description
@context Context false none JSON-LD context
id string(uri) false none none
type [string] false none none
verifiableCredential any false none none

oneOf

Name Type Required Restrictions Description
» anonymous VerifiableCredential false none Verifiable (signed) Credential returned by API. The current set of properties is almost complete

xor

Name Type Required Restrictions Description
» anonymous [VerifiableCredential] false none [Verifiable (signed) Credential returned by API. The current set of properties is almost complete]

continued

Name Type Required Restrictions Description
proof object false none none
» type SigType false none Type of signature
» proofPurpose ProofPurpose false none Purpose of credential
» verificationMethod string false none none
» created string(date-time) false none none
» proofValue string false none none

VerifiableCredential

{
  "@context": [
    "string"
  ],
  "id": "http://example.com",
  "type": [
    "string"
  ],
  "credentialSubject": {},
  "issuer": "did:dock:xyz",
  "issuanceDate": "2019-08-24T14:15:22Z",
  "expirationDate": "2019-08-24T14:15:22Z",
  "credentialStatus": {},
  "proof": {
    "type": "Sr25519Signature2020",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "string",
    "created": "2019-08-24T14:15:22Z",
    "proofValue": "string"
  }
}

Verifiable (signed) Credential returned by API. The current set of properties is almost complete

Properties

Name Type Required Restrictions Description
@context Context false none JSON-LD context
id string(uri) false none none
type [string] false none none
credentialSubject any false none none

oneOf

Name Type Required Restrictions Description
» anonymous object false none none

xor

Name Type Required Restrictions Description
» anonymous [object] false none none

continued

Name Type Required Restrictions Description
issuer any false none none

oneOf

Name Type Required Restrictions Description
» anonymous DIDQualified false none DID as fully qualified, eg. did:dock:.

xor

Name Type Required Restrictions Description
» anonymous object false none none

continued

Name Type Required Restrictions Description
issuanceDate string(date-time) false none none
expirationDate string(date-time) false none none
credentialStatus any false none Revocation registry id or user supplied status object

oneOf

Name Type Required Restrictions Description
» anonymous object false none none

xor

Name Type Required Restrictions Description
» anonymous string false none none

continued

Name Type Required Restrictions Description
proof object false none none
» type SigType false none Type of signature
» proofPurpose ProofPurpose false none Purpose of credential
» verificationMethod string false none none
» created string(date-time) false none none
» proofValue string false none none

Anchor

{
  "anchor": "string",
  "blockHash": "string",
  "root": "string"
}

An anchor. Either a batched or single. Data includes anchor, type (single, batch), block hash, block no and accompanying data (root, proofs) if any. The data depends if the anchor was created using API or not.

Properties

Name Type Required Restrictions Description
anchor Hex32 false none 32 byte hex string. Ignoring higher base (base64) for similicity.
blockHash Hex32 false none 32 byte hex string. Ignoring higher base (base64) for similicity.
root Hex32 false none 32 byte hex string. Ignoring higher base (base64) for similicity.

Registry

{
  "addOnly": true,
  "policy": [
    "did:dock:xyz"
  ]
}

Revocation registry

Properties

Name Type Required Restrictions Description
addOnly boolean false none none
policy [DID] false none Only one policy supported as of now called OneOf

VerificationResponse

{
  "verified": true
}

Whether a credential/presentation is verified or not

Properties

Name Type Required Restrictions Description
verified boolean false none none

Response

{
  "code": 0
}

Default response

Properties

Name Type Required Restrictions Description
code integer false none none