Automate your eSeGeCe downloads with the new account API

· Applications

Until now, getting a registered build meant signing in to your account, opening Downloads, picking a product and clicking. That is fine once, but it is awkward when you want to pull the latest installer from a build script, a CI pipeline or a provisioning tool.

So we added a small REST API to your account, described with OpenAPI 3.0 and living under /api/v1. You authenticate once with your usual account credentials, get a token, then list and download exactly the files your subscription entitles you to. It reuses the same entitlement and signing logic as the web Downloads page, so you always see the same files you would see in the browser. And because the whole thing is served by the sgcWebSockets OpenAPI server, we could also ship a ready-to-run Delphi client built on sgcOpenAPI.

1. Authenticate

Send your account username and password to POST /api/v1/login. You get back a short-lived Bearer access token (plus a refresh token). Pass the access token in the Authorization header on every other call.

curl -X POST https://www.esegece.com/api/v1/login \
  -H "Content-Type: application/json" \
  -d '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD"}'

The response carries the tokens and a small profile:

{
  "token_type": "Bearer",
  "access_token": "…",
  "refresh_token": "…",
  "expires_in": 3600,
  "user": { "username": "…", "name": "…", "email": "…" }
}

When the access token expires, call POST /api/v1/refresh with your refresh token to get a new pair, or simply log in again. POST /api/v1/logout revokes a token you no longer need.

2. List the files you can download

GET /api/v1/downloads returns the files your account may download. Omit the version for the latest release, pass ?version=2026.5.0 for a specific one, or ?version=beta for the current beta. Use GET /api/v1/products/versions to discover the available versions and their release dates.

curl "https://www.esegece.com/api/v1/downloads" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Each item describes one file and includes a short-lived signed url that streams the bytes:

{
  "files": [
    {
      "product": "sgcWebSockets",
      "version": "2026.5.0",
      "kind": "release",
      "filename": "sgcWebSockets_2026.5.0.exe",
      "date": "2026-05-15",
      "url": "https://www.esegece.com/api/v1/dl?t=…"
    }
  ],
  "version": "2026.5.0"
}

3. Download each file

Every item carries a ready-to-use url. Just GET it and save the bytes — the link is signed and short-lived, so request the list shortly before downloading.

curl -L -o setup.exe "URL_FROM_THE_LIST"

A Delphi client with sgcOpenAPI

Because the API is described with OpenAPI, you can drive it from Delphi with the sgcOpenAPI client in just a few lines: log in, set the Bearer token, then list (and download) your files. You can also point the sgcOpenAPI code generator at the spec to generate a fully typed client.

uses
  sgcHTTP_OpenAPI_Client;

var
  oClient: TsgcOpenAPI_Client;
  oReq: TsgcOpenAPIRequest;
  oResp: TsgcOpenAPIResponse;
  vToken: string;
begin
  oClient := TsgcOpenAPI_Client.Create(nil);
  oReq := TsgcOpenAPIRequest.Create;
  oResp := TsgcOpenAPIResponse.Create;
  try
    oClient.SetBaseURL('https://www.esegece.com');

    // 1) Log in -> Bearer token
    oReq.Method := oapiHttpPOST;
    oReq.Endpoint := '/api/v1/login';
    oReq.ContentType := 'application/json';
    oReq.Body := '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD"}';
    oClient.HTTP_REQUEST(oReq, oResp);
    vToken := GetJSONValueFromNode('access_token', oResp.ResponseText);
    oClient.Authentication.Token.BearerToken := vToken;

    // 2) List the files for the latest release
    oReq.Method := oapiHttpGET;
    oReq.Endpoint := '/api/v1/downloads';
    oReq.Body := '';
    oReq.Security := oapiSecurityToken;
    oClient.HTTP_REQUEST(oReq, oResp);
    Writeln(oResp.ResponseText);
  finally
    oResp.Free;
    oReq.Free;
    oClient.Free;
  end;
end;

We ship a complete version of this program — one that logs in, lists every entitled file and downloads them all — as a downloadable .dpr from your account.

Interactive docs and where to find it

Sign in to your account and open the API entry in the sidebar (/my-account/api). There you will find a Quickstart with Delphi and curl examples side by side, an interactive Swagger UI at /api/v1/docs, the raw OpenAPI specification at /api/v1/openapi.json, and the downloadable Delphi client. The page is available in every language the account portal supports.

A note on security: tokens are short-lived and revocable, login is rate-limited, and every request is checked against your account's entitlements — exactly like the web Downloads page. Sub-accounts inherit their parent account's downloads, just as they do in the browser.

Questions, feedback or help wiring this into your build? Get in touch — you will get a reply from the people who wrote the code.