Common OData Query Parameters
The most common OData parameters seen in the AppScan 360° API are:
- $top
- Used to limit the number of records returned by the system. Simply pass it an integer and the
API will take the value of $top and return at most that number of records
as determined by the
$orderby
parameter. For example, to return the first five scans:https://cloud.appscan.com/api/v2/Scans?$top=5
- $filter
- Defines which records are returned. If you provide this parameter an expression, every record
will be evaluated against it. All the records that evaluate to true for the expression get
returned. This filter parameter is very powerful and useful. For example, to return all
applications with High Risk rating:
https://cloud.appscan.com/api/V2/Apps?$filter=RiskRating%20eq%20'High'
- $select
- Defines which fields are included in the results. This is useful when you are interested only in
particular fields and don't want to include anything else. For example, to the names and
creation dates of all applications, but no other information:
https://cloud.appscan.com/api/V2/Apps?$select=Name%2CDateCreated
- $skip
- Defines the number of records to skip. For example, to list all policies except the first two:
https://cloud.appscan.com/api/V2/Policies?$skip=2
- $orderby
- Defines the order of the result set. You provide this parameter with a field and the result set
returned will be organized by the field in order. Order can be descending or ascending, just
like a SQL query, by appending
desc
orasc
to the parameter. String fields are ordered alphabetically; number fields, numerically. It appears as though you can only provide one value in this parameter (even though the example has two). For example, to return a list of all scans, ordered first by creation date, and then by name:https://cloud.appscan.com/api/v2/Scans?$orderby=CreatedAt%20desc