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
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).
Any ideas that could help me sort this issue?
Hi Abhilash,
As what I summarized in this thread:
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
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
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156