List contracts

The listContracts operation enables you to access all your contracts as a paginated list. This operation returns all of the contracts associated with the current user’s company (authenticated using the bearer token). You can use this endpoint to identify which contractID to use while tasking.

For details of the fields returned in each contract resource, see Contract resource.

Example

Request

Enter the following curl command, remembering to replace the ${VARNAME} variables with the appropriate values:

curl --location "${API_BASE_URL}/api/company/v1/contracts" \
--header "Accept: application/json, application/problem+json" \
--header "Authorization: Bearer ${API_ACCESS_TOKEN}"

Response

On success, returns a 200 status code and a JSON object containing.

{
  "data": [
    {
      "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX",
      "name": "string",
      "start": "2019-08-24T14:15:22Z",
      "end": "2019-09-24T14:15:22Z",
      "imagingModes": {
        "allowed": [
          "SCAN",
          "SCAN_WIDE",
          "SPOTLIGHT",
          "SPOTLIGHT_FINE",
          "SPOTLIGHT_EXTENDED_DWELL_PRECISE",
          "SPOTLIGHT_EXTENDED_AREA",
          "SPOTLIGHT_EXTENDED_DWELL",
          "SPOTLIGHT_EXTENDED_DWELL_FINE",
          "SPOTLIGHT_HIGH",
          "STRIPMAP",
          "STRIPMAP_EXTENDED",
          "STRIPMAP_HIGH"
        ]
      },
      "priority": {
        "allowed": [
          "BACKGROUND"
        ],
        "default": "BACKGROUND"
      },
      "exclusivity": {
        "allowed": [
          "PUBLIC"
        ],
        "default": "PUBLIC"
      },
      "eula": {
        "allowed": [
          "STANDARD"
        ],
        "default": "STANDARD"
      },
      "sla": {
        "allowed": [
          "SLA_8H"
        ],
        "default": "SLA_8H"
      },
      "catalog_collections": {
        "allowed": [
          "public",
          "solutions"
        ],
        "default": "public"
      }
    }
  ],
  "cursor": "string"
}

More options

Paginated results

When a cursor property appears in the response, it indicates that more results are available. To access the next page of results, send a follow-up request that includes the cursor query parameter, setting it equal to the cursor value from the previous response. On success, the next page of results is returned, potentially including a new cursor to continue walking the list.

You can customize the number of returned catalog items by providing a limit query parameter, which specifies the maximum number of items to return in the response.

By default, up to 10 contracts are returned in each response.

Enter the following curl command, remembering to replace the ${VARNAME} variables with the appropriate values:

curl --location "${API_BASE_URL}/api/company/v1/contracts?limit=20&cursor=XXX" \
--header "Accept: application/json, application/problem+json" \
--header "Authorization: Bearer ${API_ACCESS_TOKEN}"