官术网_书友最值得收藏!

Summary

We learned a lot in this chapter about the Graph API: not just what it is, but also how to access it in AS3.

Key things to learn:

  • The Graph API is so-called because it represents all of Facebook's data connected in an enormous graph of objects and connections.
  • The Graph API has two types of elements: Graph Objects and Graph Lists.
  • Graph Objects may have two IDs: a numeric one specified by Facebook, and possibly an alphanumeric one, specified by the Graph Object's owner.
  • Graph Objects have connections; connections lead to Graph Lists; Graph Lists contain Graph Objects.
  • The format of a Graph URL for retrieving a Graph Object is https://graph.facebook.com/graph_object_id.
  • The format of a Graph URL for retrieving a Graph List is https://graph.facebook.com/graph_object_id/connection_id.
  • Graph URLs return data in JSON format. This is a text-based format which uses key-value pairs to represent objects containing properties, arrays, and other objects.
  • Sometimes, Graph URLs return error messages; these are also given in JSON format.
  • We can use the ?metadata=1 parameter in a Graph URL to make it return extra information about the element, like the list of connections leading from a Graph Object.
  • Metadata is not returned for Graph Objects that are part of a Graph List.
  • The JSON representation of a Graph Object can be deserialized to an AS3 object we can use in code using the as3corelib library.

We also discussed how the Graph API is so flexible, because it uses the same basic structure for every type of object in Facebook's database.

But what about those objects that give us an authorization error when we try to get information on them? That's what we'll cover in the next chapter.

主站蜘蛛池模板: 嫩江县| 兖州市| 汕头市| 方正县| 平定县| 中宁县| 邻水| 开阳县| 漳平市| 报价| 赫章县| 沾化县| 宝坻区| 留坝县| 旌德县| 嫩江县| 安仁县| 甘肃省| 张家港市| 巴林右旗| 芒康县| 泰宁县| 漯河市| 哈尔滨市| 彰化县| 呼玛县| 苍南县| 凌海市| 宁海县| 冷水江市| 广平县| 汪清县| 弋阳县| 安乡县| 恩施市| 来凤县| 竹溪县| 利津县| 渭南市| 永平县| 怀远县|