Giter Site home page Giter Site logo

twitter-ads's People

Contributors

talha-asad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

twitter-ads's Issues

JSON_PATHS support

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!

3 legged authentication

Hello thanks for the great library. However is there are a way to authenticate multiple Twitter accounts using the same application? I've heard from Twitter support that this could be achieved through 3 legged authentication.

T.tonUpload getting status 400 Error

I am getting Error: TwitterAdsAPI: Twitter TON API returned HTTP status code: 400 every time I attempt to upload my audience file using the T.tonUpload endpoint. I have authenticated with Twitter and successfully used the endpoint T.get('/accounts... with no issues.

Looking at the docs on https://dev.twitter.com/rest/ton it seems like there is suppose to be a 'x-ton-expires' header, which I tried (see below), but I still get the same error. @talha-asad do you have any ideas?

My Code:

var T = new TwitterAdsAPI({
  consumer_key: adApp.consumer_key,
  consumer_secret: adApp.consumer_secret,
  access_token: adApp.access_token,
  access_token_secret: adApp.access_token_secret,
  sandbox: false,
  api_version: '2'
});
T.tonUpload({
    file: dir,
    content_type: 'text/plain',
    bucket_name: 'ta_partner',
    'x-ton-expires': expires
  },
  function(error, location) {
    if (error) return res.serverError(error);
    return res.ok(location);
    /* If everything goes okay,
     you should get something similar to this:
     https://ton.twitter.com/1.1/ton/bucket/ta_partner/2892314386/n3UPAcC02roTP6C
     */
  });
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.