Developing with Web Services
- Web services available
- Export web service
- Import web service
- Get information about import/export batch task
In the cloud, you can import or export files with an import/export template on a local workstation, but you need to manually drag and drop files.
You can completely automate these operations with an API for external tools:
- To send data files to be integrated with an import template
- To get data in a file obtained by an extraction associated with an export template
Because an extraction or integration can take time, the API must also be able to handle batch operations.
Web services available
Standard SOAP web services are supplied to manage these operations. These web services use the standard SOAP web service connection pools and can be called from any program that can:
- Connect to the SOAP web service server integrated in the Sage X3 platform
- Authenticate with the available authentication methods
- Send a normalized SOAP message as indicated in the SOAP web service documentation and receive the answer
The SOAP web services used are subprograms associated with web services. Their names are the following:
Service name | Subprogram | Description |
---|---|---|
AOWSEXPORT | AOWSEXPORT.EXPORT | Exports data associated with a template and parameters |
AOWSIMPORT | AOWSIMPORT.IMPORT | Imports data based on an import template |
AOWSBATGET | AOWSGETBATCH.GET | Retrieves information about a batch import/export request |
These SOAP web services can be called from any program that can perform a SOAP web service in the correct format as described in web service management. You can, for example, write in Java, PHP, JavaScript, .NET, C, etc.
Export web service
The export web service contains the following arguments:
Group | Level | Code | Description | Parameter type | Dim | Argument type |
---|---|---|---|---|---|---|
GRP1 | 1 | I_MODEXP | Template | Char | 1 | Sent |
GRP1 | 1 | I_CHRONO | Sequence no. | Char | 1 | Sent |
GRP2 | 1 | I_TCRITERE | Criteria | Char | 10 | Sent |
GRP3 | 1 | I_EXEC | Execution type | Char | 1 | Sent |
GRP3 | 1 | I_RECORDSEP | Record separator | Char | 1 | Sent |
GRP3 | 1 | O_FILE | Data file | Clbfile | 1 | Returned |
GRP3 | 1 | O_REQNUM | Query | Integer | 1 | Returned |
GRP3 | 1 | O_STATUS | Status | Integer | 1 | Returned |
GRP3 | 1 | O_MESSA | Message | Char | 1 | Returned |
The parameters sent are:
- The template code (BPC for example)
- A chrono flag (YES or NO) to trigger an export with chrono management and prevent the export of duplicate records
- An array of criteria (filters expressed in X3 language such as: [F:BPC]BPCSTA=1)
- An execution flag (REALTIME or BATCH)
- A character used as a record separator in the returned data feed
The SOAP parameters returned are:
- The status (1=OK, 0=errors)
- The log file produced by the export as an array of a structure containing a status (1=warning, 3=error) and the corresponding text message
The values returned are:
- A clob containing the file produced by the export if the execution is in real time
- An integer containing the request ID if a batch execution was requested. This value is used later as a parameter to indicate the status of the batch request.
- The web service status (0=OK, otherwise it is an error)
- A message if an error occurred
Export examples
- The Getting Started page has step-by-step examples of importing and exporting.
- Example of exporting a customer in real time
- Example of exporting in real time with a parameter error
Import web service
The import web service contains the following arguments:
Group | Level | Code | Description | Parameter type | Argument type |
---|---|---|---|---|---|
GRP1 | 1 | I_MODIMP | Template | Char | Sent |
GRP1 | 1 | I_AOWSTA | Import/export temporary storage | Char | Sent |
GRP1 | 1 | I_EXEC | Execution type | Char | Sent |
GRP1 | 1 | I_RECORDSEP | Record separator | Char | Sent |
GRP1 | 1 | I_FILE | File | Clbfile | Sent |
GRP1 | 1 | O_REQNUM | Query | Integer | Returned |
GRP1 | 1 | O_STATUS | Status | Integer | Returned |
GRP1 | 1 | O_MESSA | Message | Char | Returned |
The parameters sent are:
- The template code (BPC for example)
- An import/export temporary storage flag (YES or NO) to send the erroneous lines in the temporary import/export storage space
- An execution flag (REALTIME or BATCH)
- A character used as a record separator in the returned data feed
- A clob containing the file to be imported. This file must end with the characters END.
For example, if you import two lines with a string, a date, and a numeric value, and if the record separator is “|”, the correct clob contents would be: STRING1;20170203;1| STRING2;20160512;33|END
The SOAP parameters returned are:
- The status (1=OK, 0=errors).
- The log file produced by the export as an array of a structure containing a status (1=warning, 3=error) and the corresponding text message.
The values returned are:
- An integer containing the request ID if a batch execution was requested. This value is used later as a parameter to indicate the status of the batch request.
- The web service status (0=OK, otherwise it is an error)
- A message if an error occurred
Import Examples
- The Getting Started page has step-by-step examples of importing and exporting.
- Example of importing a customer in real time
- Example of importing in real time with a parameter error
- Example of importing in real time with data errors
Get information about import/export batch task
This web service contains the following arguments:
Group | Level | Code | Description | Parameter type | Argument type |
---|---|---|---|---|---|
GRP1 | 1 | I_TACHE | Batch task | Char | Sent |
GRP1 | 1 | I_REQNUM | Query | Integer | Sent |
GRP1 | 1 | I_GETTRA | Log | Char | Sent |
GRP1 | 1 | O_STAREQ | Status | Integer | Returned |
GRP1 | 1 | O_MESREQ | Message | Char | Returned |
GRP1 | 1 | O_FILE | File | Clbfile | Returned |
GRP1 | 1 | O_FILETRA | File | Clbfile | Returned |
GRP1 | 1 | O_STATUS | Status | Integer | Returned |
GRP1 | 1 | O_MESSA | Message | Char | Returned |
The parameters sent are:
- The type of batch task (IMPORT or EXPORT)
- The request ID returned by the batch import or export web service (12345 for example)
- A flag (YES or NO) to get the log file returned
The SOAP parameters returned are:
- The status (1=OK, 0=errors)
- The log file produced by the export as an array of a structure containing a status (1=warning, 3=error) and the corresponding text message
The values returned are:
- A numeric value containing the status of the task with the following values:
- 1 = Standby
- 2 = In progress
- 3 = Finished
- 4 = On Hold
- 5 = Killed
- 6 = Canceled
- 7 = Error
- 8 = Overdue
- 9 = Warning
- A text containing the corresponding message (standby, in progress. etc.)
- A clob containing the file returned if the type is EXPORT and if the task is finished with or without errors or warnings
- A clob containing the trace file if it was requested
- The web service status (0=OK, otherwise it is an error)
- A message if an error occurred