How to send API request to Dynamics CRM from anonymous user in JavaScript

Irfan Mukhtiar 0 Reputation points
2023-05-04T20:15:40.2466667+00:00

Hi,

I have a marketing form, which is being used on the marketing page, and being sent to different users in different ways to be filled up by using the marketing website.

The form is supposed to fill by anonymous persons who are not login into CRM but whose contact could exist in CRM.

Once they submit the marketing form, I need to check using FORM JS whether their contact exists in CRM using their provided emails, and first and last name, if the contact exists then well and good, else need to create a new contact with the same details.

For this purpose, I need to send the API call to CRM to query data OR create a new record through javascript, but at that time person is anonymous and has access to the FORM using a URL into any browser, so need to authenticate the API call to query into CRM, for this purpose I have created an app into azure and using that app client-id and client-secret to grab the token which is needed to be sent into bearer authentication.

I need help with how can I send a call to Azure to grab the token and then use the token to grab the entity details from CRM.

Any help would be highly appreciated.

Thanks

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,174 questions
{count} votes