We are getting set up for the new season and we would like to do a ticket data dump and create over 100 tickets. Each new ticket will have all the info needed to create a ticket.

Currently, we create one ticket at a time. This time around, we would like to upload the data. Is this possible?

You would have to write a custom script that utilizes the open ticket api.

5 days later

The example is a zip file with one 5kb .php file in it... I'm not sure why you would think that it has a virus.

Assuming that you mean this page:
http://tmib.net/using-the-osticket-1-8-1-2-api/

and the ost-api-example.zip. Perhaps your antivirus software is giving you a false positive?

5 days later

I'm following the code from here:
https://github.com/sharmaghanshyam/Osticket-Creation-API
https://github.com/osTicket/osTicket/blob/develop/setup/doc/api/tickets.md

I was able to create the API key fine.
I'm confused as to the URL. The api folder doesn't have a json file. Should I change it to the cron.php file instead?

Also, regarding the data section:
program - is this a required field? I don't use this field in the regular ticket form.
status - is this a required field? I don't collect phone numbers.

Need field names for data section for:
- Assign to (Agent)
- priority level (if not submitted, is this automatically "normal")
- CompID (new field that I added to regular form. where do I find the field name in database)

program - is this a required field?

I cannot tell you if your custom "program" field is required. It is not a default osTicket field.

status - is this a required field?

Again, I'm can't tell you about this field as it also appears to be a custom field.

  • Assign to (Agent)

The open ticket api cannot assign tickets at this time.

  • priority level (if not submitted, is this automatically "normal")

The field name is priority, it expects a number that you want the priority to be.

  • CompID (new field that I added to regular form. where do I find the field name in database)

When you added this field you created the variable for it. Admin panel -> Manage -> Forms -> Ticket Details, see the Variable field for the field you added.

I used only the bare required fields (email, name, subject and message) and am getting error:
Unable to create ticket

Not sure how to move forward.

I've never tried to open a ticket with that little information.

What version of osTicket are you running?
Does the user exist?
Have you looked at your php error log to see if there are any errors?

No related error on the osticket system log.

I'm on v1.10

yes, user exists.

Has anyone succesfully used the API?

I didn't ask about the osTicket system logs. I asked about your PHP error log. It is a log file stored by your webserver.

Yes, people have successfully used the API.

Write a Reply...