Versione API Graph

/{object-id}/sharedposts

Questo riferimento descrive il segmento /sharedposts comune a più nodi dell'API Graph. La struttura e le operazioni sono le stesse per ogni nodo. I seguenti oggetti hanno un segmento sharedposts:

  • PagePost
  • Post
  • Utente

Lettura

Autorizzazioni

  • Un token d'accesso utente con l'autorizzazioneuser_posts, per coloro che sono in grado di visualizzare il post dopo aver preso in considerazione le impostazioni sulla privacy. Un post verrà restituito se (a) l'app ha creato il post o (b) il creator del post ha concesso l'autorizzazione user_posts all'app.

Autorizzazioni delle funzioni

NomeDescrizione

Accesso ai contenuti pubblici della Pagina

Si tratta di un'autorizzazione della funzione obbligatoria.

Limitazioni

  • /{album-id}/sharedposts non è disponibile.
  • L'endpoint GET /{photo-id}/sharedposts è diventato obsoleto a partire dalla versione 8.0.

Esempio

Tool di esplorazione per la API Graph
GET /v19.0/{object-id}/sharedposts 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(
    '/{object-id}/sharedposts',
    '{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(
    "/{object-id}/sharedposts",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{object-id}/sharedposts",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{object-id}/sharedposts"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Campi

Una lista di oggetti Post che rappresentano ciascuna delle condivisioni.

Pubblicazione

Non puoi pubblicare le condivisioni di un oggetto utilizzando l'API Graph.

Eliminazione

Non puoi eliminare le condivisioni di un oggetto utilizzando l'API Graph.