Getting Started
  • Protecto Overview
    • Introduction
      • Quickstart Guide
      • Protecto Vault
        • What is a token?
        • Token customization
        • Authentication
        • Tokenization APIs
          • Masking
            • Mask with token
            • Mask with format and token
            • Identify and mask (Auto-detect)
          • Unmasking
          • What happens if an API fails?
        • Asynchronous API's
        • Bulk data
      • Add new data source
        • Snowflake
          • Create and grant access to Protecto
          • Add Snowflake to Protecto
        • Salesforce
          • Create connected app and user
            • Steps to create connected app
            • Steps to create Protecto user
          • Add Salesforce to Protecto
        • Azure SQL
          • Connect using AD Application credentials
          • Connect using database user credentials
        • Databricks
          • Add Service principal (Azure AD Application) to Databricks
          • Steps to create Azure Databricks Cluster
          • Steps to create Databricks python notebook and schedule job
        • Redshift
          • Create and grant access to Protecto user
          • Add Redshift to Protecto
      • Protecto FAQ's
        • 1. What are the steps after we sign up for a Protecto account?
        • 2. Can I sign up for a free account? How long is the trial period?
        • 3. What is Protecto license key? How can I get a new license key?
        • 4. How do I extend the trial period?
        • 5. What is the Protecto pricing model?
        • 6. How do I cancel my account?
        • 7. How do I unsubscribe / opt-out from emails?
      • Compliance User Guide
        • Risk Identification: Key Definitions
        • Understanding Risks
          • Find assets with severe breach risk
          • Filter assets by breach risk level
          • Find assets with other privacy risks
        • Understanding Usage
          • Find the data assets that were accessed
          • Find the data assets that are not used
        • Add Tags & Classification
          • Add tags globally
          • Classify tags to the categories
          • Add tags with category to the data assets
          • Remove tags with category from the data assets
        • Governance
          • Find all data assets
          • Add/delete purposes
          • Assign data owner for a data asset
          • Add/delete consent, data subject type and location for a data asset
          • Add/update retention time for a data asset
          • Add/update minor data for a data asset
        • Generate Compliance Reports
          • ROPA (Records of Processing Activities)
          • DPIA (Data Protection Impact Assessment)
Powered by GitBook
On this page
  1. Protecto Overview
  2. Introduction
  3. Protecto Vault
  4. Tokenization APIs

What happens if an API fails?

PreviousUnmaskingNextAsynchronous API's

Last updated 1 year ago

When an API fails, it means that the intended operation or task could not be completed as expected. API failures can occur for various reasons, including client-side errors, server-side issues, network problems, or incorrect API usage. Here's what typically happens when an API fails:

HTTP Status Codes: APIs often use HTTP status codes to indicate the outcome of a request. These codes provide information about whether the request was successful or encountered an error. Common HTTP status codes include:

Status Code
Description

200

OK

201

Created

400

Bad request

401

Unauthorized (Invalid AuthToken)

404

URL Not Found

405

Method Not Allowed (Method you have called is not supported for the invoked API)

429

Rate Limit Exceeded (API usage limit exceeded)

500

Internal Error

Error Messages: APIs often include error messages or error codes in the response payload to provide more specific details about what went wrong. These messages help developers diagnose the issue and take appropriate action.

For more detailed information, please reach out at .

:

1. if payload length is empty

sample input:{"mask": [ ]}

error response:{"data": null,"success": false,"error": {"message": "Payload is empty"}}

2. if 'mask' key not in payload

sample input:[{ "value": “George Williams","token_name": "Numeric Token"}]}

error response:{"data": null,"success": false,"error": {"message": "mask data missing"}}

3. if value is not there in input:

sample input:{"mask": [{ "value": "","token_name": "Numeric Token"}]}

error response:{"data": null,"success": false,"error": { "message": "Missing value"}}

4. if "token_name" is not there in input:

sample input:{"mask": [{ "value": "George Williams","token_name": ""}]}

error response:{"data": null,"success": false,"error": { "message": "Missing token_name"}}

5.if given token_name is not created or 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>}"}}

6. if the format is empty

sample input:{"mask": [{ "value": "George Williams","token_name": "Numeric Token","format":""}]}

error response:{"data": null,"success": false, "error": { "message": "Missing format"}}

7. if the given format is invalid or not created:

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>}}}

8. if metadata for masking is missing

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"}}

9. if subscription exhausted for user:

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."}}

10. if masked data is too long

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." }}

11. if mask operation fails after 3 retries

sample input:{ "data": null,"success": false, "error": {"message": "Masking failed after 3 retries"}}

unmask api error messages: error_code: 500

1. if payload length is empty

sample input:{“unmask":[{}]}

{ "data": null, "success": false, "error": { "message": "Payload is empty" }}

2. if 'unmask' key not in payload

sample input:[{“token_value”:"2333"}]}

error response: { "data": null, "success": false,"error": { "message": "unmask data missing"}}

3. if 'token_value' not in unmask payload

sample input:{“unmask”:[{“token_value”:" "}]}

error response:{"data": null, "success": false, "error": {"message": "Missing token value field "}}

4. if 'token_value' field is empty

sample input:{“unmask”:[{"2333"}]}

error response:{"data": null, "success": false, "error": {"message": "Missing token value"}}

5. if unmasking failed

error response:{"data": null, "success": false, "error": { "message": "Unmasking of given token values failed." }}

Authentication error messages : error_code: 401

Note: To send a request with the authentication token, include the following in headers:

Headers: {"Authorization": "Bearer <AUTH_TOKEN>"}

1. If the auth token is not there in the authorization headers

{ "detail": "To access Protecto, a valid license is required. Please create an account to execute the code"}

(or)

{"detail": "Your license is currently being generated. Please wait for a moment before running the code."}

2. if the auth token is expired

{ "detail": "Protecto's license has expired. To execute the code, please contact help@protecto.ai."}

3. if no Authorization header

{ "detail": "Access token has expired or is not yet valid."}

(or)

{ "detail": "Not authenticated"}

help@protecto.ai