
I am trying to replicate that API with a portal address like:
https://my-company.crm.dynamics.com/api/data/v9.0/
When you navigate to that URL you get all your entities information thanks to xRM API.
Now If you add the entity plural name like: https://my-company.crm.dynamics.com/api/data/v9.0/roles then you see all the related info to that entity.
Then I thought in creating the same URL accessible from customer portals, so I have created a web template with an AJAX function like:
const subs = location.pathname.substr(location.pathname.indexOf('api')+3, location.pathname.length) + location.search;
fetch('my-company.crm.dynamics.com/.../v9.0' + subs)
.then(response => response.json());
But I realized that whenever I navigate to the new API URL like my-portal.microsoftcrmportals.com/api I get everything is ok. But if I navigate to https://my-portal.microsoftcrmportals.com/api/roles I get error 404.
How would you fix this? Thanks in advance
*This post is locked for comments
I have the same question (0)Hi,
Why do you want to replicatet this when you can retrieve the data using the inbuilt odata feeds?
Check below links-
arpitmscrmhunt.blogspot.com/.../adxstudio-portal-how-to-use-odata.html
community.dynamics.com/.../using-entity-list-as-odata-feed-dynamics-365-portal
Hope this helps.