Greetings
I am trying to upload a tailored audience through the TON api using cURL. I can’t seem to get it to work as I’m getting 403 Forbidden with no body as the response. With much frustration, I turned to twurl and miraculously it worked!
I believe I have the Authorization header setup correctly, I got it from the oauth signature-generator tool. Also I was able to get the tailored audience I just uploaded with twurl back using cURL, so signature shouldn’t be the problem.
Here is my cURL command:
curl --request 'POST' 'https://ton.twitter.com/1.1/ton/bucket/ta_partner' --header ' Authorization: OAuth oauth_consumer_key="oauth_consumer_key", oauth_nonce="oauth_nonce", oauth_signature="oauth_signature, oauth_signature_method="HMAC-SHA1", oauth_timestamp="1440619913", oauth_token="oauth_token", oauth_version="1.0"' --verbose --data 'example@email.com' --header 'Content-Type: text/plain' --header 'X-TON-Expires: Fri, 28 Aug 2015 00:00:00 GMT'
which results in 403. The Content-Length header is automatically added, so that isn’t the problem.
And here is my twurl command:
twurl -t -H ton.twitter.com /1.1/ton/bucket/ta_partner -X POST -A "Content-Type: text/plain" --data "example@email.com" -A "X-TON-Expires: Fri, 28 Aug 2015 00:00:00 GMT"
which worked…
tl;dr
How do I use the TON api using cURL?