web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
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?
I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 57 Super User 2025 Season 2

#2
Satyam Prakash Profile Picture

Satyam Prakash 24

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 24

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans