Create Proof

Description

Creates an identity proof.

Request

HTTP Method: POST

URI Path: /v3/proofs

Request Body Object Relationships:

Name

Type

Is Required?

Description

files

string

Yes

The ID of encrypted files associated to this proof.

proof_types

string

Yes

The ID of proof type associated to this proof.

entity

string

Yes

Allowed entity types: identities or addresses

Examples

http

POST /v3/proofs HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "proofs",
    "relationships": {
      "files": {
        "data": [
          {
            "id": "cc52b6b3-0627-47d3-a1c9-b54d3de42813",
            "type": "encrypted_files"
          }
        ]
      },
      "proof_type": {
        "data": {
          "id": "d2c1b3fb-29f7-46ca-ba82-b617f4630b78",
          "type": "proof_types"
        }
      },
      "entity": {
        "data": {
          "id": "54c92d8e-f135-4b55-ac48-748d44437509",
          "type": "identities"
        }
      }
    }
  }
}

curl

curl -i -X POST https://api.didww.com/v3/proofs -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"relationships": {"entity": {"data": {"id": "54c92d8e-f135-4b55-ac48-748d44437509", "type": "identities"}}, "files": {"data": [{"id": "cc52b6b3-0627-47d3-a1c9-b54d3de42813", "type": "encrypted_files"}]}, "proof_type": {"data": {"id": "d2c1b3fb-29f7-46ca-ba82-b617f4630b78", "type": "proof_types"}}}, "type": "proofs"}}'

response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
    "data": {
        "id": "84155378-88d5-456e-844d-103596e3fb2c",
        "type": "proofs",
        "attributes": {
            "created_at": "2021-03-28T18:01:50.387Z",
            "expires_at": null
        },
        "relationships": {
            "proof_type": {
                "links": {
                    "self": "https://sandbox-api.didww.com/v3/proofs/84155378-88d5-456e-844d-103596e3fb2c/relationships/proof_type",
                    "related": "https://sandbox-api.didww.com/v3/proofs/84155378-88d5-456e-844d-103596e3fb2c/proof_type"
                }
            },
            "entity": {
                "links": {
                    "self": "https://sandbox-api.didww.com/v3/proofs/84155378-88d5-456e-844d-103596e3fb2c/relationships/entity",
                    "related": "https://sandbox-api.didww.com/v3/proofs/84155378-88d5-456e-844d-103596e3fb2c/entity"
                }
            }
        }
    },
    "meta": {
        "api_version": "2021-12-15"
    }
}

Other Responses

Code

Success

Description

401

No

Unauthorized