Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Create & Update Events through API

(0) ShareShare
ReportReport
Posted on by

Hello,

We have a custom web application that manage events and we try to make it sync with our D365 Marketing Event management system.

Events are created and managed in our custom web app.

Through API, we can retrieve all events of D365 :

GET https://xxx.dynamics.com/api/data/v9.2/msevtmgt_events?$select=msevtmgt_eventid,msevtmgt_name&$count=true

We can also retreive single event (filter by eventid) :

GET https://xxx.dynamics.com/api/data/v9.2/msevtmgt_events?$filter=(msevtmgt_eventid eq xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
or
GET https://xxx.dynamics.com/api/data/v9.2/msevtmgt_events(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

But we are unable to create or update an event :

PATCH https://xxx.dynamics.com/api/data/v9.2/msevtmgt_events(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
data = {
  "msevtmgt_name":"Test",
  "tc_venue":"My best place"
}

(same with data in JSON or form-data format)

We got this error :

The requested resource does not support http method 'PATCH'

And with POST method :

Unmapped Request found, PathTemplate:~/entityset/key, HtppVerb:POST

We try also through webhook :

POST https://xxxxxxxxxxxxxx.svc.dynamics.com/EvtMgmt/api/v2.0/events/{readableEventId}?emApplicationtoken=xxxxxxxxxx
data = {
    "eventName":"Test"
}

And we got 404 error... (same with PATCH method)

Maybe someone has an idea to help us ?

Thanks in advance,

Serge

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Create & Update Events through API

    Hi databird,

    I created a web resource and insert it into form to test:

    <html>
    <head>
    <title>test</title>
    <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
    <meta><meta><meta><meta><meta><meta><meta></head>
    <body onload="updateEvent()" style="overflow-wrap: break-word;">
    <div>
    test
    </div>
    </body>
    <script type="text/javascript">

    function updateEvent(){
    data = {
    "msevtmgt_name":"Test",
    "msevtmgt_maximumeventcapacity":1
    }
    var uri = "">xxxxxxxx.crm.dynamics.com/.../msevtmgt_events(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)";
    var request = new XMLHttpRequest();
    request.open("PATCH", uri , true);
    request.setRequestHeader("OData-MaxVersion", "4.0");
    request.setRequestHeader("OData-Version", "4.0");
    request.setRequestHeader("Accept", "application/json");
    request.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    request.onreadystatechange = function () {
    if (request.readyState === 4) {
    console.log("success");
    }
    }
    request.send(JSON.stringify(data));
    }
    </script>
    </html>

    And it can work:

    pastedimage1634198554299v1.png

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

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

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

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans