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

Notifications

Announcements

No record found.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans