We have some code samples to make getting going with implementing your API client easier.
Both programs demonstrate:
- Getting the token
- Getting the tags in the project
- Adding a new tag
- Deleting a tag
- Importing JSON
- Importing CSV
- Listing the batches
- Deleting a batch
- Activating a batch
- Getting Activation history
The code in both assumes a fresh project.
C# Code Sample
Full code is available here
The sample uses .Net framework v4.7.2
The sample should be used in Visual Studio, step through the code to see the operations. There is no output from the application.
The arguments to be supplied are server, project id, username and password
The code assumes a fresh project, if you want to work with an existing project you would change the batch id's referenced.
Python Code Sample
Full code sample here
This sample has the same functions as the c# sample. It also takes the arguments for server, project id, username and password.
The code assumes a fresh project, if you want to work with an existing project you would change the batch id's referenced:
# delete imported batches delete_batches_payload = models.DeleteBatchesInput(batches_to_delete=[1,2]) response = client.import_model.delete_batches(delete_batches_payload, project_id, headers) # activate/deactivate batches activate_batches_payload = models.ActivateInput(ids_to_activate=[1,2], ids_to_deactivate=[3,4]) response = client.activation.activate(activate_batches_payload, project_id, headers)
The code is assuming here there are batches 1,2,3 and 4 in the test project.