Versione API Graph

Album associati ai gruppi

Gli album fotografici creati per un gruppo.

Lettura

Restituisce un array di Album nel gruppo.

Tool di esplorazione per la API Graph
GET /v19.0/{group-id}/albums HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{group-id}/albums',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{group-id}/albums",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/albums",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/albums"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Requisiti

RequisitoDescrizione

Analisi dell'app

La tua app deve essere approvata per la funzione API Groups.

Installazione dell'app

L'app deve essere installata sul gruppo.

Token

Un token d'accesso dell'utente.

Campi

Quando richiedi i seguenti campi dell'Album attraverso l'espansione dei campi, saranno inclusi solo gli utenti che hanno concesso alla tua app l'autorizzazione groups_access_member_info:

  • from
  • likes
  • reaction

Pubblicazione

POST /v19.0/{group-id}/albums HTTP/1.1
Host: graph.facebook.com

name=%7Balbum-name%7D&message=%7Balbum-description%7D&privacy=%7Bprivacy-settings%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}/albums',
    array (
      'name' => '{album-name}',
      'message' => '{album-description}',
      'privacy' => '{privacy-settings}',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{group-id}/albums",
    "POST",
    {
        "name": "{album-name}",
        "message": "{album-description}",
        "privacy": "{privacy-settings}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("name", "{album-name}");
params.putString("message", "{album-description}");
params.putString("privacy", "{privacy-settings}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/albums",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"name": @"{album-name}",
  @"message": @"{album-description}",
  @"privacy": @"{privacy-settings}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/albums"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Requisiti

Tipo di requisitoDescrizione

Analisi dell'app

L'app deve essere approvata per le seguenti autorizzazioni e funzioni di accesso: (clicca per espandere)

Autorizzazioni di accesso

publish_to_groups

Funzionalità

API Groups

Installazione dell'app

L'app deve essere installata sul gruppo.

Token

Un token d'accesso dell'utente per un utente che è membro del gruppo in cui l'app è installata.

Autorizzazioni

L'utente deve concedere alla tua app questa autorizzazione:

publish_to_groups

Campi

Parametro Descrizione Tipo

name

Il nome dato all'album. Campo obbligatorio.

string

message

La descrizione dell'album, che sarà visualizzata come messaggio di stato nel Feed.

string

Risposta

Nome Descrizione Tipo

id

L'ID dell'album appena creato.

string

Eliminazione

Questa operazione non è supportata.

Aggiornamento

Questa operazione non è supportata.