Versione API Graph

Feed del gruppo

Post di proprietà di un gruppo, inclusi aggiornamenti di stato e link.

Lettura

Restituisce un array di post sul gruppo.

Tool di esplorazione per la API Graph
GET /v19.0/{group-id}/feed 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}/feed',
    '{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}/feed",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/feed",
    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}/feed"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Requisiti

Tipo di 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 o della Pagina.

Note

  • I parametri since e until si applicano al campo updated_time.

Pubblicazione

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

message=This+is+a+test+message
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}/feed',
    array (
      'message' => 'This is a test message',
    ),
    '{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}/feed",
    "POST",
    {
        "message": "This is a test message"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("message", "This is a test message");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/feed",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/feed"
                                      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

Funzioni

API Groups

Installazione dell'app

L'app deve essere installata sul gruppo.

Token

Token d'accesso dell'utente di un membro del gruppo.

Autorizzazioni

L'utente deve concedere all'app le autorizzazioni seguenti:

publish_to_groups

Campi

NomeTipoDescrizione

message

string

Il corpo principale del post, noto anche come messaggio di stato. Deve essere fornito link o message.

link

string

L'URL di un link da allegare al post. Deve essere fornito link o message. I campi aggiuntivi associati a link sono mostrati di seguito.

Risposta

In caso di esito positivo, riceverai una risposta con le seguenti informazioni. Questo endpoint supporta anche la modalità RAW e può restituire immediatamente tutti i campi restituiti dalle operazioni di lettura.

Nome Descrizione Tipo

id

L'ID del post appena creato

string

Aggiornamento

Questa operazione non è supportata.

Eliminazione

Questa operazione non è supportata.