Uploading hashed twitter ids to specific tailored audience


#1

Hello,

I’ve successfully created a tailored audience using api. It shows up when I run:
twurl -H ads-api.twitter.com /0/accounts/ID/tailored_audiences

So, my question is - how do I upload a list of hashed twitter ids to this specific tailored audience? Everyone keep talking about using ton_upload script while using this url: /1.1/ton/bucket/ta_partner , however, I’m confused to how the system will know which SPECIFIC tailored audience I will be uploading the file to ?

Thanks!


#2

After re-reading the documentation I realized that the flow is little different:

  1. Upload first
  2. Create TA
  3. Use tailored_audience_changes

However, I encountered another problem:
ruby -KU -rubygems ton_upload --mode upload --bucket ta_partner --file …/test1_hashed_31259.csv
Uploading …/test1_hashed_31259.csv (6 MB) as text/comma-separated-values via TON API
File stored at

So I don’t really know the id that I can use inside “tailored_audience_changes”

Debugging:

#<Net::HTTP ton.twitter.com:443 open=false>>
#<OAuth::AccessToken:0x000000037f34f8>
#<Net::HTTP::Post POST>
#<Net::HTTPBadRequest 400 Bad Request readbody=true>
File stored at {:cache_control=>"no-cache", :connection=>"close", :content_length=>"0", :date=>"Fri, 31 Jul 2015 21:44:11 GMT", :server=>"tsa_b", :set_cookie=>"guest_id=v1%3A143837905132692025; Domain=.twitter.com; Path=/; Expires=Sun, 30-Jul-2017 21:44:11 UTC", :strict_transport_security=>"max-age=631138519", :x_connection_hash=>"087518c2d753ba95e5d667a726f3e437", :x_rate_limit_limit=>"50", :x_rate_limit_remaining=>"46", :x_rate_limit_reset=>"1438379641", :x_response_time=>"111", :x_tsa_request_body_time=>"13978"}
    indent preformatted text by 4 spaces

#3

Hi,

I have the same problem. Before Friday everything was correct for me but then I started getting 400 errors for single chunk and multi chunk upload.

It would be great to know if something has changed in the implementation or you have some issues in the API.

I didn’t find anything your Twitter account @AdsAPI

Thank you.


#4

I’m getting the same error since Friday as well. Before that everything was working well, but now every upload is returning a 400 Error with no body.


#5

@dreyacosta I created a new post around the 400 error, as it’s not directly related to the topic here: Tailored Audience TON Upload Failing with 400 Error Code


#6

Looks like TON is back to working.

I’ve successfully uploaded the file, here are my next steps:

twurl -H ads-api.twitter.com "/0/accounts/8arnzm/tailored_audience_changes" -d "tailored_audience_id=vlmg&operation=ADD&input_file_path=/1.1/ton/data/ta_partner/501816370/-v4uiqYHSmujSkc"

reply:

{"data_type":"tailored_audience_change","data":{"input_file_path":"\/ta_partner\/501816370\/-v4uiqYHSmujSkc","tailored_audience_id":"vlmg","state":"COMPLETED","id":"e0s8","operation":"ADD"},"request":{"params":{"tailored_audience_id":"vlmg","input_file_path":"\/ta_partner\/501816370\/-v4uiqYHSmujSkc","operation":"ADD","account_id":"8arnzm"}}}

However, there are couple of issues that I’ve noticed:
1 - running:
twurl -H ads-api.twitter.com /0/accounts/8arnzm/tailored_audiences_changes/vlmg
or
twurl -H ads-api.twitter.com /0/accounts/8arnzm/tailored_audiences_changes/e0s8
both give out:

{"errors":[{"code":"ROUTE_NOT_FOUND","message":"The requested resource could not be found"}],"request":{"params":{}}}

2 - Inside Audience Manager, the audience “test1” says “Processing”, Last Updated: Updating, Audience Size: Pending.
Is there a problem?

Thank you!


#7

StatSocialCTO,

Note that you are calling:

/0/accounts/8arnzm/tailored_audiences_changes/vlmg

There is a typo on the endpoint you are using ( an extra “s” ), the correct should be:

/0/accounts/8arnzm/tailored_audience_changes/vlmg.

Best,

Leo and Ran from Commun.it


#8

Got it, thank you commun_it !