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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 208 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 80

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans