Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to Use PHP to read Dynamics365 table

(0) ShareShare
ReportReport
Posted on by
Just created a Dynamics365 account. I use both PHP and C# to access.
How do I connect and read a table using PHP. From what I see it requires the following:
// Settings for accessing d365 services
$d365_url = 'https://businesscentral.dynamics.com/';
$username = 'xxxxxxxxxx';
$password = 'xxxxxxxxxx';
 
Then
// Creating HTTP request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $d365_url . 'yyyyyyyyy');   //not sure what yyyyyyyy  should be????
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
 
Then
 
// Setting up basic authentication
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, /$username:$password/);
// Executing HTTP request
$response = curl_exec($ch);
curl_close($ch);
 
I end up getting and error:
not a valid cURL handle resource 
 
I think the 'yyyyyyyy' needs to be supplied but I don't know what is valid?
  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,480 Super User 2024 Season 2 on at
    How to Use PHP to read Dynamics365 table
    Hi,

    Use below link to access dynamic CRM with C# code:
    https://www.powerappsmaster.com/post/connect-console-app-with-client-id-and-secret
     
    Use below link to PHP:
     
    Thank You,
    Pradeep Rai.

    Please mark this as VERIFIED. if it helps you to resolve the query.

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,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans