Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Configuring Graph Requests and using Response Getters

Offen
#1,600 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Dokumentation
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
documentation

Rechercherichtung

Beginne mit der Überprüfung der Beispiele für den PHP SDK request-builder für die Endpunkte /me/drive/root/children und /drives/{id} sowie der Dokumentation zu den Response-Objekten. Dokumentiere, wie HTTP-Endpunktpfade auf PHP-Aufrufe abgebildet werden und wie zurückgegebene Felder und verschachtelte Daten inspiziert werden. Als erledigt gilt die Aufgabe, wenn die Anleitung sowohl die Übersetzung von Requests als auch den Zugriff auf Responses abdeckt und die Beispiele den gemeldeten Abfragen entsprechen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

type:question

Hi much of the PHP SDK documentation refers to HTTP requests like
https://graph.microsoft.com/v1.0/me/drive/root/children

However when I try to translate this to a Graph query
$result = $graphServiceClient->users()->byUserId("my-user-id")->drive()->root()->children()->get()->wait();

or
$result = $graphServiceClient->users()->byUserId("my-user-id")->drive()->root()->children()->post()->wait();
The SDK tells me root() and children() are not part of the drive request builder.

Is there documentation that shows how to translate HTTP examples like "https://graph.microsoft.com/v1.0/me/drive/root/children" into their PHP equivalent? Or, even better, documentation that shows each of the endpoints for PHP SDK?

Lastly does the PHP SDK, provide a response getter and/or getter for every data field returned from the server? Again, the documentation gives HTTP request examples with JSON response examples,

{
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity",
     "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive?$select=driveType,owner",
     "createdDateTime": "2023-10-22T00:11:21Z",
     "description": "",
     "id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
     "lastModifiedDateTime": "2024-06-27T10:39:41Z",
     "name": "OneDrive",
     "webUrl": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents",
     "driveType": "business",
     "createdBy": {
         "user": {
             "displayName": "System Account"
         }
     },
     "lastModifiedBy": {
         "user": {
             "email": "[email protected]",
             "id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
             "displayName": "Martin Thorburn"
         }
     },
     "owner": {
         "user": {
             "email": "[email protected]",
             "id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
             "displayName": "Martin Thorburn"
         }
     },
     "quota": {
         "deleted": 1030849340,
         "remaining": 1097450601323,
         "state": "normal",
         "total": 1099511627776,
         "used": 1030177113
     }
 }

however, if I use a query like:
$result = $graphServiceClient->drives()->byDriveId('my-drive-id')->get()->wait();

I do not seem to get anything like the documentated json response. Indeed if I use
print_r($result);

all I get is a huge, unformatted object !!

Is there a reponse getter, i.e.
$result->getResponse();

or
$result->getbody();

How would I even try to read the response, or even know what getters to use to access the retuted data ?

I woould really appreciate some help and guidance on this?

Vorherrschende Sprache
PHP
Sterne
669
Forks
149
Ø Merge
6 Std. 31 Min.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoftgraph/msgraph-sdk-php

Alle Issues in microsoftgraph/msgraph-sdk-php

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.