CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Create event participate using OOP API in CiViCRM
Pages: [1]

Author Topic: Create event participate using OOP API in CiViCRM  (Read 382 times)

xparthxvorax

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.6
  • CMS version: Drupal 7
  • MySQL version: 5.1.73
  • PHP version: 5.5.24
Create event participate using OOP API in CiViCRM
July 24, 2015, 07:16:47 am
There are 2 different sites in Drupal. In one of them there is CiViCRM is installed. Now I want to create event participate from first site which will use CiViCRM of second site. I have successfully get the list of events from second site to first site using:

    $api = new civicrm_api3 (array ('server' => 'http://localhost/civicrm', 'api_key'=>'xxx', 'key'=>'xxx'));
   
    if ($api->Event->Get()) {
       print_r($api);
    } else {
       echo $api->errorMsg();
    }

Now I want to create event participate using OOP API in CiViCRM. So I have create code something like that:

    $params = array(
          'contact_id'    => 1,
          'event_id'      => 2,
          'status_id'     => 1,
          'role_id'       => 1,
          'register_date' => '2007-07-21',
          'source'        => 'Online Event Registration: API Testing',
          'event_level'   => 'Tenor'
    );
   
    if ($api->Participate->Create($params)) {
       print_r($api);
    } else {
       echo $api->errorMsg();
    }

But in response I'm getting:
**API (Participate, create) does not exist (join the API team and implement it!)**

So is it still in development? any other way to do that?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Create event participate using OOP API in CiViCRM
July 24, 2015, 07:21:53 am
Please ask your question on http://civicrm.stackexchange.com/
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Create event participate using OOP API in CiViCRM

This forum was archived on 2017-11-26.