SocrateCloud API is developed in respect of RESTful principles (see Wikipedia definitions). You can use "GET" to retrieve data and "POST" to create, update or delete. For sending and receving data, we use REST web services over HTTPS protocol with JSON/plain text data format. For this you need to create HTTP GET/POST requests, pass along GET/POST parameters and handle response in JSON format or plain text (for errors or POST requests).
API root URL is: https://api.socratecloud.com/webapi/
When a request generate an exception or error, the return message has the format "ERROR: some error".
Starting with v2 (version 2), the return message is in JSON format!
Eg.
{
"errorMessage" : "Invalid access token",
"isError" : true
}
Pagination is mandatory for request that returns a list of JSON Objects and is specified using parameters startRow and endRow.
For each method you could specify version number. In API methods URL take care to replace {version}.
Default version number is 0.
to return 100 records in batch of 50 rows must make two requests with startRow=0&endRow=50 and startRow=50&endRow=100;
to return first record make a request with startRow=0&endRow=1
to return second record use startRow=1&endRow=2
If no parameter is specified, 0-100 is used. If interval is longer than 100, will be trimmed to 100 (for 33-500, the request will return records for interval 33-133)
you can use parameter "OrderBy" to indicate columns used to sort the resultset
for "Create" method:
for entities - if the field "Value" is not specified, the system will generate a default value because the "Value" field is mandatory;
for documents - if the field "DocumentNo" is not specified, the system will generate a default number of document because the "DocumentNo" field is mandatory;
for "Update" method:
the fields not provided into json or have a value of ”null” will be always updated with ”null” !
if you don't want to change the value for some fields, you must provide the old value for each field.
for entities - if the field "Value" is not specified or is sent "null", the system will ignore and the "Value" will remain unmodified, because the field "Value" can not be "null";
for documents - if the field "DocumentNo" is not specified or is sent "null", the system will ignore and the "DocumentNo" will remain unmodified, because the field "DocumentNo" can not be "null";
for documents - the generical rule is that the update is not allowed on processed document, with one exception: when you want to change "DocumentStatus" using "DocumentAction".
starting from version 18.06 for stock documents (SCWI create methods) is not mandatory to specify the Organization name or ID in JSON content or in URL method if warehouse is clearly said in JSON content or in URL method. The Organization is determinated from warehouse definition.