Php curl
Added by Prasanna J over 10 years ago
Hi,
First of all I am Toddler in php.
I need a help on API form for php. We have a page with html, after filling this form when we submit the ticket has to be created under CRM.
I have done that part and its working fine. The problem is I would like add an attachment for that form. If I attach a file then the attachment has to attached to the Ticket.
I have check several blocks and i am not able to understand and i got the below steps.
1) Get an Upload URI GET /Ticket/upload
Method: GET
URL: https://ss.parature.com/api/v1/6/5/upload/?_token_=TOKEN
Output Href
<Upload href="https://ss.parature.com/api/v1/6/5FileManagement/Upload/?token=&UploadID="/>
2) Upload the file POST /FileManagement/Upload/
Method: POST
The URI to use is returned in the href attribute when retrieving the Upload URI.
URL: https://ss.parature.com/api/v1/6/5FileManagement/Upload/?token=&UploadID=
---------------------------------------------------------------------------------------------------------------------
up to here I done. From here onwards I am not sure how to do coding. Will be really helpful if I get any solution for this.
I need to achieve the below items to attach the file in ticket.
--------------------------------------------------------------------------------------------------------------------------
Include the file in the request body in standard HTTP upload format (RFC 1867).
Then you have to upload the file you want to attach with the ticket.
Run this call! This call will then provide you a GUID.
3. Update the Ticket: Include the GUID returned from the successful upload operation. Example:
<Ticket>
<Ticket_Attachments>
<Attachment>
<Guid>fdcea1e1c3e2493a9dbdb4a322b05165</Guid>
<Name>Tiger.jpg</Name>
</Attachment>
</Ticket_Attachments>
</Ticket>
Thanks in advance.
Thanks
Prasanna
Replies (1)
RE: Php curl
-
Added by Jan Niggemann (redmine.org team member) over 10 years ago
Does this have to do with redmine?