Retrieve Campaign Details
Use the Get method to return information about existing campaigns.
Ruby
require 'fuelsdk'
myClient = FuelSDK::Client.new {'client' => { 'id' => CLIENTID, 'secret' => SECRET }}
campaign = FuelSDK::Campaign.new
campaign.authStub = myClient
response = campaign.get
p responsePHP
require('ET_Client.php');
$myclient = new ET_Client();
$campaign = new ET_Campaign();
$campaign->authStub = $myclient;
$response = $campaign->get();
print_r($response);Python
import ET_Client
myClient = ET_Client.ET_Client()
campaign = ET_Client.ET_Campaign()
campaign.auth_stub = myClient
results = campaign.get()
print resultsCSharp
using FuelSDK;
ET_Client myclient = new ET_Client();
ET_Campaign campaign = new ET_Campaign();
campaign.AuthStub = myclient;
GetReturn results = campaign.Get();
Console.WriteLine("Get Status: " + results.Status.ToString());Java
Documentation for the Fuel Java SDK can be found at http://salesforce-marketingcloud.github.io/FuelSDK-Java/
Filtering Get Requests
Optionally, you can set values in the props property to limit the number of results returned and handle paging.
- $page - 1 based ordinal for the page number.
- $pageSize - Number of items to return. 50 is the maximum.
- $orderBy - Specifies the sort order
- ModifiedDate DESC
- ModifiedDate ASC
- Name DESC
- Name ASC
- CampaignCode DESC
- CampaignCode ASC
- Id DESC
- Id ASC
- CreatedDate DESC
- CreatedDate ASC
Ruby
campaign.props = {'$page' => '2', '$pageSize' => '10', '$orderBy' => 'ModifiedDate DESC'}PHP
$campaign->props = array('$page' => '2', '$pageSize' => '10', '$orderBy' => 'ModifiedDate DESC');Python
campaign.props = {"$page" : "2", "$pageSize" : "10", "$orderBy" : "ModifiedDate DESC"};CSharp
campaign.Page = 2;