Skip to main content
POST
/
certificates?type=file
Create a certificate from a file.
curl --request POST \
  --url 'https://lab.trustos.telefonicatech.com/cert/v2/certificates?type=file' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form fileInput='@example-file' \
  --form 'body={
  "name": "Certificate",
  "description": "Certificate description",
  "content": {},
  "public": true,
  "expires": 1234567890,
  "certificatePin": "1234",
  "externalId": "extcertid"
}'
{
  "statusCode": 201,
  "message": "Certificate created",
  "data": {
    "certID": "did:local:certid:123124",
    "data": {
      "name": "Certificate",
      "description": "Certificate description",
      "type": "content",
      "content": {},
      "issuer": "did:user:{issuer}",
      "issuedOn": 1696840286580,
      "hash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
      "expires": 1696840286580
    },
    "metadata": [
      {
        "type": "Evidence",
        "networkId": 10004,
        "smartContract": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
        "transactionHash": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
        "trustPointHash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
        "timestamp": 1696840286580
      }
    ],
    "access": {
      "public": true,
      "certificatePin": "1234",
      "externalId": "extcertid"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

qualified
enum<boolean>

Flag that indicates whether the certificate should be qualified sign.

Available options:
true,
false
publish
enum<boolean>

Flag that indicates if the file should be published in the file repository. Public files are accessible by anyone with the file's URL. Handle with caution to avoid unintended data exposure.

Available options:
true,
false
networkId
string
required

Network identifier where the trustpoint will be registered.

Example:

10004

Body

multipart/form-data

Data needed for the creation of a certificate from a file.

fileInput
file
required

File which will be hashed and certified.

body
object
required

Response

Successful certificate creation.

statusCode
integer

Request status code.

Example:

201

message
string

Message returned by the request.

Example:

"Certificate created"

data
object

Data returned by the request.