Figured out the agent number field is "staffId". Still need to know the due date field.

    This doesn't work:
    'duedate' => '2023-09-15',

    this is straight out of the api_ticket_create.php file with some added array fields. This code does create the new ticket with the correct staffid, topicID and companyid. However, it doesn't accept the due date. Instead, it inserts a date 2 days from the date the ticket is created.

    $data = array(
    'name' => 'new tickets',
    'email' => 'contact@xxxxxx.org',
    'staffId' => 8,
    'topicId' => 21,
    'duedate' => '2023-09-15',
    'subject' => 'Test API message',
    'message' => 'This is a test of the osTicket API',
    'companyid' => '267',
    'ip' => $_SERVER['REMOTE_ADDR'],
    'attachments' => array(),
    );

      time didn't work
      'duedate' => '2023-09-15 00:00:00',

      cherrie

      This is on my list to test but unfortunately I have a million other things to do before this. I will get there in time. Looking at the code it should be possible but I’m not 100% certain as we have allowed fields, etc. depending on how the ticket is being created.

      Cheers.

      6 days later

      Does the script work otherwise?
      (if you do not try to set the duedate)

        2 months later

        Hi. Bumping up to see if there has been any progress on this issue.

          added duedate to the line and still doesn't work

          3 months later

          Can you please clarify? Where in the api.tickets.php should I add the line?

            cherrie

            I said above, "Copy this line [insert link with specific line to copy] and paste it in the api case below it." This means copy the line in the referenced link and paste it in the api switch case (which is below the line you are copying).

            Cheers.