Manage Profile Tags

Prev Next


Note: 
These APIs are not supported with the Britive Profiles enhanced feature.

The following Britive API methods can be used to manage tags associated with profiles (profile tags) and perform relevant operations.


1. Add Profile Tags

The POST method helps you to add new tags to the user profiles in the system.  

POST{{url}}/api/paps/{{papID}}/user-tags/{{tagID}}

Request Example

An example POST request for adding tags to user profiles is shown here.

curl --location --request POST '{{url}}/api/paps/{{papID}}/user-tags/{{tagID}}' \
--header 'Authorization: TOKEN {{token}}' \
--data-raw ''

Response Example 

An example response of the POST request for adding profile tags is shown here.

Status: 200 OK
{
    "accessPeriod": null,
    "name": "QA",
    "description": "No Description",
    "userCount": 2,
    "status": "Active",
    "userTagId": "o96sdb8f5181hzr2rhw1",
    "checkStatus": "Success",
    "message": null
}

2. Retrieve Tags Assigned to Profiles 

Important Note:     
This is the latest API in the place of the deprecated API "Details of Profile Tags".

This API returns the list of all tags that are assigned to a profile for the given profile ID. The API returns data in pages. Multiple API calls return the complete list of tags for the profile.

GET
{{url}}/api/paps/{{papID}}/user-tags?page=0&size=20&sort=name,asc&filter=name eq test

Request Parameters

The request parameters used in this method are shown in the following table:

ParameterDescriptionData TypeRequired
papIDThe profile ID.stringMandatory

page

The page number starting from zero.

string

Mandatory

size

The number of records that are returned. 

Note: The total number of records can be used to calculate the number of pages. For example, 20.

string

Mandatory

sort

The column used for sorting the records.

string

Optional

filter

The filter that can filter the list of profiles based on name, status, or integrity checks. The supported operators are 'eq' and 'co'. 
The format is as follows:
 name co "Tag1"

string

Optional

Request Example 

An example GET request for retrieving tag details of a user profile is shown here.

curl --location -g --request GET '{{url}}/api/paps/{{papID}}/user-tags?page=0&size=20&sort=name,asc&filter=name%20eq%20test' \
--header 'Authorization: TOKEN {{token}}'

Response Example 

An example response of the GET request for retrieving tag details for user profiles is shown here:

Status: 200 OK
{
  "count": 1,
  "page": 0,
  "size": 20,
  "sort": "name: ASC",
  "filter": "name eq test",
  "data": [
    {
      "accessPeriod": null,
      "name": "test",
      "description": "test",
      "userCount": 4,
      "status": "Active",
      "userTagId": "4bvzuSEV0qPQFtGFKu0f",
      "checkStatus": "Success",
      "message": null
    }
  ]
}


(Deprecated) Details of Profile Tags

Important Note:
The following API for "Details of Profile Tags" is deprecated and will be removed in a future release.

The GET method fetches details of all tags associated with a user profile in the system.  

GET
{{url}}/api/paps/{{papID}}/user-tags?filter=available

Request Example

An example GET request for retrieving tag details of a user profile is shown here.

curl --location --request GET '{{url}}/api/paps/{{papID}}/user-tags?filter=available' \
--header 'Authorization: TOKEN {{token}}'

Response Example 

An example response of the GET request for retrieving tag details for user profiles is shown here:

Status: 200 OK
[
    {
        "userTagId": "S5r8s4107yfInAS0XX5K",
        "name": "Demo Users",
        "description": "No Description",
        "status": "Active",
        "userCount": 3,
        "userTagIdentityProviders": [],
        "external": false
    },
    {
        "userTagId": "2NXhPy9TnqrhAXRp1oPr",
        "name": "Developers",
        "description": "No Description",
        "status": "Active",
        "userCount": 1,
        "userTagIdentityProviders": [],
        "external": false
    },
    {
        "userTagId": "9ZWtNkwCDWBJ60WQv2VQ",
        "name": "Camera People",
        "description": "No Description",
        "status": "Active",
        "userCount": 3,
        "userTagIdentityProviders": [],
        "external": false
    }
]


3. Delete Profile Tags 

The DELETE method allows you to delete the tag associated with a profile in the system.

DELETE{{url}}/api/paps/{{papID}}/user-tags/{{tagID}}

Request Example 

An example DELETE request is shown here:

curl --location --request DELETE '{{url}}/api/paps/{{papID}}/user-tags/{{tagID}}' \ 
--header 'Authorization: TOKEN {{token}}'

Response Example

Status: 200 OK

The tag associated with the profile is deleted.