opendns / autotask-php

A PHP SOAP wrapper for the Autotask Web Service API
BSD 3-Clause "New" or "Revised" License
61 stars 33 forks source link

Unable to fetch attachments from autotask #15

Closed adilk90 closed 8 years ago

adilk90 commented 9 years ago

I have fetched contracts, contacts, resource and tickets from autotask succesfully. Now, I need to fetch the attachment for tickets, I have used the ticket id as parentId for fetching the AttachmentInfo but when I try to fetch the Attachment data using the AttachmentInfo id it gives me error in the response.

Unable to cast object of type 'autotask.web.services.API.Attachment' to type 'autotask.web.services.API.Entity

Can anyone help me in this ?

reynolek commented 9 years ago

Unfortunately I haven't worked with attachments -- there were some previous issues that people opened around attachments, so hopefully someone can assist!

reynolek commented 8 years ago

This is a super late comment, but I believe I added the ability to create attachments a while back -- have you given that a shot? Did it work for you?

reynolek commented 8 years ago

closing, feel free to re-open if you are still having issues.

Dunnestein commented 6 years ago

For anyone landing on this thread searching on the error, like I did:

Don't use Entity Attachment for querying on AttachmentID, but use Entity AttachmentInfo instead. AttachmentInfo will return the attachment object. Feed the return object in the getAttachment function as the input parameter to actually receive the attachment (data and info).