ZSK Web API

ZSK Web API

Overview

RESTful Service Workflow – Short Description

A RESTful service workflow typically begins when a client (such as a web app, mobile app, or another service) sends an HTTP request to a server using standard methods like GET, POST, PUT, or DELETE. Each request targets a specific resource, identified by a unique URI. The server processes the request according to the action implied by the HTTP method—retrieving data, creating a new record, updating an existing one, or deleting it.

The server then returns a standardized response, usually in JSON format, along with an appropriate HTTP status code that indicates the outcome (for example, 200 OK, 201 Created, or 404 Not Found). Throughout the workflow, the server maintains a stateless interaction model, meaning each request contains all necessary information and the server does not store client context between requests. This stateless, uniform approach ensures scalability, simplicity, and loose coupling between client and server.

C# example

using RestSharp;
public async Task CallStitchJobAsync()
{
    var client = new RestClient("https://ZSKAddress");
    var request = new RestRequest("StitchJob", Method.Post)
    {
        RequestFormat = DataFormat.None
    };
string json = @"
{
  ""RequestType"": ""CreatePNG"",
  ""Monograms"": [
{
  ""Text"": [
""ZSK""
  ],
  ""FontFamily"": ""Arial"",
  ""FontSizeMM"": 10.0,
  ""UsedNeedle"": 1,
  ""TextStitchParameter"": ""Premium""
}
  ],
  ""Needle"": [
{
  ""Red"": 0,
  ""Green"": 0,
  ""Blue"": 0,
  ""ColorName"": ""Black"",
  ""ColorNumber"": ""20"",
  ""ThreadSize"": ""40"",
  ""Name"": ""ISACORD""
}
  ],
  ""ServerVersion"": 3
}";
    // Body direkt als string hinzufügen
    request.AddStringBody(json, ContentType.Json);
    var response = await client.ExecuteAsync(request);
}