Profiles API Code Samples

Selection of code samples that demonstrate the use of the Profiles API. 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 "Profiles" in API Reference.

Retrieve a list of all profiles

Use this sample request to retrieve all the profiles in your tenant. For administrating tenants, this sample retrieves all administrating tenant profiles.

Copy
cURL sample request: Retrieve a list of all profiles
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each profile in your tenant, including the profileId and capabilities.

Retrieve a list of all analytic tenant profiles

If you're an administrating tenant, use this sample to retrieve a list of all profiles that you can assign to administrating tenant users to manage your analytic tenants.

Copy
cURL sample request: Retrieve a list of analytic tenant profiles
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/accessible-tenants' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each analytic tenant profile, including the profileId and capabilities.

Retrieve a user's profiles

Use this sample to retrieve the profiles assigned to a specific user. For administrating tenants, this sample retrieves a user's administrating tenant profiles.

Copy
cURL sample request: Retrieve the profiles of user 82424d8b-f99c-cd4d-9ac7-568919d9a0e4
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/82424d8b-f99c-cd4d-9ac7-568919d9a0e4/profiles' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each profile assigned to the user, including the profileId, validityStartTime, and validityEndTime.

Retrieve an administrating tenant user's analytic tenant profiles

If you're an administrating tenant, use this sample to retrieve the analytic tenant profiles assigned to a specific user.

Copy
cURL sample request: Retrieve the analytic tenant profiles of user 82424d8b-f99c-cd4d-9ac7-568919d9a0e4
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/users/82424d8b-f99c-cd4d-9ac7-568919d9a0e4/accessible-tenant-profiles' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each analytic tenant profile assigned to the user, including the profileId , validityStartTime, and validityEndTime.

Retrieve the details of a profile

Use this sample to retrieve the details of a specific profile. For administrating tenants, this sample retrieves the details of an administrating tenant profile.

Copy
cURL sample request: Retrieve the details of profile be29ae0d-85d5-4a06-a247-35b85a240319
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/be29ae0d-85d5-4a06-a247-35b85a240319' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each profile in your tenant, including the profileId and capabilities.

Retrieve the details of an analytic tenant profile

If you're an administrating tenant, use this sample to retrieve the details of a specific analytic tenant profile.

Copy
cURL sample request: Retrieve the details of analytic tenant profile af1e7ba4-eef0-41db-9e44-5bac6151cd14
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/accessible-tenants/af1e7ba4-eef0-41db-9e44-5bac6151cd14' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns details about each profile in your tenant, including the profileId and capabilities.

Assign a profile to a list of users

Use this sample to assign a specific profile to a list of users.

Copy
cURL sample request: Assign profile 07ca543c-b64b-3fab-a8c1-02655ae47ecd to 2 users
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/07ca543c-b64b-3fab-a8c1-02655ae47ecd/assign' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d 'model={"targetUserIds":["1f4a7176-7f45-0147-b21f-472ae2167285","33ba5517-e4dc-a548-8d5f-b43f7a412506"],"validityStartTime": "1571122800000", "validityEndTime": "1571727600000"}'

The response returns information about the assignment's success.

Assign an analytic tenant profile to a list of administrating tenant users

If you're an administrating tenant, use this sample to assign a specific analytic tenant profile to a list of administrating tenant users.

Copy
cURL sample request: Assign profile af1e7ba4-eef0-41db-9e44-5bac6151cd14 to 2 users
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/accessible-tenants/af1e7ba4-eef0-41db-9e44-5bac6151cd14/assign' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d 'model={"targetUserIds":["9a59c20b-9cb7-9f48-b812-0bb98eb19af8","1f4a7176-7f45-0147-b21f-472ae2167285"],"targetTenantCodes":[{"tenantCode": "WFF_j1r", "forAllChildren": "true"}], "validityStartTime": "1571122800000", "validityEndTime": "1571727600000"}'

The response returns information about the assignment's success.

Remove a profile from a list of users

Use this sample to remove a specific profile to a list of users.

Copy
cURL sample request: Remove profile 07ca543c-b64b-3fab-a8c1-02655ae47ecd to 2 users
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/07ca543c-b64b-3fab-a8c1-02655ae47ecd/remove' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d 'model={"targetUserIds":["1f4a7176-7f45-0147-b21f-472ae2167285","33ba5517-e4dc-a548-8d5f-b43f7a412506"]}'

The response returns information about the removal's success.

Remove an analytic tenant profile from a list of administrating tenant users

If you're an administrating tenant, use this sample to remove a specific analytic tenant profile from a list of administrating tenant users.

Copy
cURL sample request: Remove profile af1e7ba4-eef0-41db-9e44-5bac6151cd14 from 1 user
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1/admin/profiles/accessible-tenants/af1e7ba4-eef0-41db-9e44-5bac6151cd14/remove' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d 'model={"targetUserIds":["9a59c20b-9cb7-9f48-b812-0bb98eb19af8"], "targetTenantCodes":[{"tenantCode": "WFF_j1r", "forAllChildren":"true"}]}'

The response returns information about the removal's success.