GlpiaddTicketDocument » History » Version 5

remi, 09/13/2009 09:25 AM
describe base64 option

1 1 remi
h1. [[En_devguide#Provided-Methods|Methods]] > glpi.addTicketDocument
2 1 remi
3 1 remi
Add a document to a existing ticket if the authenticated user can edit it.
4 1 remi
5 1 remi
*input* a hastable
6 1 remi
7 1 remi
* *help* option to get usage information
8 1 remi
9 4 remi
* *ticket* : ID of the ticket
10 2 remi
* *uri* : of the document to be uploaded
11 2 remi
* *name* : of the document 
12 2 remi
* *comment* : of the document
13 5 remi
* *base64* : content of the document base64 encoded string (version 0.4.0)
14 1 remi
15 5 remi
base64 and uri cannot be set together. base64 also requires name (filename for extension check)
16 5 remi
17 5 remi
18 1 remi
*return* a  hastable if succed (as for [[glpi.getTicket]])
19 1 remi
* fields of *glpi_tracking* 
20 1 remi
* *followups* an array of hasble : fields of *glpi_followups*
21 1 remi
22 1 remi
Call example
23 1 remi
<pre>
24 3 remi
$ php testxmlrpc.php --session=j4mp77bmqu428ff38gufl3fvi3 --method=glpi.addTicketDocument \
25 3 remi
   --ticket=16 --uri=http://download.foo.com/screenshoot.jpg 
26 2 remi
+ Calling 'glpi.addTicketDocument' on http://localhost//glpi072/plugins/webservices/xmlrpc.php?session=j4mp77bmqu428ff38gufl3fvi3
27 1 remi
+ Response: Array
28 1 remi
(
29 1 remi
    [id] => 16
30 1 remi
    [entities_id] => 1
31 1 remi
    [name] => Need help
32 1 remi
    [date] => 2009-08-25 10:30:50
33 1 remi
    [closedate] => 
34 1 remi
    [date_mod] => 2009-08-25 10:35:21
35 1 remi
    [status] => new
36 1 remi
    [users_id] => 6
37 1 remi
    [users_id_recipient] => 6
38 1 remi
    [groups_id] => 0
39 1 remi
    [users_id_assign] => 0
40 1 remi
    [suppliers_id_assign] => 0
41 1 remi
    [groups_id_assign] => 0
42 1 remi
    [itemtype] => 0
43 1 remi
    [items_id] => 0
44 1 remi
    [content] => I can't send a mail
45 1 remi
    [urgence] => 3
46 1 remi
    [impact] => 3
47 1 remi
    [priority] => 3
48 1 remi
    [user_email] => 
49 1 remi
    [use_email_notification] => 0
50 1 remi
    [realtime] => 16
51 1 remi
    [ticketscategories_id] => 1
52 1 remi
    [cost_time] => 0.0000
53 1 remi
    [cost_fixed] => 0.0000
54 1 remi
    [cost_material] => 0.0000
55 1 remi
    [followups] => Array
56 1 remi
        (
57 1 remi
            [0] => Array
58 2 remi
                (
59 2 remi
                    [id] => 37
60 2 remi
                    [date] => 2009-08-25 14:15:05
61 2 remi
                    [users_id] => 6
62 2 remi
                    [content] => New document : Document ticket 16
63 2 remi
                )
64 2 remi
65 2 remi
66 2 remi
            [1] => Array
67 1 remi
                (
68 1 remi
                    [id] => 31
69 1 remi
                    [date] => 2009-08-25 10:35:21
70 1 remi
                    [users_id] => 6
71 1 remi
                    [content] => a new message
72 5 remi
                )
73 5 remi
        )
74 5 remi
)
75 5 remi
76 5 remi
$ php testxmlrpc.php --session=5hkf27tuddubh23hddekdl9pd7 --method=glpi.addTicketDocument \
77 5 remi
   --ticket=15 --name=cloud.png \
78 5 remi
   --base64=/usr/share/pixmaps/backgrounds/cosmos/cloud.jpg
79 5 remi
+ Calling 'glpi.addTicketDocument' on http://localhost//glpi072/plugins/webservices/xmlrpc.php?session=5hkf27tuddubh23hddekdl9pd7
80 5 remi
+ Response: Array
81 5 remi
(
82 5 remi
    [id] => 15
83 5 remi
    [entities_id] => 1
84 5 remi
    [name] => Cannot authenticated
85 5 remi
    [date] => 2009-06-01 10:04:00
86 5 remi
    [closedate] => 
87 5 remi
    [date_mod] => 2009-09-13 09:14:45
88 5 remi
    [status] => plan
89 5 remi
    [users_id] => 2
90 5 remi
    [users_id_recipient] => 2
91 5 remi
    [groups_id] => 1
92 5 remi
    [users_id_assign] => 0
93 5 remi
    [suppliers_id_assign] => 0
94 5 remi
    [groups_id_assign] => 0
95 5 remi
    [itemtype] => 1
96 5 remi
    [items_id] => 1
97 5 remi
    [content] => Cannot authenticated on GLPI
98 5 remi
See attached screenshoot.
99 5 remi
    [urgence] => 3
100 5 remi
    [impact] => 3
101 5 remi
    [priority] => 3
102 5 remi
    [user_email] => 
103 5 remi
    [use_email_notification] => 0
104 5 remi
    [realtime] => 15
105 5 remi
    [ticketscategories_id] => 1
106 5 remi
    [cost_time] => 0.0000
107 5 remi
    [cost_fixed] => 0.0000
108 5 remi
    [cost_material] => 0.0000
109 5 remi
    [followups] => Array
110 5 remi
        (
111 5 remi
            [0] => Array
112 5 remi
                (
113 5 remi
                    [id] => 27
114 5 remi
                    [date] => 2009-09-13 09:14:45
115 5 remi
                    [users_id] => 2
116 5 remi
                    [content] => New document : cloud.png
117 1 remi
                )
118 1 remi
        )
119 1 remi
)
120 1 remi
</pre>