Manage User Filters
    • PDF

    Manage User Filters

    • PDF

    Article summary

    1. Get All User Filters

    The GET method returns all the user filters associated with the current user as indicated by the current_userId path variable with an API token.

    GET

        {{url}}/api/access/{current_userId}/filters

    Request Parameters

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

    ParameterDescriptionData TypeRequired
    current_userIdCurrent user ID for which all filters need to be retrieved.

    String

    Mandatory

    Request Example

    curl --location --request GET '{{url}}/api/access/{{current_userId}}/filters' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 200 OK
    [
        {
            "id": "uken71i1tjfqmxkr",
            "name": "filter1",
            "filter": {
                "applications": [
                    "test1"
                ],
                "associations": [
                    "env1"
                ],
                "profiles": [
                    "profile1"
                ],
                "statuses": [
                    "status1"
                ],
                "applicationTypes": [
                    "AWS1"
                ]
            }
        },
        {
            "id": "8cql35l1f53muixu",
            "name": "filter2",
            "filter": {
                "applications": [
                    "test2"
                ],
                "associations": [
                    "env2"
                ],
                "profiles": [
                    "profile2"
                ],
                "statuses": [
                    "status2"
                ],
                "applicationTypes": [
                    "AWS2"
                ]
            }
        }
    ]

    2. Create a User Filter

    The POST method creates a user filter associated with a current user, as indicated by the current_userId path variable with an API token.

    POST

        {{url}}/api/access/{current_userId }/filters

    Request Parameters

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

    ParameterDescriptionData TypeRequired
    current_userId
    Current user ID for which a new filter/collection needs to be created.

    String

    Mandatory

    Request Example

    curl --location --request POST '{{url}}/api/access/{{current_userId}}/filters' \
    --header 'Authorization: TOKEN {{token}}'
    --header 'Content-Type: application/json' \
    --data '{
    	"name": "filter1",
    	"filter": {
    		"applications": [
    			"test1"
    		],
    		"associations": [
    			"env1"
    		],
    		"profiles": [
    			"profile1"
    		],
    		"statuses": [
    			"status1"
    		],
    		"applicationTypes": [
    			"AWS1"
    		]
    	}
    }'

    Response Example 

    Status: 201 Created
    {
        "id" : "6f926gwvmcxpvseg",
    	"name": "filter1",
    	"filter": {
    		"applications": [
    			"test1"
    		],
    		"associations": [
    			"env1"
    		],
    		"profiles": [
    			"profile1"
    		],
    		"statuses": [
    			"status1"
    		],
    		"applicationTypes": [
    			"AWS1"
    		]
    	}

    3. Update a User Filter

    PUT{{url}}/api/access/{current_userId }/filters/{filterId}

    Request Parameters

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

    ParameterDescriptionData TypeRequired
    current_userId Current user ID for which a new filter/collection needs to be updated.

    String

    Mandatory

    filterIdThe filter ID of a filter needs to be updated.
    StringMandatory

    Request Example

    curl --location --request PUT '{{url}}/api/access/{{current_userId}}/filters/{{filterId}}' \
    --header 'Authorization: TOKEN {{token}}'
    --header 'Content-Type: application/json' \
    --data '{
    	"name": "filter5",
    	"filter": {
    		"applications": [
    			"test11"
    		],
    		"associations": [
    			"env11"
    		],
    		"profiles": [
    			"profile11"
    		],
    		"statuses": [
    			"status11"
    		],
    		"applicationTypes": [
    			"AWS11"
    		]
    	}
    }'

    Response Example 

    Status: 204 No Content

    4. Delete a User Filter

    The DELETE method deletes an existing user filter associated with the current user as indicated by the current_userId path variable with an API token.

    DELETE{{url}}/api/access/{current_userId }/filters/{filterId}

    Request Parameters

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

    ParameterDescriptionData TypeRequired
    current_userId Current user ID for which a filter/collection needs to be deleted.

    String

    Mandatory

    filterIdFilter ID of a filter that needs to be deleted.
    StringMandatory

    Request Example

    curl --location --request DELETE '{{url}}/api/access/{{current_userId}}/filters/{{filterId}}' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 204 No Content

    Was this article helpful?

    What's Next