Saby API

Upload documents to the system or archive via the API

Upload documents to the system or archive via the API

The document archive can be stored either in your information system or in Saby. In the latter, it is stored without a time limit. Uploading documents to your system/local archive should be based on the analysis of events that are returned as a result of calling «СБИС.СписокИзменений».

We recommend uploading the document to your system in parts: primary and service attachments for each workflow event, uploading signature files associated with event attachments, and so on. After the document is approved/rejected, you can save it to a local archive on your computer/server. The document is saved in a zip archive file with all attachments and e—signatures.

For companies with a large document flow, it is recommended to upload documents only for key events in zip archive files, and if necessary, save their PDF representation.

To optimize uploading documents to your system/local archive:

  1. Get a list of documents for which document flow events occurred in Saby. This can be done using «СБИС.СписокИзменений».
  2. Implement archive uploading. This can be done for each event or for key events in the workflow.
For each event
For key events
  1. For outgoing attachments in «Документ.Событие.Вложение.Направление»=«Исходящий» («Document.Event.Attachment.Direction»=«Outgoing») — check their presence in your IS. There may be a situation when the user was running a document flow on the online.saby.ru, not in your information system. If the attachment is missing from your IS, upload it.
  2. For incoming attachments in «Документ.Событие.Вложение.Направление»=«Входящий» («Document.Event.Attachment.Direction»=«Incoming») upload the content to your information system. Save the content associated with the event to a local archive:
    • primary — «Документ.Событие.Вложение.Служебный»=«Нет» («Document.Event.Attachment.Service»=«No»);
    • service — «Документ.Событие.Вложение.Служебный»=«Да» («Document.Event.Attachment.Service»=«Yes»).
  3. Upload the contents of the electronic signatures associated with the event attachments to your IS and save them to a local archive:
    • Under incoming attachments in «Документ.Событие.Вложение.Направление»=«Входящий» («Document.Event.Attachment.Direction»=«Imcoming»);
    • Under the attachments, for which there are incoming signatures «Документ.Событие.Вложение.Файл.Ссылка» («Document.Event.Attachment.File.Link») — empty, «Документ.Событие.Вложение.Подпись.Файл.Ссылка» («Document.Event.Attachment.Signature.File.Link») — filled in.
  4. One or more electronic signatures can be associated with an event.

    «Документ.Вложение.Файл.Ссылка» («Document.Attachment.File.Link») — empty, «Документ.Вложение.Подпись.Файл.Ссылка» («Document.Attachment.Signature.File.Link») — filled in. This means, for example, that sending a signature under the primary document when approving it.

  5. Synchronize the current status of the document.
  1. For key workflow events in «Документ.Событие.Название» («Document.Event.Name»=«Receipt») or when the document status changes in «Документ.Состояние.Код» («Document.Condition.Code»):
    • Download the full zip archive of the document (revision): run an HTTP GET request at the URL specified in «Документ.СсылкаНаАрхив» («Document.LinktoArchive»). Addressing:
      • «Документ.Идентификатор» («Document.ID») — for latest version;
      • «Документ.Редакция.Идентификатор» («Document.Edition.ID») — for specific version.
    • If necessary, save a visual representation of all formalized document attachments. To do this, run an HTTP GET request at the URL specified in «Документ.СсылкаНаPDF» («Document.ReferenceToPDF»). Addressing:
      • «Документ.Идентификатор» («Document.ID») — for latest version;
      • «Документ.Редакция.Идентификатор» («Document.Edition.ID») — for specific version.

License

The «Exchange with partners» and «Implementation of EDI» tariffs of «Electronic Document Flow» service.

Нашли неточность? Выделите текст с ошибкой и нажмите ctrl + enter.