REST interface





The platform can automatically generate a REST interface for the entire applied solution. Once an applied solution is published to a web server, third-party systems can access it through the REST interface using HTTP requests. The automatically generated REST interface, which is universal and cross-platform, is the primary tool for integration with third-party systems.

The REST interface supports reading 1C:Enterprise data and editing it, as well as creation and deletion of data objects.

You can use the automatic REST interface for the following tasks:

  • Integration of applied solutions with web sites and online stores
  • Implementation of additional functionality using third-party software, without changing applied solution configuration
  • Import and export of applied solution data
  • Integration of applied solutions with corporate systems, perhaps even without additional programming

Typical REST interface operations include:

  • Getting the list of documents, catalogs, information register records, and other data, with the option to apply a filter
  • Getting data of a catalog item, document (by reference), independent information register record (by key), or subordinate register data set (by recorder)
  • Editing data of a single catalog item, document, or another reference object
  • Creating a catalog item, document, or record set
  • Posting a document or starting a business process

The platform uses OData version 3 as its access protocol. It is an open web protocol for data requests and updates. It is designed to process data using HTTP requests. The platform supports Atom/XML and JSON response formats.

The server part of REST services is implemented in the platform. It means that an applied solution can provide its functionality automatically through REST services. For interaction with third-party REST services from 1C:Enterprise (i.e. for implementation of the client part) you can use the HTTP tools included in the platform.

The main puprose of applied solution REST interface is integration with third-party systems. And since OData clients are available for the majority of notable platforms, the integration is also available.

  • Mobile platforms: iOS, Windows Phone, and Android
  • Server/desktop platforms: .NET, Java, PHP, Objective-C, Ruby, and JavaScript
  • CMS support: Drupal and Joomla

For details on the integration, see OData documentation.

Using standard OData interface of an applied solution is simple:

  • Publish the REST interface to a web server from Designer.
  • Once you do, the applied solution objects become available through REST interface.
  • OData client authentication methods are identical to web service authentication methods.
  • OData clients can request metadata describing available applied solution objects using HTTP documents.
  • OData clients create, read, edit, and delete applied solution data.

REST interface provides access to almost all major configuration object types: catalogs, documents, constants, enumerations, exchange plans, accumulation, calculation, accounting, and information registers, virtual tables of periodic information registers, accounting registers, and accumulation registers, charts of accounts, charts of characteristics and calculation types, business processes, tasks, and document journals.

REST interface provides access to configuration object attributes, to data creation, reading, editing, and deletion operations, and to some 1C:Enterprise script methods. For example:

  • For documents: posting and canceling posting
  • For tasks: execution
  • For business processes: start
  • For information registers: getting slice first and slice last
  • For accumulation and accounting registers: getting balances, turnovers, or both balances and turnovers
  • For calculation registers: getting schedule, actual action period, recalculation, and base period data   

If an error occurs, 1C:Enterprise sends a response with HTTP status 4XX or 5XX. 4XX statuses indicate incorrect client operations, while 5XX statuses indicate server errors. For 4XX statuses 1C:Enterprise can pass additional internal error code and error message to the client, which helps to identify the error.

When reading and writing data through REST interface, the platform performs all standard access right checks and calls handler events, except for fill checks.

When getting data lists, you can apply standard OData request filter conditions. For example, you can get products whose price is less or equal to 3.5 or more than 200:

GET /OData_Tests_Infobase/odata/standard.odata/Catalog_Goods?$filter=Price le 3.5
or Price gt 200

See also:


Comments
1
Add comment
  • 29 Dec 04:17
    Nguyen Trung Cuong

    It's a good article!