4 Create a campaign - Note use of relative dates here http://www.php.net/manual/en/datetime.formats.relative.php
6 function campaign_create_example(){
9 'title' => 'campaign title',
10 'description' => 'Call people, ask for money',
11 'created_date' => 'first sat of July 2008',
14 $result = civicrm_api( 'campaign','create',$params );
20 * Function returns array of result expected from previous function
22 function campaign_create_expectedresult(){
24 $expectedResult = array(
32 'name' => 'campaign_title',
33 'title' => 'campaign title',
34 'description' => 'Call people, ask for money',
37 'campaign_type_id' => '',
39 'external_identifier' => '',
43 'created_date' => '20080705000000',
44 'last_modified_id' => '',
45 'last_modified_date' => '',
52 return $expectedResult ;
57 * This example has been generated from the API test suite. The test that created it is called
59 * testCreateCampaign and can be found in
60 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/CampaignTest.php
62 * You can see the outcome of the API tests at
63 * http://tests.dev.civicrm.org/trunk/results-api_v3
65 * To Learn about the API read
66 * http://book.civicrm.org/developer/current/techniques/api/
68 * and review the wiki at
69 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
71 * Read more about testing here
72 * http://wiki.civicrm.org/confluence/display/CRM/Testing
74 * API Standards documentation:
75 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards