Anonymization API endpoints are accessed from the Anonymization API page on the SAP Business Accelerator Hub .
The following API endpoints are available for data pseudonymization:
Your API response includes the following compressed files:
pseudonymized_document.json: Entities are replaced with the defined pseudonyms. If the pseudonymization tag is empty, the default action is to remove the corresponding entity from the pseudonymized text:
Example: <<PROFILE_TAG>:entity_to_be_pseudonymized_UUID>
metadata.json: JSON file with mappings between pseudonyms and their corresponding rentities. This mapping includes comprehensive information about the specific positions where these pseudonyms appear in the pseudonymized text:
Example: {"report": "<<PROFILE_TAG>: UUID-of-the-entity>":"{"real_entity":"pseudonymized_entity", "positions": [(start_position, end_position), ...]}, ..."}
Example of a plain text data pseudonymization request:
Sample Code
POST /anonymization/api/v1.0/unstructureddata/pseudonymize/text
url-params:
sync=True <whether to get response synchronously>
Form-data:
text: <text to anonymize>
entities=<entities to anonymize in the text separated by ;>
anonymization-method-per-profile: <anonymization method to apply for detected entities>
Response
<pseudonymized text with tags and UUID of the entities, as well as the metadata of their positions>
// HTTP/1.1 200 OK
Example of a plain text data pseudonymization request with pseudonymization metadata:
Sample Code
POST /anonymization/api/v1.0/unstructureddata/pseudonymize/text
url-params:
sync=True <whether to get response synchronously>
Form-data:
text: <text to anonymize>
entities=<entities to anonymize in the text separated by ;>
anonymization-method-per-profile: <anonymization method to apply for detected entities>
pseudonymization-metadata: <JSON object mapping custom keys to entity data>
Structure: {
"custom_key": {
"real_entity": "<original entity value>",
"entity_profile": "<profile name>"
{
{ }
}}
}{}Response<pseudonymized text with tags and UUID of the entities, as well as the metadata of their positions, with custom keys mapping to the entity data as provided in the request>
// HTTP/1.1 200 OK