we are creating asp.net website which uses salesfoce webservice api and pull all the information. We have a functionality within the site to display a contact “notes and attachments” which can be downloaded. I have been googling a lot about it, but no use.
Can any one guide me please.?
thanks,
You have to query the
Attachmenttable, either directly:Or indirectly with a subquery:
The actual content of the file is stored in the
Bodycolumn, base64-encoded. You’ll have to decode it and (based on content type?) save as text / binary file, server to the user with the proper content header…The inclusion of the
Bodycolumn slows things down a bit – I’d recommend you skip it initially in the “see attachments related list” part of your ASP application and retrieve them (by Id for example) only when user actually wants it… I’ve noticed that you can get just 1 row returned (initially) withBodyqueried for so if you really want to do it all in one go – check out the documentation forqueryMore()function and make sure your app has processed whole query locator (“cursor” if you’re familiar with that word).So, the above should work both in SOAP API and REST API as long as you can send queries (you didn’t specify which one you use… “webservice api” sounds like you’re limited to using few selected Apex classes exposed as webservice). Additionally REST API has special
retrieve()command.