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

  • Suggested answer
    Filipe Relvas Profile Picture
    on at
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans