Quick start with Facebook Graph API
masterYou can perform basic Graph API requests using package-level functions like fb.Get. The result is returned as an fb.Result (which is a map[string]interface{}).
package main
import (
"fmt"
fb "github.com/huandu/facebook/v2"
)
func main() {
res, _ := fb.Get("/538744468", fb.Params{
"fields": "first_name",
"access_token": "a-valid-access-token",
})
fmt.Println("Here is my Facebook first name:", res["first_name"])
}package main
import (
"fmt"
fb "github.com/huandu/facebook/v2"
)
func main() {
res, _ := fb.Get("/538744468", fb.Params{
"fields": "first_name",
"access_token": "a-valid-access-token",
})
fmt.Println("Here is my Facebook first name:", res["first_name"])
}