The following example describes how to make a request to an API to generate a report. The API supports GET requests and requires specific parameters to generate the report. The request is made to a specific URL, which depends on the server hosting the client application.

Note on the URL

The URL used to call the API, such as, for example rdp103.sbzsystems.com, depends on the server that hosts the client’s application. Therefore, this part of the URL will vary depending on the environment where the client is hosted. The client should use the appropriate URL assigned to their server to ensure the request works correctly.

Request Method

The API call is made using the GET method. The request’s format requires providing specific parameters in the URL, which determine the data that will be retrieved.

API URL

The request is made to the following URL:

Where [client-server] represents the server hosting the client’s application.

Parameters

The parameters appended to the URL are as follows:

  • from: Specifies the start date and time for the data to be retrieved, in the format YYYYMMDDHHMMSS. For example, from=20240101000000 refers to January 1, 2024, at 00:00:00.
  • to: Specifies the end date and time for the data, also in the YYYYMMDDHHMMSS format. For example, to=20240901000000 refers to September 1, 2024, at 00:00:00.
  • user: The username used for authentication with the API. For example, user=testuser.
  • q: Specifies the title of report requested. In this example, q=00.orders refers to reports related to orders.
  • key: A security key required for accessing the API. This key is set via EMDI’s settings, Communication/Maintenance, Communication via http Code/ID.
  • format: The format in which the data will be returned. In this example, the value is json, meaning the data will be returned in JSON format. It should be noted that the report will need to be designed accordingly, for the result to be valid.

Example Request

The complete API call with the above parameters might look like this:

This URL includes all the necessary information to generate a report for the period from January 1, 2024, to September 1, 2024, for the user “testuser,” with a focus on orders, and will return the data in JSON format.

Response

The API will return a report in the requested format, such as JSON, which can be parsed and used by the system or application.

Code Example

The following code demonstrates how to make the API request and handle the response:

Note: Replace [client-server] with the correct server URL for the client’s environment to ensure the API functions correctly.