exfacebook v0.0.7 Exfacebook.Api

Basic functions for accessing Facebook API.

Summary

Functions

Use delete_connections to delete object from connections

Use delete_connections for deleting items from connections using batch api

Use delete_object to delete object from facebook data

Use delete_object for deleting item from facebook data

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

Returns hash of image data for passed id

Getting list of subscriptions for app, we don’t need to use user access token, it requires to have only app_id and secret

Pagination next_page is using response from calls of get_connections

Use put_connections for posting messages or other update actions

Use put_connections for posting messages or other update actions

Subscribe to real time updates to object

id - id of object to unsubscribe, in case if developer passed nil unsubscribe would apply for all subscriptions for facebook app

Types

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

Functions

delete_connections(id, name, params)

Specs

delete_connections(id, name, params) ::
  success |
  error

Use delete_connections to delete object from connections

Example:

{:ok, response} = delete_connections(:me, :feed, %{})

delete_connections(api, id, name, params)

Specs

delete_connections(api, id, name, params) :: Map.t

Use delete_connections for deleting items from connections using batch api

delete_like(id, params)

Specs

delete_like(id, params) :: success | error
delete_like(api, id, params)

Specs

delete_like(api, id, params) :: success | error
delete_object(id, params)

Specs

delete_object(id, params) :: success | error

Use delete_object to delete object from facebook data.

Example:

{:ok, response} = delete_connections(:me, :feed, %{})

delete_object(api, id, params)

Specs

delete_object(api, id, params) :: Map.t

Use delete_object for deleting item from facebook data.

exchange_access_token(access_token)

Specs

exchange_access_token(access_token) ::
  success |
  error
exchange_access_token_info(access_token)

Specs

exchange_access_token_info(access_token) ::
  success |
  error
get_connections(id, name, params)

Specs

get_connections(id, name, params) ::
  success |
  error

Use get_connections to read feed, home collections.

Example:

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

get_connections(api, id, name, params)

Specs

get_connections(api, id, name, params) :: Map.t

Use get_connections for getting collection using batch Facebook API.

get_object(id, params)

Specs

get_object(id, params) :: success | error

Use get_object for getting object related attributes

Example:

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

get_object(api, id, params)

Specs

get_object(api, id, params) :: Map.t

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

get_page_access_token(id, params)

Specs

get_page_access_token(id, params) ::
  success |
  error
get_page_access_token(api, id, params)

Specs

get_page_access_token(api, id, params) :: Map.t
get_picture_data(id, params)

Specs

get_picture_data(id, params) :: success | error

Returns hash of image data for passed id.

get_picture_data(api, id, params)

Specs

get_picture_data(api, id, params) :: Map.t
list_subscriptions(params)

Specs

list_subscriptions(params) :: success | error

Getting list of subscriptions for app, we don’t need to use user access token, it requires to have only app_id and secret.

list_subscriptions(, )
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, arg)

Specs

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

Specs

prev_page(api, success | error) ::
  success |
  error
put_comment(id, params, message)

Specs

put_comment(id, params, String.t) ::
  success |
  error
put_comment(api, id, params, message)

Specs

put_comment(api, id, params, String.t) :: Map.t
put_connections(id, name, params, body \\ %{})

Specs

put_connections(id, name, params, body) ::
  success |
  error

Use put_connections for posting messages or other update actions.

Example:

put_connections(:me, :feed, %{access_token: "access-token"}, %{message: "message-example"})
put_connections(api, id, name, params, body)

Specs

put_connections(api, id, name, params, body) ::
  success |
  error

Use put_connections for posting messages or other update actions.

put_like(id, params)

Specs

put_like(id, params) :: success | error
put_like(api, id, params)

Specs

put_like(api, id, params) :: Map.t
put_picture(id, params, file)

Specs

put_picture(id, params, file) :: success | error
put_video(id, params, file)

Specs

put_video(id, params, file) :: success | error
put_wall_post(id, message, params, attachment)

Specs

put_wall_post(id, String.t, params, Map.t) ::
  success |
  error
put_wall_post(api, id, message, params, attachment)

Specs

put_wall_post(api, id, String.t, params, Map.t) :: Map.t
subscribe(id, fields, callback_url, verify_token \\ nil)

Specs

subscribe(id, String.t, String.t, String.t) ::
  success |
  error

Subscribe to real time updates to object.

callback_url - https api endpoint to receive real time updates. verify_token - token to verify post request from facebook with updates. fields - ‘friends, feed’ as an example.

subscribe(, , , , )
unsubscribe(id)

Specs

unsubscribe(id) :: success | error

id - id of object to unsubscribe, in case if developer passed nil unsubscribe would apply for all subscriptions for facebook app.

unsubscribe(, )