GlpiaddTicketDocument » History » Version 7

walid, 05/06/2010 09:54 AM

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