REST Web Services API availability in OTRS

English! place to talk about development, programming and coding
Post Reply
akshattandon
Znuny newbie
Posts: 20
Joined: 15 May 2018, 08:03
Znuny Version: 6.0.5
Real Name: Akshat
Company: None

REST Web Services API availability in OTRS

Post by akshattandon »

Hi All,

I am new to OTRS and wanted to integrate OTRS to our system.
From the documentation, it is clear that we can expose REST Services from the Admin Page.
https://doc.otrs.com/doc/manual/admin/s ... ervice_gui


Unfortunately, the API's which are exposing the data is not full and currently blocking us to integrate OTRS seamlessly with our system.

Eg. To create a Ticket it asks for Article and other relevant details like State, PriorityId etc, But while retrieving the details of the ticket it returns me all the details except the Article details.
The sample data is something like following

Code: Select all

{
    "Ticket": [
        {
            "CreateBy": "1",
            "QueueID": "1",
            "EscalationResponseTime": "0",
            "EscalationTime": "0",
            "Responsible": "user",
            "ChangeBy": "1",
            "StateID": "1",
            "UntilTime": 0,
            "Type": "Unclassified",
            "CustomerUserID": null,
            "EscalationUpdateTime": "0",
            "Queue": "Postmaster",
            "Owner": "test",
            "TimeUnit": 0,
            "OwnerID": "1",
            "PriorityID": "3",
            "Created": "2018-05-15 03:44:11",
            "GroupID": "1",
            "Lock": "unlock",
            "SLAID": "",
            "TicketID": "31",
            "Title": "Test Ticket",
            "CustomerID": null,
            "LockID": "1",
            "RealTillTimeNotUsed": "0",
            "EscalationSolutionTime": "0",
            "StateType": "new",
            "Age": 64824,
            "TicketNumber": "2018051534000143",
            "ArchiveFlag": "n",
            "ResponsibleID": "1",
            "Priority": "3 normal",
            "State": "new",
            "TypeID": "1",
            "Changed": "2018-05-15 03:46:13",
            "UnlockTimeout": "1526355973",
            "ServiceID": ""
        }
    ]
}

Is there any way by which we can retrieve the Article Data through REST API.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: REST Web Services API availability in OTRS

Post by reneeb »

You have to pass the "AllArticles" parameter when you call the TicketGet endpoint https://github.com/OTRS/otrs/blob/maste ... Get.pm#L77
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
akshattandon
Znuny newbie
Posts: 20
Joined: 15 May 2018, 08:03
Znuny Version: 6.0.5
Real Name: Akshat
Company: None

Re: REST Web Services API availability in OTRS

Post by akshattandon »

Awesome, It worked !!
Post Reply