GlpiaddTicketDocument » History » Version 5

« Previous - Version 5/11 (diff) - Next » - Current version
remi, 09/13/2009 09:25 AM
describe base64 option


Methods > glpi.addTicketDocument

Add a document to a existing ticket if the authenticated user can edit it.

input a hastable

  • help option to get usage information
  • ticket : ID of the ticket
  • uri : of the document to be uploaded
  • name : of the document
  • comment : of the document
  • base64 : content of the document base64 encoded string (version 0.4.0)

base64 and uri cannot be set together. base64 also requires name (filename for extension check)

return a hastable if succed (as for glpi.getTicket)
  • fields of glpi_tracking
  • followups an array of hasble : fields of glpi_followups

Call example

$ php testxmlrpc.php --session=j4mp77bmqu428ff38gufl3fvi3 --method=glpi.addTicketDocument \
   --ticket=16 --uri=http://download.foo.com/screenshoot.jpg 
+ Calling 'glpi.addTicketDocument' on http://localhost//glpi072/plugins/webservices/xmlrpc.php?session=j4mp77bmqu428ff38gufl3fvi3
+ Response: Array
(
    [id] => 16
    [entities_id] => 1
    [name] => Need help
    [date] => 2009-08-25 10:30:50
    [closedate] => 
    [date_mod] => 2009-08-25 10:35:21
    [status] => new
    [users_id] => 6
    [users_id_recipient] => 6
    [groups_id] => 0
    [users_id_assign] => 0
    [suppliers_id_assign] => 0
    [groups_id_assign] => 0
    [itemtype] => 0
    [items_id] => 0
    [content] => I can't send a mail
    [urgence] => 3
    [impact] => 3
    [priority] => 3
    [user_email] => 
    [use_email_notification] => 0
    [realtime] => 16
    [ticketscategories_id] => 1
    [cost_time] => 0.0000
    [cost_fixed] => 0.0000
    [cost_material] => 0.0000
    [followups] => Array
        (
            [0] => Array
                (
                    [id] => 37
                    [date] => 2009-08-25 14:15:05
                    [users_id] => 6
                    [content] => New document : Document ticket 16
                )

            [1] => Array
                (
                    [id] => 31
                    [date] => 2009-08-25 10:35:21
                    [users_id] => 6
                    [content] => a new message
                )
        )
)

$ php testxmlrpc.php --session=5hkf27tuddubh23hddekdl9pd7 --method=glpi.addTicketDocument \
   --ticket=15 --name=cloud.png \
   --base64=/usr/share/pixmaps/backgrounds/cosmos/cloud.jpg
+ Calling 'glpi.addTicketDocument' on http://localhost//glpi072/plugins/webservices/xmlrpc.php?session=5hkf27tuddubh23hddekdl9pd7
+ Response: Array
(
    [id] => 15
    [entities_id] => 1
    [name] => Cannot authenticated
    [date] => 2009-06-01 10:04:00
    [closedate] => 
    [date_mod] => 2009-09-13 09:14:45
    [status] => plan
    [users_id] => 2
    [users_id_recipient] => 2
    [groups_id] => 1
    [users_id_assign] => 0
    [suppliers_id_assign] => 0
    [groups_id_assign] => 0
    [itemtype] => 1
    [items_id] => 1
    [content] => Cannot authenticated on GLPI
See attached screenshoot.
    [urgence] => 3
    [impact] => 3
    [priority] => 3
    [user_email] => 
    [use_email_notification] => 0
    [realtime] => 15
    [ticketscategories_id] => 1
    [cost_time] => 0.0000
    [cost_fixed] => 0.0000
    [cost_material] => 0.0000
    [followups] => Array
        (
            [0] => Array
                (
                    [id] => 27
                    [date] => 2009-09-13 09:14:45
                    [users_id] => 2
                    [content] => New document : cloud.png
                )
        )
)