Sample API Requests using Gateway URLs

This section illustrates the API request samples using gateway URLs for different API endpoints.

The API samples documented in this API Guide are generic, and we use the <qualys_base_url> as a placeholder for API Server URLs and API Gateway URLs. To know your API Server URL and Gateway URL, refer to Identify your Qualys platform.

Refer to the following samples to correctly use the API gateway URLs in the API requests. 

Authentication API

This sample is using the gateway URL for the US1 platform.

API Request

curl --location '<qualys_base_url>/auth' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=<username>' \
--data-urlencode 'password=<password>' \
--data-urlencode 'token=true'

Get Configuration Profile API

This sample uses the gateway URL for the KSA1 platform.

API Request

curl --location --request GET 'https://gateway.qg1.apps.qualysksa.com/caui/v1/config-profiles/1234567' \                                     --header 'Authorization: Bearer <JWT Token>' \
--data ''

Create Configuration Profile API

This sample uses the gateway URL for the AE1 platform.

API Request

curl --location --request POST 'https://gateway.qg1.apps.qualys.ae/caui/v1/config-profiles' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT Token>' \
--data '

Update Configuration Profile API

This sample uses the gateway URL for the IN1 platform.

API Request

curl --location --request PUT '
https://gateway.qg1.apps.qualys.in/caui/v1/config-profiles/priority' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT Token>' \
--data ''

Delete Configuration Profile API

This sample uses the gateway URL for the UK1 platform.

API request

curl -u fo_username:password -X POST -H "Content-Type: text/xml" -H "Cache-Control: no-cache" --data-binary @delete_config.xml  
"https://gateway.qg1.apps.qualys.co.uk/qps/rest/1.0/delete/ca/agentconfig/9000"
Note: “delete_config.xml” contains the request POST data.

Update Profile Priority API

This sample uses the gateway URL for the AU1 platform.

API Request

curl --location --request PUT '
https://gateway.qg1.apps.qualys.com.au/caui/v1/config-profiles/priority' \      
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT Token>' \
--data ''

Direct Assignment Configuration Profile API

This sample uses the gateway URL for the CA1 platform.

API Request

curl --location --request PUT 'https://gateway.qg1.apps.qualys.ca/caui/v1/config-profiles/direct-assign/1234567'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--data '

Fetch Cloud Agents Assigned via Direct Assignment API

This sample uses the gateway URL for the EU1 platform.

API Request

curl --location --request GET 'https://gateway.qg1.apps.qualys.eu/caui/1.0/config-profiles/1832693/agents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [jwt token]' \ 

The above requests are just samples. Depending on your platform, you can use any of the API gateway URLs.