# QueryAspects

Retrieve all active aspects for a company

`GET /companies/{companyId}/aspects`

**API:** Shared Company Service API
**Tag:** Aspects
**API Version:** 1.2
**Base URL:** https://api.avalara.com/scs

Source: https://developer.avalara.com/products/shared-services/api/methods/Aspects/QueryAspects/

## Description

Use this endpoint to retrieve all aspects for a specific `companyId`.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | string | path | Yes | The ID of the company. Run `get /companies` for a list of available company IDs. |
| `$include` | string | query | No | A comma separated list of objects to fetch underneath this company. Any object with a URL path underneath this company can be fetched by specifying its name.

For more information on filtering, see [Filtering in REST](https://developer.avalara.com/avatax/filtering-in-rest/). |
| `$filter` | string | query | No | A filter statement to identify specific records to retrieve.For more information on filtering, see [Filtering in REST](https://developer.avalara.com/avatax/filtering-in-rest/). 

 *Filterable:* namespace 

 *Operators supported:* EQ/=, IN |
| `$top` | integer | query | No | If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. |
| `$skip` | integer | query | No | If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. |
| `$orderBy` | string | query | No | A comma separated list of ascending or descending sort statements in the format `(fieldname) [ASC|DESC]`, for example `contactCode DESC` |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/). |
| `X-Correlation-Id` | string | header | No | Use the X-Correlation-ID header to support request correlation through requests. This header should be present on all requests and responses. |
| `avalara-version` | string | header | No | The HTTP Header meant to specify the version of the API intended to be used |
| `$count` | boolean | query | No | If TRUE, return total count of records falling under the specified criteria from request. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | OK | `AspectFetchResult` |
| 400 | Bad Request | `ErrorInfo` |
| 401 | Unauthorized | `ErrorInfo` |
| 403 | Forbidden | `ErrorInfo` |
| 500 | Internal Server Error | `ErrorInfo` |

### 200 Response: `AspectFetchResult`

| Property | Type | Required | Description |
|---|---|---|---|
| `@recordsetCount` | integer | No |  Example: `1`. |
| `value` | Aspect[] | No |  |
| `@nextLink` | string | No |  Example: `nextlink`. |
| `pageKey` | string | No |  Example: `1`. |

## Example Request

```bash
curl -X GET "https://api.avalara.com/scs/companies/{companyId}/aspects" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```