M
M
MegaLazy2018-02-16 10:11:18
1C
MegaLazy, 2018-02-16 10:11:18

Error when creating document via 1C REST API?

Hello colleagues!
We develop an external client for 1C:Enterprise (8.3.5.1625)
We use an automatically generated REST API.
There was a problem creating an order:
POST /Digital/odata/standard.odata/Document_BuyerOrder
With header application/atom+xml
Send XML, for example:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:at="http://purl.org/atompub/tombstones/1.0" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="http://10.0.0.254/Digital/odata/standard.odata/">
   <content type="application/xml">
      <m:properties>
         <d:Number>00000001</d:Number>
         <d:Date>2018-02-15T13:56:32</d:Date>
         <d:ДатаОплаты>2018-02-15T13:56:32</d:ДатаОплаты>
         <d:ДатаОтгрузки>2018-02-15T13:56:32</d:ДатаОтгрузки>
         <d:ДатаВремяДоставки>2018-02-15T13:56:32</d:ДатаВремяДоставки>
         <d:Контрагент_Key>9e96634d-ecd3-11e4-8500-001e67040364</d:Контрагент_Key>
         <d:Организация_Key>a51810ab-da49-11e2-8616-001e67040365</d:Организация_Key>
         <d:ТипЦен_Key>a5181057-da49-11e2-8616-001e67040365</d:ТипЦен_Key>
         <d:СкладГруппа>235916f7-da6f-11e2-8616-001e67040365</d:СкладГруппа>
         <d:СкладГруппа_Type>StandardODATA.Catalog_Склады</d:СкладГруппа_Type>
         <d:Маршрут_Key>114de9b2-da72-11e2-8616-001e67040365</d:Маршрут_Key>
      </m:properties>
   </content>
</entry>

However, no matter what content we send - filling in all the fields correctly, or not filling in any, invariably we receive in response:
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1</m:code>
<m:message>Ошибка инициализации модуля: Документ.ЗаказПокупателя.МодульОбъекта</m:message>
</m:error>

At the same time, if you send data in a similar way, for example, to POST /Digital/odata/standard.odata/InformationRegister_kpkInformation on GPSTracks, then everything goes well.
Tell me, please, what is the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question