Manage Identity Attributes
    • PDF

    Manage Identity Attributes

    • PDF

    Article summary

    This API helps to manage identity attributes in the Britive system. This includes operations such as retrieving, creating, or deleting identity attributes.


    1. Retrieving Identity Attributes

    The GET method retrieves the list of all custom attributes in the system.

    GET{{url}}/api/users/attributes

    Request Example

    An example GET request for retrieving custom attributes is shown here.

    curl --location --request GET '{{url}}/api/users/attributes' \
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    An example response of the GET request for retrieving custom attributes is shown here.

    Status: 200 OK
    [
        {
            "id": "0aruyKYJXfoilbUVGW9O",
            "name": "Department",
            "description": "Department",
            "dataType": "String",
            "multiValued": false,
            "builtIn": false
        },
        {
            "id": "efrcofy6ptcxiiyrw5oz",
            "name": "isEmployee",
            "description": "IsEmployee",
            "dataType": "Boolean",
            "multiValued": false,
            "builtIn": false
        },
        {
            "id": "HSvfZ1b74HUd7o8ai5Wo",
            "name": "Date Of Birth",
            "description": "Date Of Birth",
            "dataType": "Date",
            "multiValued": false,
            "builtIn": false
        },
        {
            "id": "n2eO9MhXH499OawqBefU",
            "name": "Employee Id",
            "description": "Employee Id",
            "dataType": "Number",
            "multiValued": false,
            "builtIn": false
        }
    ]

    2. Create an Identity Attribute

    The POST method creates an identity attribute in the system. 

    POST{{url}}/api/users/attributes

    The mandatory fields required in this method are provided in the following table:

    FieldPossible Values
    name   String
    description   String
    dataType
    • String
    • Number
    • Boolean
    • Date
    multiValued
    • true
    • false

    Request Example

    An example POST request for creating an identity attribute is shown here.

    curl --location --request POST '{{url}}/api/users/attributes' \
    --header 'Authorization: TOKEN {{apiToken}}' \
    --data-raw '{
        "name": "EmployeeNumber",
        "description": "Employee Number",
        "dataType": "String",
        "multiValued": false
    }'
    

    Response Example 

    An example response of the POST request for creating an identity attribute is shown here.

    Status: 201 Created
    {
        "id": "u1kmq7urgn7i9sgclzkj",
        "name": "EmployeeNumber",
        "description": "Employee Number",
        "dataType": "String",
        "multiValued": false,
        "builtIn": false
    }

    3. Delete an Identity Attribute

    The DELETE method deletes an identity attribute as indicated by the id of the attribute (attrID) defined in the system. 

    DELETE{{url}}/api/users/attributes/{{attrID}}

    Request Example

    An example DELETE request for deleting an identity attribute is shown here.

    curl --location --request DELETE '{{url}}/api/users/attributes/{{attrID}}'\
    --header 'Authorization: TOKEN {{apiToken}}'

    Response Example 

    Status: 204 No Content 

    The response only has headers.

    Note:

    This request does not return a response body.




    Was this article helpful?