Auflisten von Fotos
Artikel
07/18/2022
2 Minuten Lesedauer
3 Mitwirkende
In diesem Artikel
Namespace: microsoft.graph
Mit dieser API können Sie eine Liste von Objekten des Typs profilePhoto abrufen.
Berechtigungen
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen .
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
Group.ReadBasic.All, Group.Read.All, Group.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
Group.ReadBasic.All, Group.Read.All, Group.ReadWrite.All
HTTP-Anforderung
GET /groups/{id}/photos
GET /users/{id | userPrincipalName}/joinedGroups/{id}/photos
Optionale Abfrageparameter
Diese Methode unterstützt die OData-Abfrageparameter zur Anpassung der Antwort.
Name
Typ
Beschreibung
Authorization
string
Bearer {token}. Erforderlich.
Anforderungstext
Geben Sie für diese Methode keinen Anforderungstext an.
Antwort
Wenn die Methode erfolgreich verläuft, werden der Antwortcode 200 OK und eine Sammlung von profilePhoto -Objekten im Antworttext zurückgegeben.
Beispiel
Anforderung
Nachfolgend sehen Sie ein Beispiel der Anforderung.
GET https://graph.microsoft.com/v1.0/groups/{id}/photos
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var photos = await graphClient.Groups["{group-id}"].Photos
.Request()
.GetAsync();
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var photos = await graphClient.Groups["{group-id}"].Photos
.Request()
.GetAsync();
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
const options = {
authProvider,
};
const client = Client.init(options);
let photos = await client.api('/groups/{id}/photos')
.get();
const options = {
authProvider,
};
const client = Client.init(options);
let photos = await client.api('/groups/{id}/photos')
.get();
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/{id}/photos"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphProfilePhoto *profilePhoto = [[MSGraphProfilePhoto alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/{id}/photos"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphProfilePhoto *profilePhoto = [[MSGraphProfilePhoto alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ProfilePhotoCollectionPage photos = graphClient.groups("{id}").photos()
.buildRequest()
.get();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ProfilePhotoCollectionPage photos = graphClient.groups("{id}").photos()
.buildRequest()
.get();
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
result, err := graphClient.GroupsById(&groupId).Photos().Get()
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
groupId := "group-id"
result, err := graphClient.GroupsById(&groupId).Photos().Get()
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
Antwort
Nachfolgend sehen Sie ein Beispiel der Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"height": 99,
"width": 99,
"id": "id-value"
}
]
}