GenericTicketConnectorREST#

This document provides examples of how to use the Ready2Adopt GenericTicketConnectorREST web service in Znuny. The GenericTicketConnectorREST provides RESTful API endpoints to interact with tickets and sessions.

Default Operations:

SessionCreate

Create a Session

SessionDelete

Delete a Session

SessionGet

Retrieve Session Data

TicketCreate

Create a Ticket

TicketGet

Retrieve Ticket Data

TicketHistoryGet

Retrieve Ticket History

TicketSearch

Search for Tickets

TicketUpdate

Update a Ticket

Note

All examples assume that the web service is hosted at http://localhost/znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/.

You may need to adjust the URL based on your Znuny installation and configuration.

See also

API Documentation:

Important

To keep the documentation short, and readable: Response and Request Examples may not contain all data fields. Please refer to the API documentation for a complete list of fields and their descriptions.

SessionCreate#

Create a Session for use with other operations.

Example Request:

POST /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Session HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json

{
    "UserLogin": "admin",
    "Password": "admin_password"
}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "SessionID": "your_session_id"
}

SessionDelete#

Delete a Session

Example Request:

DELETE /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Session/<your_session_id> HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Success": 1
}

SessionGet#

Retrieve Session Data

Example Request:

GET /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Session/SessionID=<your_session_id> HTTP/1.1
Host: localhost
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "SessionData": [
        {
            "Key": "AdminCommunicationLogPageShown",
            "Value": "25"
        },
        {
            "Key": "AdminDynamicFieldsOverviewPageShown",
            "Value": "25"
        }
        // More session data fields
    ]
}

TicketCreate#

Create a Ticket

Example Request:

POST /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json

{
    "UserLogin": "admin",
    "Password": "admin_password",
    "Ticket":
        {
            "Queue": "Postmaster",
            "StateID": "1",
            "OwnerID": "1",
            "TypeID": "1",
            "PriorityID": "3",
            "Title": "Test",
            "CustomerUser": "user@example.com",
            "Lock": "unlock"
        },
    "Article": {
        "CommunicationChannel": "Internal",
        "SenderType": "agent",
        "Subject": "Initial Request",
        "Body": "Test Body",
        "From": "user@example.com",
        "To": "user@znuny.exapmle.com",
        "VisibleForCustomer": "0",
        "ContentType": "text/plain; charset=utf8"
    },
}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "TicketID": "1",
    "TicketNumber": "2025000001",
    "ArticleID": "1"
}

TicketGet#

Retrieve Ticket Data

Example Request:

GET /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/<ticket_id>?SessionID=<your_session_id> HTTP/1.1
Host: localhost
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Ticket": [
    {
      "Age": 1052507,
      "ArchiveFlag": "n",
      "ChangeBy": 1,
      "Changed": "2025-09-16 14:08:17",
      "CreateBy": 1,
      "Created": "2025-09-11 05:52:20",
      "CustomerID": "",
  ]
}

TicketHistoryGet#

Retrieve Ticket History

Example Request:

GET /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/History/<ticket_id>?SessionID=<your_session_id> HTTP/1.1
Host: localhost
Accept: application/json

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "History": [
        {
            "HistoryType": "ArticleCreate",
            "CreateBy": 1,
            "Created": "2025-09-11 05:52:20",
            "Content": "Article (ID=456) created.",
            "UserID": 1,
            "UserLogin": "admin"
        },
        {
            "HistoryType": "StateUpdate",
            "CreateBy": 1,
            "Created": "2025-09-11 06:00:00",
            "Content": "State changed from 'new' to 'open'.",
            "UserID": 1,
            "UserLogin": "admin"
        }
    ]
}

TicketSearch#

Search for Tickets

Example Request:

POST /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/Search  HTTP/1.1
Host: localhost
Accept: application/json

{
    "SessionID": "<your_session_id>",
    "QueueIDs": [1, 2, 3],
}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "TicketIDs": [
        1,
        2,
        3,
        4,
        5
    ]
}

TicketUpdate#

Update a Ticket

Example Request:

PATH /znuny/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/<ticket_id> HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json

{
    "SessionID": "<your_session_id>",

    "Ticket":
        {
            "StateID": "2",
            "PriorityID": "2",
            "OwnerID": "2",
            "Title": "Updated Test Title"
        }
}

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Success": 1
}