facebook / facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
489 stars 226 forks source link

Can we release v17.0.0? #250

Closed jeffrey-daylight closed 1 year ago

jeffrey-daylight commented 1 year ago

Which SDK version are you using?

16.0.2

What's the issue?

Current App version is v17 which is not able to downgrade, but the sdk keeps fetching v16 endpoint

Steps/Sample code to reproduce the issue

Simply use the sample code from official developer website


'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const AdAccount = bizSdk.AdAccount;
const Campaign = bizSdk.Campaign;

const access_token = '<ACCESS_TOKEN>';
const app_secret = '<APP_SECRET>';
const app_id = '<APP_ID>';
const id = '<AD_ACCOUNT_ID>';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
  api.setDebug(true);
}

const logApiCallResult = (apiCallName, data) => {
  console.log(apiCallName);
  if (showDebugingInfo) {
    console.log('Data:' + JSON.stringify(data));
  }
};

let fields, params;
fields = [
  'name',
  'objective',
];
params = {
  'effective_status' : ['ACTIVE','PAUSED'],
};
const campaignss = (new AdAccount(id)).getCampaigns(
  fields,
  params
);
logApiCallResult('campaignss api call complete.', campaignss);

Observed Results:

[ERROR] 14:41:00 FacebookRequestError: (#2635) Your app has been upgraded to version v17.0, please use this version or newer. This can be verified in the settings tab on the App Dashboard. log.js:27

400 GET https://graph.facebook.com/v16.0/act_/campaigns?effective_status=%5B%22ACTIVE%22%2C%22PAUSED%22%5D&fields=name%2Cobjective&access_token=



#### Expected Results:

  * What did you expect to happen?
Get v17 able to be installed with npm/yarn package install
davidhanlonJCM commented 1 year ago

yeah... supporting 17 would be ideal

stcheng commented 1 year ago

we realized a bug in the v17 and after fixing this we will create a new release.

loebpaul commented 1 year ago

having the same issue. just signed up for a new ad account (which can only use api version 17) and this sdk doesn't work

stcheng commented 1 year ago

The v17.0.1 has been release. Please post here if the SDK works for you. @jeffrey-daylight @davidhanlonJCM @loebpaul

loebpaul commented 1 year ago

Thank you I am no longer getting an error about the version, however I am still unable to get started by following the Node.js sample code. I get an error

Error
    at FacebookRequestError.FacebookError [as constructor] (node_modules/facebook-nodejs-business-sdk/dist/cjs.js:351:16)
    at new FacebookRequestError (node_modules/facebook-nodejs-business-sdk/dist/cjs.js:373:129)
       at process.processImmediate (node:internal/timers:475:21) {
  message: '(#100) Missing permissions',
  status: 400,
  response: {
    error: {
      message: '(#100) Missing permissions',
      type: 'OAuthException',
      code: 100,
      fbtrace_id: 'AHpGGpPNxtQ-nfclGRbAPfc'
    }
  },
  headers: {
    vary: 'Origin',
    'x-ad-account-usage': '{"acc_id_util_pct":0}',
    'cross-origin-resource-policy': 'cross-origin',
    'x-app-usage': '{"call_count":3,"total_cputime":0,"total_time":1}',
    'content-type': 'application/json',
    'www-authenticate': 'OAuth "Facebook Platform" "invalid_request" "(#100) Missing permissions"',
    'access-control-allow-origin': '*',
    'facebook-api-version': 'v17.0',
    'strict-transport-security': 'max-age=15552000; preload',
    pragma: 'no-cache',
    'cache-control': 'no-store',
    expires: 'Sat, 01 Jan 2000 00:00:00 GMT',
    'x-fb-request-id': 'AHpGGpPNxtQ-nfclGRbAPfc',
    'x-fb-trace-id': 'FX0RKhkUcm/',
    'x-fb-rev': '1007709848',
    'x-fb-debug': 'UnyHp1v2uuFKnmQsFknOfg4u62FpnymeAfbJ7zr+HsIdLhG4a+IrSFtUeImYJmCFdYgYUICSPtOAENL8tYEDnw==',
    date: 'Tue, 20 Jun 2023 20:58:43 GMT',
    'alt-svc': 'h3=":443"; ma=86400',
    connection: 'keep-alive',
    'content-length': '124'
  },
  method: 'GET',
  url: 'https://graph.facebook.com/v17.0/act_123..?fields=name&access_token=xyz...',
stcheng commented 1 year ago

@loebpaul this issue has been closed. if you're facing other issues, you could create a different issue or report it via the support channel.