The information provided in this section explains the various APIs provided by the Protegrity Synthetic Data and the method for generating Synthetic Data.
This is the multi-page printable view of this section. Click here to print.
Using Protegrity Synthetic Data
1 - Understanding the Protegrity Synthetic Data REST APIs
The following APIs are available with Protegrity Synthetic Data REST API for generating and analyzing Synthetic Data. You can run these APIs using the command line with the curl command or submit the command using the default Swagger UI provided or a tool, such as Postman.
Scheduling APIs
This API is used to start Protegrity Synthetic Data job. The job generates the best Synthetic Data. However, parameters are available for you to customize to generate data as per your requirements.
Generate API
Use this API to start the Protegrity Synthetic Data job. You can specify the number of rows required and run the job using the configuration. The default configuration analyzes the source data and determines the best configuration for processing the request. It learns the source and trains a model that is used for generating Synthetic Data. Alternatively, you can modify the configuration according to your requirements for running the job. The API generates a job ID that you can use to work and monitor the status of the job.
For more information about the generate API, refer to Generate API.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /generate
Parameters:
- n: Specify the number of records to generate.
- name: Specify a name for the job.
- tag: Specify the tag details for the job. The tag contains the domain and sub domain information.
- source: Specify the source file details.
- target: Specify the destination file details.
- other params: Specify the required details for generating the Synthetic Data.
Method: POST
Sample Request:
curl -X 'POST' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/generate?n=10' \\ -H 'accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '\{ "name": "Generate Data-Test", "tag": \{ "domain": "Domain Name", "subdomain": "Sub-Domain Name" \} \}'
Monitoring APIs
These APIs are used to monitor Synthetic Data jobs. Use these APIs to obtain the job status, retrieve a job, abort a job, and delete a job.
Get Job IDs
Use this API to get the job IDs of the operations that are running, in queue, or completed. You can then use the required job ID with the other APIs to work with the job.
For more information about the job ID API, refer to Get Job ID.
Base URL: https://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /jobs
Parameters:
- Running: Displays a list of jobs that are running.
- InQueue: Displays a list of jobs that are queued.
- Completed: Displays a list of jobs that are complete.
- Failed: Displays a list of jobs that have failed.
- Aborted: Displays a list of jobs that have been aborted.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/jobs?status=Running\|InQueue\|Completed&limit=10'
Get Job Status
Use this API to get the status of a job. It shows the percentage of job completion. Use the information provided here to monitor if a job is running.
For more information about the job status API, refer to Get Job Status.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /jobs/{jobId}
Parameter:
jobId: a string that specifies the ID of the job of which the status must be retrieved. The jobid is obtained in the request body when a job is scheduled.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/jobs/842aac73-1ec9-4450-af26-935e33791216'
Delete
Use this API to delete an existing job that is no longer required.
For more information about the delete API, refer to Delete an Existing Job.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /jobs/{jobId}
Parameter:
jobId: a string that specifies the ID of the job that must be deleted.
Method: DELETE
Sample Request:
curl -X 'DELETE' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/jobs/842aac73-1ec9-4450-af26-935e33791216'
Get Metadata
Use this API to retrieve the metadata for the existing job. This API is useful when you need to view the configuration available for a job. It displays the fields and configuration that is used to run the job.
For more information about the metadata API, refer to Get Metadata.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /jobs/{jobId}/meta
Parameter:
jobId: a string that specifies the ID of the job for which the metadata must be retrieved.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/jobs/6a1b1a3a-0ea3-4b93-ab4c-ffc6d404b4e6/meta'
Abort
Use this API to abort a running job. You can abort jobs if you need to modify the parameters or if the job takes too much time or resources to conclude.
For more information about the abort API, refer to Abort a Running Job.
Note: After aborting the task, it might take time before all the running processes are stopped.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /jobs/{jobId}/abort?body=PLACEHOLDER
Parameter:
jobId: a string that specifies the ID of the job that must be aborted.
Method: POST
Sample Request:
curl -X 'POST' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/jobs/ce5793b2-4434-4104-acff-26651de018d8/abort?body=PLACEHOLDER'
Reporting APIs
These APIs provide analysis information about the job. Use these APIs to validate and view the quality of the job and the Synthetic Data that is generated.
Get Report
Use this API to get the report of the job using the job ID.
For more information about the get report API, refer to Get Report.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /reports/{job_id}
Parameters:
job\_id: Specify the job id for retrieving the report.format: Specify the format in which the report must be retrieved. html or pdf.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/reports/a1b2c3d4' \\ -H 'accept: application/json'
Get Evaluation Metrics
Use this API to get the evaluation metrics of the job using the job ID.
For more information about the get evaluation metric API, refer to Get Evaluation Metrics.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /reports/{job_id}/metrics
Parameter:
job\_id: Specify the job id for retrieving the evaluation metrics.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/reports/a1b2c3d4/metrics' \\ -H 'accept: application/json'
Get Domains
Use this API to get all the domain and sub domain information. In addition to the domain information, the API also returns additional information, such as, the last updated data, the model ID, and the URL for viewing the report data.
For more information about the get report API, refer to Get Domains.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /domains
Parameters:
domainFilter: Specify the domain for retrieving data.subDomainFilter: Specify the sub domain for retrieving data.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/domains?domainFilter=domain\_name&subDomainFilter=subdomain\_name' \\ -H 'accept: application/json'
Model Management APIs
These APIs are used to manage the models used for generating Synthetic Data. The source data is analyzed, and a model is trained. This model is used for generating Synthetic Data. Use these APIs to list information about the model or to archive a model so that it is not used in production.
Get Model Details
Use this API to retrieve the model details using the domain and sub domain details. The API retrieves the configuration information that was used for training the model.
For more information about the Models API, refer to Get Model Details.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1
Path: /models
Parameters:
domain: Specify the domain name for retrieving the model.subdomain: Specify the sub domain name for retrieving the model.
Method: GET
Sample Request:
curl -X 'GET' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/models/?domain=america&subdomain=north' \\ -H 'accept: application/json'
Delete Model API
Use this API to remove the model that is generated. This API ensures that the model is not used in production.
For more information about removing the model API, refer to Delete Model API.
Base URL: http://syndata.protegrity.com/pty/synthetic-data/v1/
Path: /models
Parameters:
domain: Specify the domain name for deleting the model.subdomain: Specify the sub domain name for deleting the model.includeProdModels: Specify true to include production models for deletion or retain the production model.
Method: Delete
Sample Request:
curl -X 'DELETE' \\ 'http://syndata.protegrity.com/pty/synthetic-data/v1/models/?domain=america&subdomain=north&includeProdModels=true' \\ -H 'accept: application/json'