Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Adding the email to the existing queue using Web API in the C# code

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I am using MS CRM onpremise 8.2.

I have a requirement to create an email and add it to the existing Queue in CRM using web API. Basically, the 3rd party system is calling the CRM API to create the email and add it to the specific queue. Can you please share the C# code for it as we don't use the Azure.

Thanks

Amit

  • Suggested answer
    RE: Adding the email to the existing queue using Web API in the C# code

    Hello Amit,

    Hope all is well.

    I would suggest starting by playing around with the publicly available C# samples for the WebAPI. Even though you are using Dynamics CRM On-Prem v8.2 most of them are still applicable with the difference being the Connection String and Auth method.

    Samples:

    - docs.microsoft.com/.../web-api-samples-csharp

    - docs.microsoft.com/.../basic-operations-csharp

    - github.com/.../C#

    Connections Strings:

    docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect

    To create an email (or any other entity of sorts) you will need to perform a POST request againt the /api/data/v8.2/emails by passing the required parameters to fill in the corresponding attributes.

    After creating the email you will need to get the GUID for both the Email and the queue you want to send it to. With those two values you can either use the AddToQueue WebAPI action (might be easier) or manually creating a QueueItem.

    AddToQueue Action:

    docs.microsoft.com/.../addtoqueue (Source Queue wouldn't be necessary here).

    Example for the AddToQueue body:

    {"entity":{"@odata.type":"Microsoft.Dynamics.CRM.queue","queueid":"<queueguid>"},"Target":{"@odata.type":"Microsoft.Dynamics.CRM.email","activityid":"<emailguid>"}}

    Hope this helps :)

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans