Get information on users along with their tags to the authorized user. Currently, we support three actions for the users: search, count, and get details of a user.
Permissions required - Managers with full scope, other users must have Access Permission “API Access”
Search for users by using different filters for user ID, username, email, tags, and module names. If no filter is specified, all users in the user’s scope are listed.
Method: POST
XSD: user.xsd
API request
curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"
--data-binary @-
"<qualys_base_url>/qps/rest/1.0/search/admin/user" < file.xml
Note: “file.xml” contains the request POST data.
Request POST data
<ServiceRequest>
<filters>
<Criteria field="username" operator="CONTAINS">10</Criteria>
</filters>
</ServiceRequest>
Response
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/1.0/admin/user.xsd">
<responseCode>SUCCESS</responseCode>
<count>1</count>
<hasMoreRecords>false</hasMoreRecords>
<data>
<User>
<id>3989626</id>
<username>user_js10</username>
<firstName>
<![CDATA[John]]>
</firstName>
<lastName>
<![CDATA[Smith]]>
</lastName>
<emailAddress>[email protected]</emailAddress>
<tags>
<count>1</count>
<list>
<Tag>
<id>8721654</id>
<name>
<![CDATA[Unassigned Business Unit]]>
</name>
</Tag>
</list>
</tags>
<modules>
<count>5</count>
<list>
<Module>QWEB_PCI</Module>
<Module>WAS</Module>
<Module>ADMIN</Module>
<Module>ASSET_MANAGEMENT</Module>
<Module>QWEB_VM</Module>
</list>
</modules>
</User>
</data>
</ServiceResponse>
<responseCode>SUCCESS</responseCode>
Returns the total number of users in the user’s scope.
Method: POST
XSD: user.xsd
API request
curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"
--data-binary @-
"<qualys_base_url>/qps/rest/1.0/count/admin/user" < file.xml
Note: “file.xml” contains the request POST data.
Request POST data
<ServiceRequest>
<filters>
<Criteria field="username" operator="CONTAINS">10</Criteria>
</filters>
</ServiceRequest>
XML output
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/1.0/admin/user.xsd">
<responseCode>SUCCESS</responseCode>
<count>1</count>
</ServiceResponse>
<responseCode>SUCCESS</responseCode>
View details for a user in the user’s scope. You can use search action to find a user ID to use as input.
Method: GET, POST
XSD: user.xsd
API request
curl -u "USERNAME:PASSWORD" " -X GET -H "Content-type: text/xml"
"<qualys_base_url>/qps/rest/1.0/get/admin/user/3989626" < file.xml
XML output
<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/1.0/admin/user.xsd">
<responseCode>SUCCESS</responseCode>
<count>1</count>
<data>
<User>
<id>3989626</id>
<username>user_js10</username>
<firstName>
<![CDATA[John]]>
</firstName>
<lastName>
<![CDATA[Smith]]>
</lastName>
<emailAddress>[email protected]</emailAddress>
<tags>
<count>1</count>
<list>
<Tag>
<id>8721654</id>
<name>
<![CDATA[Unassigned Business Unit]]>
</name>
</Tag>
</list>
</tags>
<modules>
<count>5</count>
<list>
<Module>WAS</Module>
<Module>ADMIN</Module>
<Module>QWEB_PCI</Module>
<Module>ASSET_MANAGEMENT</Module>
<Module>QWEB_VM</Module>
</list>
</modules>
</User>
</data>
</ServiceResponse>
<responseCode>SUCCESS</responseCode>