REST Web Services API availability in OTRS

English! place to talk about OTRS development, programming and coding

Moderator: tto

Post Reply
akshattandon
OTRS newbie
Posts: 10
Joined: 15 May 2018, 08:03
OTRS Version?: 6.0.5
Real Name: Akshat
Company: None

REST Web Services API availability in OTRS

Post by akshattandon » 15 May 2018, 23:45

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
OTRS guru
Posts: 4683
Joined: 13 Mar 2011, 09:54
OTRS Version?: 3.3.x
Company: Perl-Services.de
Contact:

Re: REST Web Services API availability in OTRS

Post by reneeb » 16 May 2018, 08:47

You have to pass the "AllArticles" parameter when you call the TicketGet endpoint https://github.com/OTRS/otrs/blob/maste ... Get.pm#L77
Perl / OTRS development: http://perl-services.de
Free OTRS add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de

akshattandon
OTRS newbie
Posts: 10
Joined: 15 May 2018, 08:03
OTRS Version?: 6.0.5
Real Name: Akshat
Company: None

Re: REST Web Services API availability in OTRS

Post by akshattandon » 17 May 2018, 23:14

Awesome, It worked !!

Post Reply