FallenTech / twitter-ads

Twitter Ads API for NodeJS
MIT License
22 stars 10 forks source link

JSON_PATHS support #4

Open spicy-sauce opened 4 years ago

spicy-sauce commented 4 years ago

Hi, You've added such a support a while ago, but it seems like the JSON_PATHS is wrong, as it currently contains: JSON_PATHS: ['tailored_audience_memberships']

This URL does not exist in Twitter Ad API (correct me if I'm wrong). On the other hand, this endpoint should be sent in JSON: accounts/:account_id/tailored_audiences/:tailored_audience_id/users

I also think that the condition in line 66 in twitter_ads.js won't meet: if (constants.JSON_PATHS.indexOf(url) > -1 && ['post', 'put'].indexOf(type) > -1) { Probably should change to: if (url.indexOf(constants.JSON_PATHS) > -1 && ['post', 'put'].indexOf(type) > -1) {

Please, advise.

Thanks!