# REST API (deprecated)

{% hint style="danger" %} <mark style="color:orange;">Our REST API is deprecated and is replaced by our</mark> [GraphQL API](/technologies/graphql-api.md)
{% endhint %}

## Base URL <a href="#base-url" id="base-url"></a>

All URLs referenced in the documentation have the following base:

| Standard platform              | High availability platform     |
| ------------------------------ | ------------------------------ |
| `https://sd.iadvize.com/api/2` | `https://ha.iadvize.com/api/2` |

The iAdvize REST API is served over HTTPS.

## Authentication <a href="#authentication-rest" id="authentication-rest"></a>

The API key must be attached to each request. You can use it in one of the following ways:

* Passed in as a `X-API-Key` HTTP header
* Passed in as a `key` GET parameter
* Passed in as the username (with an arbitrary password) via `HTTP Basic authentication`

## Calls, errors & responses <a href="#calls-errors-and-responses" id="calls-errors-and-responses"></a>

### **Authentication failed**

```
{
  meta: {
    status: "error",
    message: "Forbidden"
  }
}
```

### **Read**

**`GET /my_resource`**

```
{
  meta: {
    status: "success"
  },
  data: [
    {
      id: 789,
      _link: "/my_resource/789"
    },
    {
      id: 456,
      _link: "/my_resource/456"
    },
    {
      id: 123,
      _link: "/my_resource/123"
    }
  ],
  pagination: {
    page: 1,
    pages: 1,
    limit: 20,
    count: 3
  }
}
```

#### **Common filters**

| Filter | Description                                                          | Values     |
| ------ | -------------------------------------------------------------------- | ---------- |
| page   | Page number                                                          | `?page=1`  |
| limit  | Maximum number of resources per page (maximum possible value is 100) | `?limit=1` |
| full   | Show all fields of the resource                                      | `?full=1`  |

Use the `*` character to broaden the scope of your search. E.g.: `filters[name]=*uli*`

**`GET /my_resource/123`**

```
{
  meta: {
    status: "success"
  },
  data: {
    id: 123,
    my_field: "my_value",
    _link: "/my_resource/123"
  }
}
```

**`GET /my_resource/456` (with error)**

```
{
  meta: {
    status: "fail",
    message: "Unknown 'my_resource' with 'id' 456."
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iadvize.dev/technologies/rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
