Testing Entersoft Web API calls from the connector script page#
The WebAPI Explorer lets you try a call to the Entersoft Web API before you write it into an Entersoft connector script. It sends the request the way a script does with _httpPostJson: a POST with a JSON body, authenticated with the Entersoft API key stored on the connector. It then shows what the Web API answered. You choose which Entersoft Web API environment to call, Live or Staging.It also lists the endpoints your script already calls, so you can run any of them, or read its schema, with one click.The tab appears on the connector script page, next to the Database Explorer, only for Entersoft connectors.Calls are real. The request goes to the Entersoft Web API with the connector's API key. An endpoint that creates or updates documents changes data in the ERP, exactly as it would from the script. A failed call is not retried. Live is the default environment, so check the Environment before you execute such an endpoint.
The platform adds the API key to the request itself; the key is never shown in, or sent to, your browser.The script's endpoints#
The left side of the tab lists Script endpoints: every endpoint the script passes as the first argument of a _request(endpoint, params, payload) call.The list follows the script editor, unsaved edits included, so a call you have just typed appears without saving.
Endpoints are grouped by their first path segment and sorted by name. Each group is headed by the full address of that service in the selected environment, for example https://api.entersoft.eu/api/rpc or https://api.entersoft.eu/api/eshopconnector on Live. An endpoint called more than once is listed once, with the script lines that call it.
Only endpoints written as a fixed string, such as _request("rpc/PublicQuery/{GroupID}/{FilterID}", params, payload), are listed. A call that builds its endpoint at run time, for example _request("rpc/" + name, ...), cannot be known in advance; the list shows how many such calls the script has. Calls inside comments are ignored.
Search endpoints filters the list by any part of the endpoint.
Each row has two buttons:Execute puts the endpoint in the Endpoint field and sends the call with the payload in the Payload (JSON) editor, as it is, so edit the payload first to change the paging or add a filter.
Get schema puts the endpoint in the Endpoint field and reads its schema, described under Reading an endpoint's schema below.
Clicking the endpoint itself only puts it in the Endpoint field, without sending the call.When the script has no _request call with a fixed endpoint, type the endpoint yourself.Making a call#
1.
Environment: the Entersoft Web API to call.Live, the default, calls https://api.entersoft.eu/api/.
Staging calls Entersoft's staging Web API.
Both are called with the connector's API key. Execute and Get schema use the environment selected when you press them.
2.
Endpoint: type the path that follows the environment's address, shown under the field, in the form {service}/{action}, for example eshopconnector/ProcessBasket, or pick one from the script's endpoints.Path segments may contain letters, digits, -, _, . and ~, separated by /.
A query string is allowed: {service}/{action}?{name}={value}.
A leading / is ignored. The endpoint can be up to 512 characters long.
A full URL, a . or .. segment and a # fragment are rejected.
3.
Payload (JSON): the request body. A new explorer starts with the first page of 100 records:{
"PageNo": 1,
"PageSize": 100
}
Format JSON indents the payload, and pasted JSON is formatted automatically.
The payload must be valid JSON of at most 65,536 characters. An empty payload sends {}.
4.
Press Execute, press Enter in the endpoint field, or press F5.
The environment, endpoint, payload and search you entered are kept while you switch between the tabs of the script page.Reading an endpoint's schema#
Get schema, next to Execute or on a listed endpoint, shows the fields an endpoint works with, in the selected environment. Where they come from depends on the endpoint, checked in this order:1.
A public query, rpc/PublicQuery, rpc/GetPQData or rpc/GetPQData2 followed by the query's id, such as rpc/PublicQuery/{GroupID}/{FilterID}: the response the query returns, with the type of each column of its rows, and the parameters it accepts, read from the description Entersoft publishes for the query. The explorer sends a GET to rpc/PublicQueryInfo/{GroupID}/{FilterID}. The payload is not sent, and the query itself does not run. The response is shown as described under Reading a public query below, and the query's parameters are listed above it and added to the payload.
2.
An endpoint the Web API's Swagger document describes, such as the eshopconnector endpoints: the operation as the Entersoft Web API documents it, described under Reading an operation below. Nothing is sent to the endpoint.
3.
Any other endpoint: Get schema lists the fields of the endpoint's last response in the same environment instead, without calling the Web API again. When the endpoint has not been executed yet in that environment, or its last call failed, the explorer asks you to execute it first. Execute and list fields then sends the call with the payload in the editor, to the environment the schema was read for, and shows the fields of its response.
Get schema never sends a call to any other endpoint on its own, because an endpoint such as eshopconnector/SaveAndIssueDocument creates data in the ERP. Only an Execute does.Reading a public query#
The Result shows the response the query returns when you execute it: the name of its table under Table, a row of the query under Rows, and the row count and paging under Count, Page and PageSize. The row has each column the query's layout lists and the type Entersoft gives it:{
"Table": "String",
"Rows": [{ "Code": "String", "Price": "Decimal", "LastModifiedDate": "DateTime" }],
"Count": "int",
"Page": "int",
"PageSize": "int"
}
The columns are in the query's layout order, and include the columns the layout hides.
A column without a type is shown as "any".
When a name appears more than once, ignoring case, only its first column is shown.
When the description lists no layout columns, the Result shows the description as Entersoft returns it.
Above the response, Parameters lists each parameter the query accepts, in the order Entersoft lists them: its ID, caption, type and default value, with the parameters the query requires marked required.Get schema also adds to the payload each parameter the payload does not have yet, under its ID, set to its default value, or to null when it has none. A parameter already in the payload keeps its value, whatever the case of its name, and a payload that is not a JSON object is left as it is. With the default payload, a query whose only parameter is a FromDate without a default gives:{
"PageNo": 1,
"PageSize": 100,
"FromDate": null
}
Entersoft treats a parameter that is null or left out as having no value. A default value is copied as Entersoft lists it, so check it, and set the values you need, before you execute the query.Reading an operation#
The Entersoft Web API publishes a Swagger document that describes the models of its POST operations. The explorer matches the endpoint to an operation by its path segments, ignoring case, and a trailing route parameter such as {routeid} may be left out, so eshopconnector/Customers matches eshopconnector/Customers/{routeid}. A query string is ignored.Request body: the shape of the payload the operation accepts, or a note that it takes no body.
Response body: the shape of its successful response, or a note that the document does not describe it.
A shape lists every property of the model with its type:An object is listed with its own properties, and a list as a single item, [{ ... }].
A plain value is its type, followed in brackets by its format, such as "string (date-time)", or by its allowed values, such as "string (Open | Closed)".
A dictionary, whose property names are not fixed, has a single {key} property.
A model that contains itself is named the second time with (recursive), and a very large or deeply nested model is cut off with (truncated).
{
"Code": "string",
"Date": "string (date-time)",
"Status": "string (Open | Closed)",
"Lines": [{ "Sku": "string", "Qty": "number (double)" }],
"Extra": { "{key}": "string" }
}
The shape is what the document publishes, not what a particular ERP returns. Many models are shared by several operations, and the Web API leaves out a property whose value is empty, so a documented field such as IsWeb can be absent from every row of a response.The platform reads each environment's document without your API key and refreshes it every few hours, so a change Entersoft has just published can take that long to appear.The fields of a response are read as follows:The rows are the response itself when it is a list, otherwise its list of records, such as Data on the eshopconnector endpoints, otherwise the response as a single object. Every returned row is read.
Each field gets its JSON types, such as "number | null". A nested object is listed with its own fields, a list of objects as [{ ... }], and a list of plain values as a type such as "string[]".
undefined marks a field that some rows leave out.
{
"Code": "string",
"Price": "number | null",
"Lines": [{ "Sku": "string", "Qty": "number | undefined" }]
}
The list describes the rows that were returned, not a published contract: a field that is empty in every returned row is listed only as null.Reading the result#
Request: the Result starts with the request that was sent, with the full address of the environment it went to, such as POST https://api.entersoft.eu/api/eshopconnector/ProcessBasket or GET https://api.entersoft.eu/api/rpc/PublicQueryInfo/{GroupID}/{FilterID}. For an operation read from the Swagger document, it is the operation's method and route, such as POST https://api.entersoft.eu/api/eshopconnector/Customers/{routeid}, and nothing was sent. A result keeps the address it came from when you switch to the other environment.
Success: the Result shows the HTTP status code and the response body, formatted as JSON. A body that is not JSON is shown as plain text, and an empty body is reported as such.
Response and fields: after an Execute, Response and Fields switch between the response body and the fields read from it.
HTTP error: when the Web API answers with an error status, the result shows ERP HTTP error <status>: <response>.
No response: when the Web API cannot be reached or does not answer within 2 minutes, the result shows ERP HTTP error EXCEPTION: <reason>.
Large responses: a response larger than 16 MB is not shown. Narrow the request, for example with a smaller PageSize.
Missing API key: a connector without an Entersoft API key cannot be called. Set the key in the connector's settings first.
Benefits of the WebAPI Explorer:#
Faster script development: check an endpoint, its payload and its response before writing them into the script.
Know your script's calls: see every endpoint the script uses, run it, and read its schema.
Real data: see the exact response the script will receive for the same call.
Troubleshooting: reproduce a failing call from the script and read the Web API's own error message.
Modified at 2026-11-16 09:18:56