web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to get attachment content of post and comment in dynamics 365 using crm sdk

(0) ShareShare
ReportReport
Posted on by 10

activityfileattachment and fileattachment entities, do have attachment information associated with the post but i am not able to find it's filecontent although activityfileattachment does have filecontent attribute but it has some GUID in it and there is no information on how to fetch attachment content using that GUID.

1)Here is documentation snap shot of that attribute filecontent of activityfileattachment (https://i.stack.imgur.com/hPl98.png)

2)This is that attachment object i am getting from activityfileattachment entity which has all details except attachment content which i want to download. (https://i.stack.imgur.com/SQXT2.png)

Please Let me know how can i get content of attachment using this GUID given in file content.
If not how can i get/download  file content uploaded in a post.

I have the same question (0)
  • Verified answer
    Ray Profile Picture
    1,537 on at

    Hi Akshar,

    You can use the OData API to get the file content.

    Lest say the id of activityfileattachment is 36c7fe40-25fe-1fc1-89d3-3b796c7bd5b1, then the API link should be https://dynamicsdomain/api/data/v9.1/activityfileattachments(36c7fe40-25fe-1fc1-89d3-3b796c7bd5b1)/filecontent. Replace the bold font with your actual parameter.

  • Akshar Ganatra Profile Picture
    10 on at

    Yes, This worked .

    Thanks.

  • Akshar Ganatra Profile Picture
    10 on at

    Is there any way we can search Content of these attachments using some keyword becasue using relevance API i am able to search attachment content for email notes etc (entities having attachments) but for post's attachments i need to query activityfileattachments content which is not searchable from relevance API.

  • Ray Profile Picture
    1,537 on at

    Can you provide the query conditions you want to use? In most case filename should be enough.

  • Akshar Ganatra Profile Picture
    10 on at

    I want to search a key if its present in any  post's any attachments.

    Currently i am using relevance API Post Method  {organizationUrl}/api/search/v1.0/query

    with json body as

    {  

     "search": "Andrew"

    }

    but this query works for attachments except attachments of post and comments .

    so, as we now know how to fetch content of a particular posts or comments attachments

    dynamicsdomain/.../filecontent

    is there any way we can search the content of it as relevance api's search is not able to search for content of activityfileattachments.

  • Ray Profile Picture
    1,537 on at

    My guess is no. Since the filecontent is a binary field and may get more than 10MB, I do not think it is a good idea search this in a text way. You may create a support ticket to microsoft.

  • Akshar Ganatra Profile Picture
    10 on at

    Alright thanks Ray!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans