How to add an attachment in CRM from external another source through API?
Please help me with this.
How to add an attachment in CRM from external another source through API?
Please help me with this.
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
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156