daroczig / fbRads

Analyze and manage Facebook ads from R using this client library to access their Marketing APIs
GNU Affero General Public License v3.0
153 stars 57 forks source link

Difference in accountid # in fbad_request #122

Closed joshuamkim closed 4 years ago

joshuamkim commented 4 years ago

Hi,

I've successfully made the API call and pulled relevant data with another ad account, but with this account the error message seems to be searching for a different accountid than what I set as my argument

Error in fbad_request(path = paste0("act_", accountid, "/"), method = "GET",  : 
  Unsupported get request. Object with ID 'act_XXXXXXXXXXXXXX292' does not exist, cannot be loaded due to missing permissions, or does not support this operation.

My code is:

accountid <- XXXXXXXXXXXXXX291

accounts <- fbad_get_adaccount_details(accountid, token, version = '7.0')

In the error message, the accountid is just off by +1... (292 as opposed to 291). I've verified that the string of numbers is exactly the same except the last digit. Also I've made sure to use the latest package version fbRads version 6.0.0.

Any thoughts here? Is this still a permissions issue or a package issue? Thanks in advance!

daroczig commented 4 years ago

I think you are handling the account id as a number, while it should be a string -- try something like:

accountid <- "XXXXXXXXXXXXXX291"

PS I would highly appreciate if you could share that id or another one where you can reproduce the issue -- you can reach me at my GH username (at) rapporter (dot) net

joshuamkim commented 4 years ago

Thank you for the quick response! That worked, thanks!

Will reach out to you to reproduce the example