Consolidated Analytics API Code Samples
Selection of code samples that demonstrate the use of the Consolidated Analytics (CA) APIs. Copy and edit these code samples to suit your needs.
When using the code samples, remember to replace:
- {vanity_name} with your tenant name
- {api_key} with your API key
- {security_token} with a valid security token
These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Consolidated Analytics" in API Reference.
Retrieve a list of all consolidated analytics tenants
Use this sample request to retrieve all the existing CA tenants. You can use the returned IDs in other API calls to retrieve a specific CA tenant's details, change a tenant's source tenants or excluded sources, or even deprovision a tenant.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns details about each existing consolidated analytics tenant.
Retrieve a consolidated analytics tenant's source tenants
Use this sample request to retrieve all the source tenants used in a CA tenant.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/source-tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns details about the requested CA tenant.
Retrieve a consolidated analytics tenant's excluded sources
Use this sample request to retrieve all the excluded sources used in a CA tenant.
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/excluded-sources' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
The response returns details about the requested CA tenant.
Create a consolidated analytics tenant
Use this sample request to create a new consolidated analytics tenant.
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/admin/consolidated-analytics/tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"tenantCode": "WFF_j1r~CAtenant"}'
The response returns the results of the API call.
Set a consolidated analytics tenant's source tenants
Use this sample request to define the source tenants associated with the consolidated analytics tenant.
Caution: In PUT (update) API calls, the request body replaces the target resource. When updating a tenant, the PUT request body must contain all the tenants you want to use in the consolidated tenant.
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/source-tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"tenantCodes": ["WFF_j1r~c7o", "WFF_j1r~e1a"]}'
The response returns the updated list of source tenants.
Add source tenants to a consolidated analytics tenant
Use this sample request to add source tenants to the list of source tenants for a consolidated analytics tenant.
curl -X PATCH --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/source-tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"tenantCodes": ["WFF_j1r~c7o", "WFF_j1r~e1a"]}'
The response returns the updated list of source tenants.
Remove source tenants from a consolidated analytics tenant
Use this sample request to remove source tenants from the list of source tenants for a consolidated analytics tenant.
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/source-tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"tenantCodes": ["WFF_j1r~c7o", "WFF_j1r~e1a"]}'
The response returns the updated list of source tenants.
Set a consolidated analytics tenant's excluded sources
Use this sample request to define the list of excluded sources for a consolidated analytics tenant.
Caution: In PUT (update) API calls, the request body replaces the target resource. When updating a tenant, the PUT request body must contain all the sources you want to exclude from the consolidated analytics tenant.
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/excluded-sources' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"excludedSources": ["Candidate", "Requisition"]}'
The response returns the updated list of excluded sources.
Add excluded sources to a consolidated analytics tenant
Use this sample request to add excluded sources to the list of excluded sources for a consolidated analytics tenant.
curl -X PATCH --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/excluded-sources' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"excludedSources": ["Candidate", "Requisition"]}'
The response returns the updated list of excluded sources.
Remove excluded sources from a consolidated analytics tenant
Use this sample request to remove excluded sources from the list of excluded sources for a consolidated analytics tenant.
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/consolidated-analytics/tenants/WFF_j1r~CAtenant/excluded-sources' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{"excludedSources": ["Candidate", "Requisition"]}'
The response returns the updated list of excluded sources.