3. Graph API
• Permite aceder à informação contida no social graph;
• Autenticação via OAUTH 2.0;
• Endereçabilidade– Todos os objectos têm ID’s únicos;
• API REST;
• Operações possíveis:
– Selecção
– Introspecção
– Publicação
– Remoção
– Pedidos HTTP em Batch
3
4. Criação de uma Aplicação
App ID; App Secret; Site URL; App Name;
4
10. Publicação e Remoção
Necessária permissão
do utilizador.
“Extended Permissions”
– “publish stream”
10
11. Operações em Batch
• Realizar vários pedidos HTTP num
só, passando representação dos pedidos num
array JSON (method, relative_url, [body]).
! Limite actual: 50 pedidos em batch
11
OFacebook armazena e trabalha nos dados como se tratasse de um grafo.Os nós são os objectos, e a ligação entre objectos são as connections(conexões), basicamente as conexoes são a forma de relacionamento entre dois objectos.
1. Redirect the user to the OAuth Dialog2. The user is prompted to authorize your application3. The user is redirected back to your app4. Exchange the code for a user access token5. Make requests to the Graph APIOnce the access token expiry time is reached, the token will become invalid and can no longer be used in requests to the API. To obtain a new user access token, you must pass the user through this flow again. However, if the user has not deauthorized your app and you're asking for no permissions beyond those which the user has already granted your application, then no dialog will be displayed and the user will be transparently redirected to your redirect_uri with a fresh code which can be exchanged for a fresh user access token.