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.
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.
{
"profiles":[
{
"profileId":"07ca543c-b64b-3fab-a8c1-02655ae47ecd",
"displayName":"PARTNER_ADMIN",
"capabilities":[
{
"capability":"Security",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"TenantManagement",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"UserManagement",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"Data",
"accessLevel":"Write",
"viewLevel":"Simple"
},
{
"capability":"Model",
"accessLevel":"Write",
"viewLevel":"Simple"
}
],
"additionalCapabilities":[
"Approve",
"DataUpload",
"DirectPublish",
"FileSharing",
"PreviewUser",
"Settings",
"TwoStepPublish"
]
}
]
}
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.
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.
{
"profiles":[
{
"profileId":"07ca543c-b64b-3fab-a8c1-02655ae47ecd",
"displayName":"PARTNER_CUSTOMER_SERVICE_MGR",
"capabilities":[
{
"capability":"Security",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"TenantManagement",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"UserManagement",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"Data",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"Model",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
}
],
"additionalCapabilities":[
"AccessToAllData"
]
}
]
}
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.
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.
{
"assignedProfiles": [
{
"profileId": "07ca543c-b64b-3fab-a8c1-02655ae47ecd",
"displayName": "PARTNER_ADMIN",
"validityStartTime": "1546550635000",
"validityEndTime": "1579496820000"
}
]
}
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.
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.
{
"assignedProfilesForAccessibleTenant": [
{
"profileId": "af1e7ba4-eef0-41db-9e44-5bac6151cd14",
"displayName": "PARTNER_CUSTOMER_MGMT",
"tenantCode": "WFF_j1r",
"forAllChildren": true,
"validityStartTime": "-9223372036854775808",
"validityEndTime": "9223372036854775807"
}
]
}
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.
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.
{
"profiles":[
{
"profileId":"be29ae0d-85d5-4a06-a247-35b85a240319",
"displayName":"PARTNER_ADMIN",
"capabilities":[
{
"capability":"Security",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"TenantManagement",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"UserManagement",
"accessLevel":"Write",
"viewLevel":"Detailed"
},
{
"capability":"Data",
"accessLevel":"Write",
"viewLevel":"Simple"
},
{
"capability":"Model",
"accessLevel":"Write",
"viewLevel":"Simple"
}
],
"additionalCapabilities":[
"Approve",
"DataUpload",
"DirectPublish",
"FileSharing",
"PreviewUser",
"Settings",
"TwoStepPublish"
]
}
]
}
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.
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.
{
"profiles":[
{
"profileId":"af1e7ba4-eef0-41db-9e44-5bac6151cd14",
"displayName":"PARTNER_CUSTOMER_SERVICE_MGR",
"capabilities":[
{
"capability":"Security",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"TenantManagement",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"UserManagement",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"Data",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
},
{
"capability":"Model",
"accessLevel":"NoAccess",
"viewLevel":"Simple"
}
],
"additionalCapabilities":[
"AccessToAllData"
]
}
]
}
Assign a profile to a list of users
Use this sample to assign a specific profile to a list of 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.
{
"successfulAssignments": [
{
"userId": "1f4a7176-7f45-0147-b21f-472ae2167285"
},
{
"userId": "33ba5517-e4dc-a548-8d5f-b43f7a412506"
}
]
}
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.
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.
{
"successfulAssignments": [
{
"userId": "9a59c20b-9cb7-9f48-b812-0bb98eb19af8",
"tenantCode": "WFF_j1r",
"forAllChildren": true
},
{
"userId": "1f4a7176-7f45-0147-b21f-472ae2167285",
"tenantCode": "WFF_j1r",
"forAllChildren": true
}
]
}
Remove a profile from a list of users
Use this sample to remove a specific profile to a list of 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.
{
"failed": [
{
"userId": "1f4a7176-7f45-0147-b21f-472ae2167285",
"message": "User ID does not exist"
}
],
"succeeded": [
{
"userId": "33ba5517-e4dc-a548-8d5f-b43f7a412506"
}
]
}
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.
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.
{
"failed": [
{
"userId": "1f4a7176-7f45-0147-b21f-472ae2167285",
"message": "User ID does not exist"
}
],
"succeeded": [
{
"userId": "33ba5517-e4dc-a548-8d5f-b43f7a412506"
}
]
}