Hello,
My application was approved for developer access but I get a 400 error when I try to use the TON API.
My application ID is 8649882. I have ADS API - Developer Access and it was granted on 4/20/2016.
I’m using the CodeBird PHP Framework for Twitter found here https://github.com/jublonet/codebird-php
According to the documentation to make a TON API upload you do this:
`<?php
require_once ‘…/…/lib/config.php’;
//include twitter library
require_once (RESOURCE_DIR.’/twitter/vendor/jublonet/codebird-php/src/codebird.php’);
\Codebird\Codebird::setConsumerKey(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
$cb = \Codebird\Codebird::getInstance();
//start upload
//single-chunk upload
$cb->setToken(‘redacted on purpose’,‘redacted on purpose’);
// single-chunk upload
$reply = $cb->ton_bucket_BUCKET([
‘bucket’ => ‘ta_partner’,
‘Content-Type’ => ‘text/csv’,
‘Content-Length’ => filesize(‘data.csv’),
‘file’ => ‘data.csv’,
‘X-TON-Expires’ => date(‘r’, strtotime(’+7 day’))
]);
print_r($reply);
$target = $reply->Location;`
However this is the response I’m getting:
`stdClass Object
(
[httpstatus] => 400
[rate] => stdClass Object
(
[limit] => 50
[remaining] => 49
[reset] => 1465833623
)
)`
Any help would be greatly appreciated.
Thank you