Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Authentication isssues #63

Closed
lucasdedavid opened this issue Jul 17, 2017 · 9 comments
Closed

Authentication isssues #63

lucasdedavid opened this issue Jul 17, 2017 · 9 comments

Comments

@lucasdedavid
Copy link

Hey, I've been trying to use the package to integrate some data and i'm having some trouble with auth.

When fbad_init("account", token), I get this error:

ERROR [2017-07-17 16:56:04] URL:  https://graph.facebook.com/v2.5/act_1873405082881571/
ERROR [2017-07-17 16:56:04] Method:  GET
ERROR [2017-07-17 16:56:04] Params:  List of 1
 $ fields: chr "name,account_id,account_status,age,amount_spent,balance,capabilities,end_advertiser,funding_source,spend_cap,timezone_id,users"
Error in fbad_request(path = paste0("act_", accountid, "/"), method = "GET",  : 
  This is a bug in the fbRads package. Please report on GitHub with a detailed output: SSL: CA certificate set, but certificate verification is disabled
Além disso: Warning message:
In curlSetOpt(..., .opts = .opts, curl = h, .encoding = .encoding) :
  Error setting the option for # 2 (status = 4) (enum = 10097) (value = 0x101aec890): A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. <not set>

Can somebody help me to authenticate?

@daroczig
Copy link
Owner

It seems you are using a very old version of the package (probably from CRAN) -- can you please check the dev version installed from GitHub?

devtools::install_github('daroczig/fbRads')

Please reopen if you still cannot auth.

@lucasdedavid
Copy link
Author

Still having trouble. Your hint helped me but when listing ad:
fbad_list_ad("1355059354571137", id, statuses, fields = "id")
I get:
Error in fbad_check_fbacc() :
Invalid R object passed as fbacc argument. See ?fbad_init for more details. Checked the account and it's right.

@daroczig
Copy link
Owner

Try

fbad_list_ad(id = "1355059354571137", fields = "id")

The first arg of fbad_list_ad (and all fbad functions) is the fbacc object, that is automatically populated if not specified, but you have to use named args. I might get rid of that arg after all, but not not in the next few weeks

@lucasdedavid
Copy link
Author

Error in fbad_request(fbacc, path = file.path(id, endpoint), params = params,  : 
  Unsupported get request. Object with ID '1355059354571137' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

@lucasdedavid
Copy link
Author

Done :) Had to input act_ before the id

@lucasdedavid
Copy link
Author

Now I'm having some trouble in setting the fields on FB API.

fbad_read_ad(id= "23842609228480736", fields = c("name", "created_time", "status"))

This code is ok, but when I add some fields of FB documentation I get

Error in fbad_request(fbacc, path = id, params = list(fields = fields), : (#100) Tried accessing nonexisting field (creative) on node type (AdCampaign)

And also, I see no way to get impressions, reach, views and other metrics on the API. Can somebody help me with this?

@daroczig
Copy link
Owner

That FB error message seems to provide a pretty good explanation on what your are doing wrong: trying to query the creative of an ad campaign, but that field is associated with the ad level. Read the FB docs, at this point, I think that will be the most helpful.

@lucasdedavid
Copy link
Author

One more thing: When I enter

fb_insights(date_preset="today", level = "ad", toJSON(c(fields="impressions")))

I get ```
Error in fbad_check_fbacc() :
Invalid R object passed as fbacc argument. See ?fbad_init for more details.

@daroczig
Copy link
Owner

You again forgot about named arguments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants