How do I use uploaddoc parameter when using the Create Task method of the Project API?

How do I use uploaddoc parameter when using the Create Task method of the Project API?

I'm trying to create a task and attach a file using the Create Task method of the Project API.

The uploaddoc parameter is of type "file".  There is no sample code on how to use the uploaddoc parameter.

I assume the uploaddoc file parameter is looking for a binary file, but I'm unsure how to specify this in the code.

I've been able to use other methods of the API correctly.

The code below successfully creates the new task and completes without error, but there is no file attached to the task. 

Please provide examples of how to use the uploaddoc parameter.

Thank you.

FileName := CHSDirectory . "HITRUST Templates\" . FileName
URL := "https://projectsapi.zoho.com/restapi/portal/99999999/projects/" . ProjectID . "/tasks"
Data := URL . "/?authtoken=999999" . "&name=" . TaskName

ADODBObj := ComObjCreate("ADODB.Stream")
ADODBObj.Type := 1
ADODBObj.Open()
ADODBObj.LoadFromFile(FileName) ;Load the contents of the binary file into the Stream
 
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("POST",Data)
WebRequest.SetRequestHeader("uploaddoc", FileName, "multipart/form-data")
WebRequest.Send(ADODBObj.Read())

ADODBObj.Close()
JSONString := WebRequest.ResponseText
MsgBox Response  - %JSONString%

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方