tag:help.lighthouseapp.com,2008-09-20:/discussions/api-developers/2003-attaching-image-using-apiLighthouse: Discussion 2014-11-03T15:24:13Ztag:help.lighthouseapp.com,2008-09-20:Comment/349444202014-10-14T16:26:14Z2014-10-14T16:26:14ZAttaching image using API<div><p>Hi Simon,.</p>
<p>You can send a file upload to ticket[attachment]</p></div>Tiger Teamtag:help.lighthouseapp.com,2008-09-20:Comment/349444202014-10-14T16:41:59Z2014-10-14T16:41:59ZAttaching image using API<div><p>I want to attach image via API.<br>
Please explain in more detailed.</p></div>Simon Petriktag:help.lighthouseapp.com,2008-09-20:Comment/349444202014-10-14T17:40:31Z2014-10-14T17:40:31ZAttaching image using API<div><p>Hey Simon,</p>
<p>It depends on the programming language you are using, but here
is a simple example with <code>curl</code>:</p>
<pre>
<code>curl -X PUT \
-H "X-LighthouseToken: API_KEY" \
-F "ticket[body]=Adding an attachment" \
-F "ticket[attachment][]=@screenshot.png" \
https://ACCOUNT.lighthouseapp.com/projects/XXXXX/tickets/XXXX.json</code>
</pre>
<p>The only caveat is that you need to modify the body, or any
other field aside "attachment" to create a new comment. Simply
attaching the file itself with no other change won't work.</p>
<p>I used the API key method of authentication, but of course the
user/password method would work as well.</p>
<p>Let me know if you have any question.</p></div>Julientag:help.lighthouseapp.com,2008-09-20:Comment/349444202014-10-21T19:12:18Z2014-10-21T19:12:18ZAttaching image using API<div><p>Simon -</p>
<p>Let us know if you have any other questions about using the API
for attachments.</p>
<p>Thanks,<br>
Nicole</p></div>Nicole