ERP sync service

From 1Archive help
Revision as of 15:38, 5 February 2020 by Dino.dewaen (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The ERP sync service allows users which are assigned to the webservice, to push or pull XML data from 1Archive.

The pushed XML data can contain data for:

  • Lookup lists
  • Partner groups
  • Partners
  • Companies
  • Reception methods
  • Delivery methods
  • Documents
  • Cross validation rules
  • String validation rules
  • Templates
  • Users


The pulled XML data can contain data for:

  • Documents
  • Attachments

Info.png To each reaquest, you can specify a connectorVersion attribute to define which version of the ERP sync service you wish to use.

1 Request

The request for calling the webservice should at least contain all following parameters:

  • user: the username of an available user in the 1Archive environment
  • password: the password for the above user
  • serviceName: the name of the webservice you are trying to call
  • action: define the action you wish to perform on the webservice
  • request: the data you wish to send to the webservice. In most cases, this will be a Base64 encoded XML file
  • attribute: a key-value pair which contains certain attribute values, see below for more information


2 Response

The reponse of the webservice will in most cases be a Base64 encoded XML file.

3 Attributes

  • push.allowPushOfGlobals: is it allowed to push global 1Archive data? This can be set to TRUE or FALSE. The default value is FALSE
  • push.rolesForPushingGlobals: a pipe separated string of roles, which are allowed to push global items to 1Archive. Users with one of these roles can always push global items, even when the push.allowPushOfGlobals is set to FALSE
  • push.usersForPushingGlobals: a pipe separated string of users, which are allowed to push global items to 1Archive. These users can always push global items, even when the push.allowPushOfGlobals is set to FALSE
  • pull.processingStatussesToPull: a pipe separated list of statuses of documents that can be downloaded via the PULL_DOCUMENTS request
  • pull.downloadStartedProcessingStatus: define the processing status which needs to be assigned to a document when the download has started. This way it will not be picked up again when another request is performed at the same time
  • pull.downloadStartedWorkflowStatus: define the workflow status which needs to be assigned to a document when the download has started
  • pull.downloadCompleteProcessingStatus: define the processing status which needs to be assigned to a document when the download has completed
  • pull.downloadCompleteWorkflowStatus: define the workflow status which needs to be assigned to a document when the download has completed
  • encoding: define the encoding which needs to be used for reading the request and sending the response
  • requestLoggingActive: should the logging be active for incoming requests? This can be set to TRUE or FALSE
  • requestLoggingPath: the path to the logging file if requestLoggingActive is set to TRUE

4 Actions

4.1 PUSH_XML

Via the PUSH_XML action, data can be pushed into the 1Archive archive. The request data should be a Base64 encoded xml in the 1Archive transfer format (use the "Export to XML" button for an example).


Warning.png When the data is pushed, the rights of the user are validated. If the user is not allowed to push certain data, the complete request will be stopped.

4.1.1 Global items

Global items are items that are not related to a certain company. Items that can be defined global are:

  • Lookup lists
  • Lookup list items (if the linked lookup list is marked as a system list)
  • Partner groups
  • Partners (if the partner group is marked as a system list)
  • Companies
  • Reception methods
  • Delivery methods
  • Cross validation rules (if those are marked as system based in the document type configuration)
  • String validation rules (if those are marked as system based in the document type configuration)
  • Users

Info.png Any user can push global items if the allowPushOfGlobals attribute is set to TRUE. If the attribute is set to FALSE, they can only be pushed by users who have one of the roles defined in the rolesForPushingGlobals attribute, or where the username appears in the list defined by the usersForPushingGlobals attribute.

4.1.2 Company specific items

Company specific items are items directly linked to a company. Items that can be company specific are:

  • Lookup list items (if the linked lookup list is not marked as a system list)
  • Partners (if the linked partner group is not marked as a system list)
  • Documents
  • Cross validation rules (if those are not marked as system based in the document type configuration)
  • String validation rules (if those are not marked as system based in the document type configuration)
  • Templates

Info.png Any user can push company specific items to 1Archive, as long as the user is linked to the company he's trying to push data for. For pushing documents, the user also needs to have access to the document type.

4.1.3 Example request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PUSH_XML</action>
           <request>###</request>
           <attribute key="connectorVersion"></attribute> 
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.1.4 Example response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

Info.png The return node will contain a Base64 encoded XML file with the import results.

4.2 PULL_DOCUMENTS

Via the PULL_DOCUMENTS action, documents with a certain status can be downloaded. Once the response has been sent to the client, the downloaded documents are updated to another status.
The status for which the documents should be downloaded (pull.processingStatussesToPull) and the status to which they should be updated (pull.downloadStartedProcessingStatus, pull.downloadStartedWorkflowStatus, pull.downloadCompleteProcessingStatus and pull.downloadCompleteWorkflowStatus) are configured in the webservice configuration.


Info.png Via the instanceCode and the companyCode attributes, you can limit the documents to be downloaded to a certain instance or company. These attributes are optional in the request. If left empty, all documents for all companies where the user who is sending the request has access too will be downloaded.

4.2.1 Example request

<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PULL_DOCUMENTS</action>
           <request>###</request>
           <attribute key="instanceCode"></attribute>
           <attribute key="companyCode"></attribute>
           <attribute key="connectorVersion"></attribute>
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.2.2 Example response

As a response, a Base64 encoded XML in the 1Archive transfer format will be returned. The XML contains all metadata of the documents. The metadata of the attachments is included, the attachment itself should be downloaded via the PULL_ATTACHMENTS action.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

4.3 PULL_DOCUMENTS_COUNT

Via the PULL_DOCUMENTS_COUNT action, the number of documents ready for download can be fetched. The request data can be empty or can contain the code of the company for which the document count should be pulled.

4.3.1 Example request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PULL_DOCUMENTS_COUNT</action>
           <request>###</request>
           <attribute key="connectorVersion"></attribute>
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.3.2 Example response

As a result of the PULL_DOCUMENTS_COUNT action, the number of documents is returned.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

4.4 PULL_DOCUMENT

Via the PULL_DOCUMENT action, a single document can be downloaded. The request data should contain the ID for which the document should be pulled.

4.4.1 Example request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PULL_DOCUMENT</action>
           <request>###</request>
           <attribute key="connectorVersion"></attribute>
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.4.2 Example response

As a response, a Base64 encoded XML in the 1Archive transfer format will be returned. The XML contains all metadata of the documents. The metadata of the attachments is included, the attachment itself should be downloaded via the PULL_ATTACHMENTS action.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

4.5 PULL_ATTACHMENT

Via the PULL_ATTACHMENT action, a single attachment file can be downloaded. The request data should contain the ID for which the attachment file should be pulled.

4.5.1 Example request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PULL_ATTACHMENT</action>
           <request>###</request>
           <attribute key="connectorVersion"></attribute>
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.5.2 Example response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

Info.png The return node will contain a Base64 encoded XML file with the import results.

4.6 PULL_COMPANY

Via the PULL_COMPANY action the list of all companies where the user has access too is returned in a modtransfer xml.

4.6.1 Example request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.connectors.onea.be/">
   <soapenv:Header/>
   <soapenv:Body>
       <web:invoke>
           <user>###</user>
           <password>###</password>
           <serviceName>###</serviceName>
           <action>PULL_COMPANY</action>
           <request>###</request>
           <attribute key="connectorVersion"></attribute>
       </web:invoke>
   </soapenv:Body>
</soapenv:Envelope>

4.6.2 Example response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <ns2:invokeResponse xmlns:ns2="http://webservice.connectors.onea.be/">
           <return>###</return>
       </ns2:invokeResponse>
   </soap:Body>
</soap:Envelope>

Info.png The return node will contain a Base64 encoded XML file with the exported results.