Configuring Graph Requests and using Response Getters
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- php
- Ambito
- documentation
Direzione di ricerca
Inizia esaminando gli esempi di request-builder del PHP SDK per gli endpoint /me/drive/root/children e /drives/{id}, insieme alla documentazione degli oggetti di risposta. Documenta come i percorsi degli endpoint HTTP vengono mappati sulle chiamate PHP e come ispezionare i campi restituiti e i dati annidati. Il lavoro è completato quando la guida copre sia la traduzione delle requests sia l’accesso alle responses, con esempi corrispondenti alle query segnalate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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": "Martin@jobcop.co.uk",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"displayName": "Martin Thorburn"
}
},
"owner": {
"user": {
"email": "Martin@jobcop.co.uk",
"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?
- Lingua principale
- PHP
- Stelle
- 669
- Fork
- 150
- Merge medio
- 15h 21m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-php
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 commenti ·
-
bug: metadata type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 commenti ·
-
status:waiting-for-triage type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 commenti · 4 reazioni ·
-
status:waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-php#1800 · 1 reazione ·
-
Now Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
Tutte le issue di microsoftgraph/msgraph-sdk-php
Issue simili
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
-
Перевод устарел
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100