Versione API Graph

Richiesta /{request-id}

Una richiesta dei giochi individuale ricevuta da qualcuno, inviata da un'app o da un'altra persona.

Guide correlate

Lettura

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

Autorizzazioni

  • Se richiedi solo l'utilizzo dell'ID oggetto della richiesta e desideri informazioni sul destinatario della richiesta, devi usare un token d'accesso dell'utente. La richiesta deve essere stata inviata alla persona di cui stai usando il token d'accesso.
  • Quando richiedi l'utilizzo della stringa concatenata di ID utente e ID oggetto della richiesta oppure quando utilizzi solo l'ID oggetto della richiesta ma non hai bisogno di informazioni sul destinatario, puoi usare un token d'accesso dell'app. Consulta la documentazione sulle richieste per maggiori informazioni su questo ID.

Campi

Nome Descrizione Tipo

id

L'ID oggetto della richiesta.

string

application

L'app associata alla richiesta.

App

to

Il destinatario della richiesta.

User

from

Il mittente associato alla richiesta. Questo campo è incluso solo per le richieste da utente a utente.

User

message

Una stringa che descrive la richiesta.

string

created_time

L'indicazione temporale relativa alla creazione della richiesta.

datetime

Pubblicazione

Non puoi pubblicare usando questo endpoint.

Le richieste vengono pubblicate tramite la finestra di dialogo per la richiesta dei giochi. Se la tua app è un gioco, puoi pubblicare le richieste dell'app usando il segmento /{user-id}/apprequests.

Eliminazione

DELETE /v19.0/{request-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->delete(
    '/{request-id}',
    array (),
    '{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(
    "/{request-id}",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{request-id}",
    null,
    HttpMethod.DELETE,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{request-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Autorizzazioni

  • Se utilizzi solo l'ID oggetto della richiesta devi usare un token d'accesso dell'utente. La richiesta deve essere stata inviata anche alla persona di cui stai utilizzando il token d'accesso.
  • Quando utilizzi la stringa concatenata di ID utente e ID oggetto della richiesta puoi usare un token d'accesso dell'app.

Campi

Non ci sono campi obbligatori per l'eliminazione.

Risposta

Se l'operazione va a buon fine:

{
  "success": true
}

In caso contrario viene restituito un messaggio di errore pertinente.

Aggiornamento

Non puoi aggiornare usando questo endpoint.