Copy const response = await fetch ( 'https://api-testnet.truvera.io/verify' , {
method : 'POST' ,
headers : {
"Content-Type" : "application/json"
} ,
body : JSON .stringify ({
"description" : "<p>Verifiable Presentation that has been signed</p>" ,
"type" : "object" ,
"properties" : {
"@context" : {
"description" : "<p>JSON-LD context array of strings or single string</p>" ,
"example" : "https://docknetwork.github.io/vc-schemas/basic-credential.json-ld" ,
"oneOf" : [
{
"type" : "array" ,
"items" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "object"
}
]
}
} ,
{
"type" : "string"
}
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "Context"
} ,
"id" : {
"type" : "string" ,
"format" : "uri"
} ,
"type" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"verifiableCredential" : {
"oneOf" : [
{
"description" : "<p>Verifiable (signed) Credential returned by API. The current set of properties is almost complete</p>" ,
"type" : "object" ,
"properties" : {
"@context" : {
"description" : "<p>JSON-LD context array of strings or single string</p>" ,
"example" : "https://docknetwork.github.io/vc-schemas/basic-credential.json-ld" ,
"oneOf" : [
{
"type" : "array" ,
"items" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "object"
}
]
}
} ,
{
"type" : "string"
}
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "Context"
} ,
"id" : {
"type" : "string"
} ,
"type" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"credentialSubject" : {
"oneOf" : [
{
"type" : "object"
} ,
{
"type" : "array" ,
"items" : {
"type" : "object"
}
}
]
} ,
"issuer" : {
"oneOf" : [
{
"description" : "<p>DID as fully qualified, typically. <code>did:dock:</code></p>" ,
"type" : "string" ,
"minimum" : 32 ,
"example" : "did:dock:xyz" ,
"__$markdownParsed" : true ,
"__$refResolved" : "DID"
} ,
{
"type" : "object"
}
]
} ,
"issuanceDate" : {
"type" : "string" ,
"format" : "date-time"
} ,
"expirationDate" : {
"type" : "string" ,
"format" : "date-time"
} ,
"credentialStatus" : {
"description" : "<p>Revocation registry id or user supplied status object</p>" ,
"oneOf" : [
{
"type" : "object"
} ,
{
"type" : "string"
}
] ,
"__$markdownParsed" : true
} ,
"proof" : {
"oneOf" : [
{
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
} ,
{
"type" : "array" ,
"items" : {
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
}
}
]
}
} ,
"__$markdownParsed" : true ,
"__$refResolved" : "VerifiableCredential"
} ,
{
"type" : "array" ,
"items" : {
"description" : "<p>Verifiable (signed) Credential returned by API. The current set of properties is almost complete</p>" ,
"type" : "object" ,
"properties" : {
"@context" : {
"description" : "<p>JSON-LD context array of strings or single string</p>" ,
"example" : "https://docknetwork.github.io/vc-schemas/basic-credential.json-ld" ,
"oneOf" : [
{
"type" : "array" ,
"items" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "object"
}
]
}
} ,
{
"type" : "string"
}
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "Context"
} ,
"id" : {
"type" : "string"
} ,
"type" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"credentialSubject" : {
"oneOf" : [
{
"type" : "object"
} ,
{
"type" : "array" ,
"items" : {
"type" : "object"
}
}
]
} ,
"issuer" : {
"oneOf" : [
{
"description" : "<p>DID as fully qualified, typically. <code>did:dock:</code></p>" ,
"type" : "string" ,
"minimum" : 32 ,
"example" : "did:dock:xyz" ,
"__$markdownParsed" : true ,
"__$refResolved" : "DID"
} ,
{
"type" : "object"
}
]
} ,
"issuanceDate" : {
"type" : "string" ,
"format" : "date-time"
} ,
"expirationDate" : {
"type" : "string" ,
"format" : "date-time"
} ,
"credentialStatus" : {
"description" : "<p>Revocation registry id or user supplied status object</p>" ,
"oneOf" : [
{
"type" : "object"
} ,
{
"type" : "string"
}
] ,
"__$markdownParsed" : true
} ,
"proof" : {
"oneOf" : [
{
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
} ,
{
"type" : "array" ,
"items" : {
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
}
}
]
}
} ,
"__$markdownParsed" : true ,
"__$refResolved" : "VerifiableCredential"
}
}
]
} ,
"proof" : {
"oneOf" : [
{
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
} ,
{
"type" : "array" ,
"items" : {
"type" : "object" ,
"properties" : {
"type" : {
"description" : "<p>Type of signature (NOTE: EcdsaSecp256k1Signature2019, Sr25519Signature2020 are deprecated)</p>" ,
"type" : "string" ,
"enum" : [
"Ed25519Signature2018" ,
"Ed25519Signature2020" ,
"Bls12381BBS+SignatureDock2022" ,
"Bls12381BBS+SignatureProofDock2022" ,
"Bls12381BBDT16MACDock2024" ,
"Bls12381BBSSignatureDock2023" ,
"Bls12381BBSVerificationKeyDock2023" ,
"BJJSignature2021" ,
"EcdsaSecp256k1Signature2019" ,
"Sr25519Signature2020"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "SigType"
} ,
"proofPurpose" : {
"description" : "<p>Purpose of credential</p>" ,
"type" : "string" ,
"enum" : [
"assertionMethod" ,
"authentication"
] ,
"__$markdownParsed" : true ,
"__$refResolved" : "ProofPurpose"
} ,
"verificationMethod" : {
"type" : "string"
} ,
"created" : {
"type" : "string" ,
"format" : "date-time"
} ,
"proofValue" : {
"type" : "string"
}
} ,
"__$refResolved" : "VerifiableProof"
}
}
]
}
} ,
"__$markdownParsed" : true ,
"__$refResolved" : "VerifiablePresentation"
}) ,
});
const data = await response .json ();