Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to push attachment in CRM 2015 from other source though web api

Posted on by 125

How to add an attachment in CRM from external another source through API?

Please help me with this.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to push attachment in CRM 2015 from other source though web api

    Hi,

    You can use Odata API to create notes with attachment in CRM.

    Request URL - CRMBaseURL/XRMServices/2011/OrganizationData.svc/AnnotationSet

    Request Body

    {

    "subject":"Test Subject",

    "notetext":"<span style=\'font-size:22px;\'><span style=\'font-family:Arial,Helvetica,sans-serif;\'>Test Details</span></span>\n\n',

    "filename":"File.txt",

    "isdocument": true,

    "documentbody":"TU0gVGV4dCBGaWxl",

    "objectid_lead@odata.bind" : "/leads(87fb9831-1573-ea11-a811-000d3a4ed4e6)"

    }

    documentbody - you will have to convert your image into base64string.

    You can generate API code using Rest builder tool download from below link

    github.com/.../releases

    Download managed solution zip file and import into your crm instance.

    Now only thing you will have to investigate is authentication, since you want to execute this code from external source you will have to do research on authetication part.

    Options 2 - Create your own custom web service and expose this web service to external source. From web service code you use organization service c# code to create notes in CRM. You will find the sample code in sdk.

    If found helpful, Please mark my answer verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans