Compliance

Method: compliance()

Compliance endpoints allow you to upload large datasets of Tweet or user IDs to retrieve their compliance status.

$twitter = new BirdElephant($credentials);

$compliance = $twitter->compliance();

Create Compliance Job

Method: createJob()

Create a new compliance job

$compliance->createJob($type = 'tweets', $name = 'test', $resumable = false);
ArgumentTypeDescription
$typestringcan be either 'tweets' or 'usersrequired
$namestringa name for this joboptional
$resumableboolwhether to enable the upload URL with support for resumable uploads. Defaults to false.optional

Get Compliance Job

Method: getJob()

Get a single compliance job with a specified ID

$compliance->getJob($job_id);
ArgumentTypeDescription
$job_idstringThe id of the compliance jobrequired

Get Compliance Jobs

Method: getJobs()

Get a list of compliance jobs of a given type

$compliance->getJobs($type);
ArgumentTypeDescription
$typestringcan be either 'tweets' or 'usersrequired

Examples

use Coderjerk\BirdElephant\BirdElephant;

$twitter = new BirdElephant($credentials);

// create a new compliance job
$new_job = $twitter->compliance()->createJob($type = 'tweets', $name = 'test', $resumable = false);

// get jobs of the type 'tweets'
$jobs = $twitter->compliance()->getJobs('tweets');

// loop through the response and get ids
foreach ($jobs->data as $job) {
    $job = $twitter->compliance()->getJob($job->id);
}

Reference

Refer to the Twitter documentation for details of paramaters, expansions and fields.

Edit this page on GitHub Updated at Tue, Jan 3, 2023