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

Announcements

No record found.

News and Announcements icon
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 2

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

I have the same question (0)
  • Suggested answer
    Filipe Relvas Profile Picture
    Microsoft Employee on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 37

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans