API DocsRESTCampaign service

ListCampaigns

List campaigns.

GET
/api/v1/campaigns

Query Parameters

pageSizeinteger

The maximum number of campaigns to return. The service may return fewer than this value. If unspecified, at most 50 campaigns will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional.

Format: "int64"

pageTokenstring

A page token, received from a previous ListCampaigns call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCampaigns must match the call that provided the page token. Optional.

filterstring

A Common Expression Language (CEL) filter string. Available fields to filter by are: created_by_user_id, tag_id, tag_name, report_id, report_name, campaign_id, client_key, description, run_id, and name. For further information about how to use CELs, please refer to this guide. For more information about the fields used for filtering, please refer to this definition. Optional.

organizationIdstring

This field is only required if your user belongs to multiple organizations.

includeArchivedboolean

If true then archived campaigns will be included in the query. Defaults to false.

orderBystring

How to order the retrieved campaigns. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". Available fields to order_by are created_date and modified_date. If left empty, items are ordered by created_date in ascending order (oldest-first). For more information about the format of this field, read this Example: "created_date desc,modified_date"

curl -X GET "<API_URL>/api/v1/campaigns?pageSize=0&pageToken=string&filter=string&organizationId=string&includeArchived=true&orderBy=string" \
  -H "Authorization: Bearer <API_KEY>"

A successful response.

{
  "campaigns": [
    {
      "campaignId": "string",
      "organizationId": "string",
      "clientKey": "string",
      "name": "string",
      "description": "string",
      "createdByUserId": "string",
      "modifiedByUserId": "string",
      "createdDate": "2019-08-24T14:15:22Z",
      "modifiedDate": "2019-08-24T14:15:22Z",
      "archivedDate": "2019-08-24T14:15:22Z",
      "tags": [
        {
          "tagId": "string",
          "name": "string"
        }
      ],
      "reports": [
        {
          "reportId": "string",
          "reportName": "string",
          "numAnnotations": 0,
          "numPassedRules": 0,
          "numAcceptedRules": 0,
          "numFailedRules": 0,
          "numOpenRules": 0
        }
      ],
      "createdFromCampaignId": "string"
    }
  ],
  "nextPageToken": "string"
}