Four Square Campaign

Returns campaign information for a given user.

Figure 1a. Instantiate Users
$campaign = eden('foursquare')->campaign($_SESSION['oauth_token']);
Figure 1b. Usage: Retrieve all Campaigns
$campaign
	->setSpecialId('[STRING]')	//optional
    ->setGroupId('[STRING]')	//optional
    ->setStatus('[STRING]')		//optional
    ->getList();
Figure 1c. Usage: Retrieve Daily Campaign Stats Over a Given Time Range
$campaign
	->setStartTime('YYYY-MM-DD')	//optional
    ->setEndTime('YYYY-MM-DD')		//optional
    ->getTimeSeries('[CAMPAIGN_ID]');
Figure 1d. Usage: Create a Campaign
$campaign
	->setStartTime('YYYY-MM-DD')	//optional
    ->setEndTime('YYYY-MM-DD')		//optional
    ->setCampaignId('[STRING]')		//optional
    ->createCampaign('[SPECIAL_ID]', '[GROUP_ID]', '[VENUE_ID]');
Figure 1e. Usage: Delete a Campaign
$campaign->deleteCampaign('[CAMPAIGN_ID]');
Figure 1f. Usage: Start a Campaign
$campaign
	->setStartTime('YYYY-MM-DD')	//optional
    ->startCampaign('[CAMPAIGN_ID]');
Figure 1g. Usage: End a Campaign
$campaign->endCampaign('[CAMPAIGN_ID]');
Figure 1h. Campaign Methods
Method Arguments Returns Description
$campaign->setStartTime($startTime);
  1. string
  2. - YYYY-MM-DD
Eden_Foursquare_Campaign DateTime when the campaign is to be started (seconds since epoch). If this parameter is not specified, the campaign will be in a pending state until the campaign is actually started via the start action. If this parameter is specified and is in the past, the campaign will be started as of the current time.
$campaign->setEndTime($endTime);
  1. string
  2. - YYYY-MM-DD
Eden_Foursquare_Campaign DateTime when the campaign is to be automatically deactivated.
$campaign->setCampaignId($campaignId);
  1. string
Eden_Foursquare_Campaign ID of an existing campaign to copy.
$campaign->setSpecialId($specialId);
  1. string
Eden_Foursquare_Campaign If specified, limits response to campaigns involving the given special
$campaign->setGroupId($groupId);
  1. string
Eden_Foursquare_Campaign If specified, limits response to campaigns involving the given group
$campaign->setStatus($status);
  1. string
Eden_Foursquare_Campaign Accepted fields are pending, scheduled, active, expired, depleted, stopped, notStarted, ended, all
$campaign->creatCampaign($specialId = NULL, $groupId = NULL, $venueId = NULL);
  1. string|null
  2. - required (unless campaignId has been provided). Special ID
  3. string|null
  4. - required (unless venueId has been provided)
  5. string|null
  6. - required (unless groupId has been provided)
array Create a campaign. The special must be started in order for it to be visible to users.
$campaign->getList(); none array List all campaigns matching the given criteria.
$campaign->getTimeSeries($campaignId);
  1. string
  2. - The campaign id to retrieve stats for.
array Get daily campaign stats over a given time range.
$campaign->deleteCampaign($campaignId);
  1. string
  2. - The ID of the campaign to delete.
array Delete a campaign that has never been activated.
$campaign->endCampaign($campaignId);
  1. string
  2. - The ID of the campaign to end.
array End a campaign.
$campaign->startCampaign($campaignId);
  1. string
  2. - The ID of the campaign to start.
array Start a campaign.

© 2012 Openovate Labs. All rights reserved.