1. Payload Length Error
Sample Input: {"mask": [ ]}
Error Response: {"data": null,"success": false,"error": {"message": "Payload is empty"}}
When the payload length is empty, your application should respond with an appropriate error message indicating that the payload is empty.
2. Missing ‘mask’ Key in Payload
Sample Input: [{ "value": "George Williams","token_name": "Numeric Token"}]
Error Response: {"data": null,"success": false,"error": {"message": "mask data missing"}}
In case the ‘mask’ key is missing in the payload, your application should generate an error response stating that the required ‘mask’ data is missing.
3. Missing ‘value’ in Input
Sample Input: {"mask": [{ "value": "","token_name": "Numeric Token"}]}
Error Response: {"data": null,"success": false,"error": { "message": "Missing value"}}
When the ‘value’ field is not provided in the input, your application should respond by indicating that the value is missing.
4. Missing ‘token_name’ in Input
Sample Input: {"mask": [{ "value": "George Williams","token_name": ""}]}
Error Response: {"data": null,"success": false,"error": { "message": "Missing token_name"}}
If the ‘token_name’ field is empty or not provided, your application should generate an error message stating that the ‘token_name’ is missing.
5. Invalid ‘token_name’
Sample Input: {"mask": [{ "value": "George Williams","token_name": "dfdfd"}]}
Error Response: {"data": null,"success": false,"error": {"message": "token_name not defined: {<INVALID_TOKEN_NAME>}"}}
When an invalid or nonexistent ‘token_name’ is provided, your application should return an error message specifying that the token_name is not defined.
6. Missing ‘format’ in Input
Sample Input: {"mask": [{ "value": "George Williams","token_name": "Numeric Token","format":""}]}
Error Response: {"data": null,"success": false, "error": { "message": "Missing format"}}
If the ‘format’ field is empty or not provided, your application should generate an error message indicating that the ‘format’ is missing.
7. Invalid ‘format’
Sample Input: {"mask": [{ "value": "George Williams","token_name": "Numeric Token","format":"fdfdf"}]}
Error Response: {"data": null,"success": false,"error": { "message": "format name not defined: {<INVALID_FORMAT_NAME>}}}
When an invalid or nonexistent ‘format’ is provided, your application should return an error message specifying that the format name is not defined.
8. Missing Metadata for Masking
Sample Input: {"mask": [{ "value": "George Williams","token_name": "dd","format":"fdfdf"}]}
Error Response: {"data": null, "success": false, "error": {"message": "Token and Format Metadata not available"}}
If essential metadata for masking is missing, your application should respond with an error message indicating that both token and format metadata are required.
9. Subscription Exhausted
Sample Input: {"mask": [{ "value": "George Williams","token_name": "Numeric Token","format":"Person Name "}]}
Error Response: {"data": null, "success": false, "error": { "message": "You have exceeded the maximum number of token creation limit for your trial subscription. To upgrade your subscription, please contact help@protecto.ai."}}
When a user’s subscription is exhausted, your application should notify them with a message that they have exceeded their token creation limit and provide information on how to upgrade their subscription.
10. Masked Data Length Exceeded
Sample Input: {"data": null,"success": false,"error": {"message": "Masked data exceeds the approved limit of 600 characters. Please split the input value and try again." }}
If the masked data exceeds the approved character limit, your application should generate an error message advising the user to split the input value and try again.
11. Masking Operation Failure
Sample Input: {"data": null,"success": false, "error": {"message": "Masking failed after 3 retries"}}
When the masking operation fails after a specific number of retries, your application should return an error message indicating that the masking process has failed.