Through the PUT method you can enter/modify data in/from the published tables. The values are sent in XML or JSON format in the DATA section of the HTTP request.
Path parameter: this shall be entered immediately after .../sdeiRESTWs/resources/rfDataExchangeInterface/ and specifies the format used to send the data (XML or JSON);
Query parameters: these must be entered after the path parameter. The first character is '?' (.../sdeiRESTWs/resources/rfDataExchangeInterface/XML?param1=valoare¶m2=valoare...)
clientID: the ID of the tenant - mandatory
roleID: the ID of the role used to access the data
userName: the user authentication name
password: the user authentication password
publishName: the table's publishing name - mandatory
The XML format used to send the data has the following structure:
<?xml version="1.0"?>
<webRowSet>
<metadata>
<column-name>Nume publicare coloană 1</column-name>
..........
<column-name>Nume publicare coloană N</column-name>
</metadata>
<data>
<columnValue>Valoare coloană 1</columnValue>
..........
<columnValue>Valoare coloană N</columnValue>
</data>
</webRowSet>
The JSON format used to send the data has the following structure:
{ "<Nume coloana 1>":<Valoare coloana 1>, "<Nume coloana 2>":<Valoare coloana 2>, .... "<Nume coloana N>":<Valoare coloana N> }
The format of the data:
Numerical data with decimals: whole_part[.fractional_part]. Without thousands and decimals separators;
Date + Time data: DD-MM-YYYY[ HH:MM:SS]. If you want to use the current date and time, enter CURRENT;
String and JSON data types: entered between quotes.
Important: Inside a file you can only enter a single record. If you need to send multiple records, you must do so using distinct files!
Note: You need not specify all the published columns when sending data. The columns that receive automatic values can be ignored (for example Document Number- type columns - DocumentNo, Active/IsActive, etc.).
Note: The values for the Created, CreatedBy, Updated, UpdatedBy type columns are ignored even if these are sent. These columns automatically receive values.
In order to enter new records in SocrateCloud, the ID column must have the value 0.
Below you will find, as an example, a file that enters a record in the Units of Measure table.
XML format:
<?xml version="1.0"?>
<webRowSet>
<metadata>
<column-name>AD_Client_ID</column-name>
<column-name>AD_Org_ID</column-name>
<column-name>Uom_ID</column-name>
<column-name>Symbol</column-name>
<column-name>Name</column-name>
<column-name>Description</column-name>
<column-name>CostingPrecision</column-name>
<column-name>StdPrecision</column-name>
<column-name>Cod X12DE355</column-name>
</metadata>
<data>
<columnValue>11</columnValue>
<columnValue>0</columnValue>
<!-- valoare zero pentru coloana Uom_ID -» înregistrare noua--->
<columnValue>0</columnValue>
<columnValue>DOC</columnValue>
<columnValue>Document</columnValue>
<columnValue>Unitate de masura pentru documente</columnValue>
<columnValue>0</columnValue>
<columnValue>0</columnValue>
<columnValue>DOC</columnValue>
</data>
</webRowSet>
{
"AD_Client_ID":11,
"AD_Org_ID":0,
"Uom_ID":0,
"Symbol":"DOC",
"Name":"Document",
"Description":"Unitate de masura pentru documente",
"CostingPrecision":0,
"StdPrecision":0,
"Cod X12DE355":"DOC"
}
in the case of successful saving:the ID of the record;
in the case of error: the word ERROR followed by the error message;
null in case of exception.
In this case, the ID column in the XML file must have the value of the record you wish to modify.
Below you will find an example of such a file that modifies the description of a record in the Units of Measure table.
XML Format:
<?xml version="1.0"?>
<webRowSet>
<metadata>
<column-name>AD_Client_ID</column-name>
<column-name>AD_Org_ID</column-name>
<column-name>Uom_ID</column-name>
<column-name>Description</column-name>
</metadata>
<data>
<columnValue>11</columnValue>
<columnValue>0</columnValue>
<!-- valoare existentă pentru coloana Uom_ID -» modificare înregistrare--->
<columnValue>1000033</columnValue>
<!-- Se modifică descrierea--->
<columnValue>UM pentru articole de tip document</columnValue>
</data>
</webRowSet>
JSON Format:
{ "AD_Client_ID":11, "AD_Org_ID":0, "Uom_ID"1000033:, "Description":"UM pentru articole de tip document" }
in the case of successful saving: empty string;
in the case of error: the word ERROR followed by the error message;
null in case of exception.
Processing (completing, voiding, preparing, etc.) the documents
In this case, the ID column must contain the value of the record you wish to process, while the DocAction column must have one of the following values:
CO = Complete
AP = Approve
RJ = Reject
VO = Void
CL = Close
RC = Reverse Correct
RA = Reverse Accrual
PR = Prepare