Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Event Portal Web API

(0) ShareShare
ReportReport
Posted on by 90

Hello All,

The Event Portal Web API https://xyz.microsoftcrmportals.com/EvtMgmt/api/v2.0/events/readable_Event_Id is not working in our dev environment.

the api endpoint used is the event portal URL with a trailing end /

As part of testing purpose we changed the flag in PortalAPI, is this the reason for the event portal Web API to be not working.

Also we hosted the event portal on our dev dynamics 365 environment with  useRestStack: false, and emApplicationtoken: '', and also on localhost

{% assign bypassTokenVerification = true %}
Could you please suggest what has to be done for the WebAPI to be functional.
Regards
Abhilash
  • Tiago Freitas Profile Picture
    Tiago Freitas 80 on at
    RE: Event Portal Web API

    Hi clofyMao,

    I have set up a custom API (called Open Events) to fetch events based on a custom field filter.

    https://myorg.svc.dynamics.com/EvtMgmt/api/v2.0/events/openevents?emApplicationtoken=TNI_zGrX1z0ytHaFiFPkE4

    This API is placed under the OOB Events page, as you can see on the URL.

    When I try to reach this API using the deprecated method, I'm able to retrieve the JSON with records. However, when I try to reach using the API 2.0 (with authentication via Azure B2C), I get a "Not Found" response.

    I'm running tests using Postman, I managed to configure the correct headers and emApplicationToken parameter.

    The weird part is, when I try to reach the OOB Events API that retrieves Published Events, it works perfectly and retrieves results.

    https://myorg.svc.dynamics.com/EvtMgmt/api/v2.0/events/published?emApplicationtoken=TNI_zGrX1z0ytHaFiFPkE4xiwRjyj0SXPyQqNLz

    So basically, with the same request structure, I can hit the OOB Events API, but I cannot hit my custom one.

    This is the structure of my Custom API.

    I set up a Web Page > Page Template > Web Template (where I have a Liquid Template with my custom FetchXml).

    pastedimage1632994398515v1.png

    pastedimage1632994523867v2.png

    pastedimage1632994563058v3.png

    Any ideas that could help me sort this issue?

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Event Portal Web API

    Hi Abhilash,

    As what I summarized in this thread:

    https://community.dynamics.com/365/marketing/f/dynamics-365-for-marketing-forum/410512/hosting-event-portal-on-dynamics-365/

    The URL pattern you are using is style of new Event Management Public API.

    To test deprecated Event Management Portal API locally, in addition to enabling the bypassTokenVerification property to true in PortalAPI, we need to also create a new site setting record for local development: it will allow localhost to get access to Event Portal Web API.

    Name: HTTP/Access-Control-Allow-Origin

    Value: http://localhost:4200

    pastedimage1607579378952v1.png

    In conclusion:

    1. In Portal Management, change the flag in PortalAPI and create a new site setting.

    2. In environment.ts,

    apiEndpoint: [PortalURL/

    useRestStack: false

    emApplicationtoken: ''

    3. To read a specific event, (demo d365mkt is readable id of event)

    pattern of the deprecated Event Management Portal API:

    https://company.microsoftcrmportals.com/api/events/event/?readableEventId=d365mkt

    pattern of the new Event Management Public API:

    https://abcxxx.svc.dynamics.com/EvtMgmt/api/v2.0/events/d365mkt?emApplicationtoken=32NDwxMFHxxx

    Regards,

    Clofly

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans