Skip to main content

Add your public key

This operation allow you to upload a public key to cipher sensitive data in responses. Certain services did not work if a public key is not loaded because the necessary information needs to be returned always ciphered. See Encryption for information about generate encryption/decryption keys.

note

The public key is associated with the Api Key for the client. If the client has more than one Api Keys, every Api Key must upload it's own public key.

note

The public key must be 2048 bits long.

note

The public_key must be sended as one string, all the newlines must be represented with '\n' character and must split the string every 64 characters like the request example.

HTTP Request

POST /clients/api_key/public_key

Header Parameters

HeaderDescription
Authorization 
required
The Bearer token created in
Get authorization Token
Content-Type
required
application/json

Body Parameters

ParameterTypePatternDescription
public_key 
required
stringRSA public keyClient's public key to be registered.

Example JSON Request:

{
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuSH7IAJikX+jhtH8RROa\nWvwc4ISXXOCufLFk5DIrzK8thXpgAvFe9mg2J0kg5DSu0+FMLbfmmiMGsAElirs7\nK3LO2SgGLultdLdDcnlDNqXJNTJudhhVcAcIP93UBoN8XgH9rnqdXB4GXCGk5QCz\nV/Cfk6O8VyIKG9mGlRx5HJkPyjnJfrYptoNag9hMBc+TIfuhlOycG3+C1KdOUvsL\nQet6twHr0NBt8NyAOAP32v9slRFZS1tWn2ZcJMIfb+qYspcNhV1LB1CijHyjImaC\nOhyh3Cbf3/u7xv0qoHHmPcUmXniA9I+yA4taogx0NUE1pWjXqqtKjBhpS57leh60\nxQIDAQAB\n-----END PUBLIC KEY-----"
}

Example JSON Response:

{
"success": true,
"code": 0,
"message": "OK",
"data": {
"client": {
"id": "12345abc-ebb5-56d8-3256-9875672a3455",
"name": "CAPSULE CORP",
"alias": "CAPSULE"
},
"api_key": {
"id": "15aad21d-f6fb-481e-bb12-ae3256987ff0",
"alias": "DEFAULT_API_KEY",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuSH7IAJikX+jhtH8RROa\nWvwc4ISXXOCufLFk5DIrzK8thXpgAvFe9mg2J0kg5DSu0+FMLbfmmiMGsAElirs7\nK3LO2SgGLultdLdDcnlDNqXJNTJudhhVcAcIP93UBoN8XgH9rnqdXB4GXCGk5QCz\nV/Cfk6O8VyIKG9mGlRx5HJkPyjnJfrYptoNag9hMBc+TIfuhlOycG3+C1KdOUvsL\nQet6twHr0NBt8NyAOAP32v9slRFZS1tWn2ZcJMIfb+qYspcNhV1LB1CijHyjImaC\nOhyh3Cbf3/u7xv0qoHHmPcUmXniA9I+yA4taogx0NUE1pWjXqqtKjBhpS57leh60\nxQIDAQAB\n-----END PUBLIC KEY-----"
}
}
}