# Base URL

The Sales Layer REST APIs are available from the following base URL:

```
https://api2.saleslayer.com
```

Build requests by appending the API path and optional query parameters to this base URL.

## API path prefixes

Different Sales Layer APIs use different path conventions.

| API                   | Base URL                              | Path examples                     |
|-----------------------|---------------------------------------|-----------------------------------|
| DAM REST API         | `https://api2.saleslayer.com/dam`   | `/images`, `/images({reference})` |
| Catalog REST API     | `https://api2.saleslayer.com/catalog`| `/Products`, `/Categories`, `/$metadata` |

Use the OpenAPI reference for the exact path, HTTP method, parameters, and request body supported by each operation.

## DAM examples

The DAM REST API currently exposes image operations under `/dam/images`.

List DAM images:

```
GET https://api2.saleslayer.com/dam/images?$top=10
```

Delete a DAM image by reference:

```
DELETE https://api2.saleslayer.com/dam/images({reference})
```

Where `{reference}` is the image filename, unique per tenant (for example, `product-main-front.jpg`).

See the [DAM REST API overview](https://docs.api.saleslayer.com/apis/dam) and [DAM endpoint reference](https://docs.api.saleslayer.com/apis/dam-v2.0) for details.

## Catalog examples

The Catalog REST API currently exposes catalog resources under `/catalog`.

Retrieve Catalog API metadata:

```
GET https://api2.saleslayer.com/catalog/$metadata
```

Retrieve category metadata:

```
GET https://api2.saleslayer.com/catalog/Categories/$metadata
```

List and filter categories:

```
GET https://api2.saleslayer.com/catalog/Categories?$filter=startswith(cat_ref,'C')&$orderby=cat_ref asc&$skip=1&$top=3&$select=cat_id,cat_title,cat_ref,cat_description&$expand=Products
```

In this query:
- `$filter` selects categories whose reference starts with `C`.
- `$orderby` sorts results by `cat_ref` in ascending order.
- `$skip` and `$top` paginate the result set.
- `$select` limits the fields returned.
- `$expand` includes related data such as `Products` when supported.

See the [Catalog REST API overview](https://docs.api.saleslayer.com/apis/catalog) and [Catalog endpoint reference](https://docs.api.saleslayer.com/apis/catalog-v2.0) for details.

## Authentication

All requests must include a valid API key:

```
X-API-KEY: YOUR_API_KEY
```

See [Authentication](https://docs.api.saleslayer.com/guides/authentication) for details about requesting and using API keys.

## Common mistakes

Avoid these common URL issues:
- Do not omit the `https://api2.saleslayer.com` base URL.
- Do not add an extra slash between the base URL and the API path.
- Encode query parameter values when they contain spaces, quotes, or special characters.
- Use the exact capitalization shown in the API reference, especially for Catalog paths such as `/catalog`.

## Support

For technical support, API questions, or help getting access to an API key, contact Sales Layer support or your account representative.
