TOИIC
Search…
Getting started with the Tonic API
See Tonic's API Documentation for more detailed information on the different endpoints, their parameters, and their responses.

1. Create an API token

API tokens are created in the application on the user settings page. The user settings page can be found in the menu to the right side of the Generate button.
Once a token is created, set your authorization header to Authorization: Apikey <token>. This type of token does not expire but can be revoked by the user who created it.

2. Create a new workspace

/api/Workspace
If successful, the response would return the workspace id that was created.

3. Assign a new source database

/api/DataSource/source_db
Connect a source DB to your workspace that was created in the previous step.

4. Assign a new destination database

/api/DataSource/destination_db
Connect a destination database of the same type as the source database to your workspace.

5. Specify the table mode for the source database tables

/api/Workspace/{workspaceId}/bulk_table_mode
See the table modes section for more information

6. Apply generators to columns

/api/Workspace/{workspaceId}/update_replacements/{schema}/{table}
Apply Tonic generators as desired to columns.
Before starting a data generation job, it's recommended that you check for any schema changes on the source database by:
  • Reviewing changes and resolving them through the Schema Changes page
  • Sending an API request to /api/SchemaDiff to view the changes followed by /api/SchemaDiff/resolve_multiple to resolve any that appear.

7. Add data generation job to the queue

/api/GenerateData/start
You're now ready to submit a new data generation job! If successful, the response would return the DatabaseScanId.

8. Monitor your job's status

/api/GenerateData/jobs/{databaseScanId}
You can poll this API endpoint to get periodic job status updates.
See the jobs section for more information