exfacebook v0.0.2 Exfacebook.Api

Basic functions for accessing Facebook API.

Summary

Functions

Use get_connections to read feed, home collections

Use get_connections for getting collection using batch Facebook API

Use get_object for getting object related attributes

Use get_object for getting object related attributes as part of batch API

Pagination next_page is using response from calls of get_connections

Types

api :: List.t
error :: {:error, Exfacebook.Error.t}
id :: String.t | binary
name :: String.t | binary
success :: {:ok, Map.t}

Functions

get_connections(id, name, params)

Specs

get_connections(id, name, Exfacebook.Params.t) ::
  success |
  error

Use get_connections to read feed, home collections.

Example:

{:ok, %{“data” => collection}} = get_connections(:me, :feed, %Params{fields: “id, name”})

get_connections(api, id, name, params)

Specs

get_connections(api, id, name, Exfacebook.Params.t) :: Map.t

Use get_connections for getting collection using batch Facebook API.

get_object(id, params)

Specs

get_object(id, Exfacebook.Params.t) ::
  success |
  error

Use get_object for getting object related attributes

Example:

{:ok, %{“id” => id, “name” => name}} = get_object(:me, %Params{access_token: “access-token”, fields: “id, name”})

get_object(api, id, params)

Specs

get_object(api, id, Exfacebook.Params.t) :: Map.t

Use get_object for getting object related attributes as part of batch API.

next_page(state)

Specs

next_page(success | error) :: success | error

Pagination next_page is using response from calls of get_connections.

Example:

page0 = get_connections(...)
page1 = page0 |> next_page
page0 = page1 |> prev_page
next_page(api, state)

Specs

next_page(api, success | error) ::
  success |
  error
prev_page(api, state)

Specs

prev_page(api, success | error) ::
  success |
  error