# 1С:Предприятие (другое)

Обмен данными с 1С через OData — справочники, документы, регистры

## Scenarios

### See what the publication actually exposes
The agent reads the /$metadata schema of your database and lists which catalogues, documents and registers are really served over OData.

### Answers about documents without custom code
The agent selects documents by period, counterparty or attribute straight from the database and answers in the chat, with no new data processor needed from a developer.

### Balances and turnovers from registers
The agent takes the virtual tables of accumulation registers and returns balances and turnovers as of a date across the dimensions you need.

### A regular digest from an industry database
The agent gathers the metrics of your configuration on schedule and sends them to the chat, even when no standard report covers the task.

## How to connect

### Publish the database on a web server with OData
In the Configurator: «Администрирование» → «Публикация на веб-сервере…» (Administration → Publish on web server). Name the publication, tick «Публиковать стандартный интерфейс OData», publish. Needs IIS or Apache with the 1C web modules.

### Add the objects you need to the OData composition
Publishing alone exposes nothing — the composition starts empty. In «1С:Предприятие» mode open «Администрирование» → «Синхронизация данных» → «Настройка состава стандартного интерфейса OData» and tick the catalogs, documents and registers.

### Create a dedicated infobase user for the exchange
In the infobase user list create a service user with 1C:Enterprise authentication and a password, then grant the role «Удаленный доступ OData» (OData remote access) and read rights on the ticked objects. Without it requests are rejected.

### Check the publication address in a browser
Open https://your-server/publication-name/odata/standard.odata/$metadata and sign in as that user — an XML list of objects must come back. You end up holding the publication address without /odata/standard.odata, the login and the password.

## FAQ

### How do I connect an arbitrary 1C database?
With the publication address plus the login and password of a database user. The database is published on a web server with the standard OData interface enabled, the objects you need are ticked in the composition settings, and a separate user with the OData remote access role is created.

### Will my configuration work?
Any configuration on the 1C:Enterprise 8 platform that can publish the standard OData interface will work, including industry-specific and heavily customised ones. The agent takes applied object names from /$metadata rather than guessing them.

### What does the agent see in such a database?
Exactly what is ticked on the Composition tab of the OData settings and allowed by the user role: catalogues, documents, journals, information registers, accumulation registers, accounting registers and calculation registers.

### What if an object is missing from the response?
An empty /$metadata or a missing object means it is not included in the publication composition, not that permissions were denied. The agent tells these cases apart and says exactly what needs fixing.

[Open 1С:Предприятие (другое)](https://its.1c.ru/db/v8323doc)
