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,...
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
    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

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 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans