What ist the correct line for create a new ticket via prtg-api?

I tried http://[server]/api/addticket.htm?username=[myuser]&passhash=[mypasshash]&id=0&subject=Test&assigned=3301&content=contentcontentcontent&priority=3&comment=commentcommentcomment and the system answers "OK", but no new ticket was created.

(0 is the objectid of the main object in sensor-tree) (3301 is the id of a group i've created)


Article Comments

This will work:

http://<prtg-host>/api/addticket.htm?id=new&subject=<subject>&assigned=<group-or-user-id>&priority=<priority-1-to-5>&objectid=0&content=<the-ticket-comment>&username=<username>&passhash=<passhash>

When the creation was successful, PRTG will not return OK, but an integer, resembling the ticket ID.


Aug, 2016 - Permalink

Genius! That works!

Now I can redirect user generated mails to our ticketsystem (text-only) into prtg tickets


Aug, 2016 - Permalink

Nice :)


Aug, 2016 - Permalink

I tried the same code but it just returned "OK".

http://<prtg-host>/api/addticket.htm?id=new&subject=<subject>&assigned=<group-or-user-id>&priority=<priority-1-to-5>&objectid=0&content=<the-ticket-comment>&username=<username>&passhash=<passhash>

I can see the entries from web server log but the ticket was not created.


Jul, 2017 - Permalink

Hi there,

Did you check Tickets | All as well? The code above should work ...I'll check it.
[edit] Just tested, works as expected.


Kind regards,
Stephan Linke, Tech Support Team


Jul, 2017 - Permalink

Hi,

Yes checked for Tickets | All but the ticket is not there. Is there any setting to take note on? The option to enable user to use ticketing system is ON.

The result is OK, if it is working, it should return the ticket id?

Thanks.


Jul, 2017 - Permalink

Correct, it should return the ID of the newly created ticket. Could you post the exact URL you're using, minus host/username/passhash?


Jul, 2017 - Permalink

Hi,

Below is my URL,

http://<host>/api/addticket.htm?id=new&subject=Test&assigned=user.id&priority=1&objectid=0&content=Content&username=user.id&passhash=xxxx

Thanks.


Jul, 2017 - Permalink

Try using 200 as the user ID - does it work then? Does the user ID you're using actually exist?


Jul, 2017 - Permalink

Hi,

200 is working fine. The user ID does exist and ticket system option enabled. Is there any log we can check what is the problem?

Thanks.


Jul, 2017 - Permalink

It works with every user ID, in principle at least. Did you try another user ID as well?
What PRTG version are you currently using?


Jul, 2017 - Permalink

Hi,

My version is 17.3.32.2339+. I tried with multiple user ids and switched objectid as well, but it still same.


Jul, 2017 - Permalink

Are you logged in with the PRTG Administrator or a different one?


Jul, 2017 - Permalink

Hi, Below is my step,

Run API Url on browser -> returned "OK" -> Login as prtgadmin and check [Tickets]->[All Tickets]->[All] -> Ticket was not created.

I used prtgadmin account to run the API and assign to user (even tried assign to prtgadmin) with PRTG Admin rights.

Thanks


Jul, 2017 - Permalink

Is your PRTG webinterface available via internet? Could you post the URL and some credentials
so I can test it myself? Of course these replies won't be published, no worries.


Jul, 2017 - Permalink

Could you provide me with a password as well so I can check the tickets? Thanks!


Jul, 2017 - Permalink

Works completely fine when using the user ID instead of the username (in this case, it's assigned=2221). The ticket ID is returned properly as well then. So please make sure to use the user's ID for the assigned parameter, not his actual username.


Jul, 2017 - Permalink

How do I check the user ID?


Jul, 2017 - Permalink

Open up Setup | System Administration | User Accounts and click any account.
Their ID will be visible in the addressbar.


Jul, 2017 - Permalink