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) »
  • Can't get a list of activities with the activity API
Pages: [1]

Author Topic: Can't get a list of activities with the activity API  (Read 2695 times)

abrookins

  • I’m new here
  • *
  • Posts: 21
  • Karma: 5
    • Redspire (Blog)
Can't get a list of activities with the activity API
November 12, 2008, 09:52:50 am
Hello,

I'm having trouble with the activity API.

Passing an array with 'contact_id' set to the number of a contact with existing activities to the civicrm_activities_get_contact() function returns an 'Invalid Data' error.  It does this for any contact ID.

Passing contact ID as an integer to _civicrm_activities_get() returns an empty array.

The activity types of the existing activities are mixed, but include at least one standard/base activity type, such as a phone call.  I also tested a contact that had a single phone call activity with the same result.

Am I doing something wrong?

Thanks,
Andrew

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can't get a list of activities with the activity API
November 13, 2008, 04:11:24 am
Can you check this example:
http://svn.civicrm.org/civicrm/trunk/tests/api/v2/ActivityGetContact.test

Also check http://wiki.civicrm.org/confluence/display/CRMDOC/Activity+APIs

HTH

Kurund
Found this reply helpful? Support CiviCRM

abrookins

  • I’m new here
  • *
  • Posts: 21
  • Karma: 5
    • Redspire (Blog)
Re: Can't get a list of activities with the activity API
November 24, 2008, 09:26:11 pm
Thanks, Kurund.  I was able to diagnose my error using the API test cases.

Best,
Andrew

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Can't get a list of activities with the activity API

This forum was archived on 2017-11-26.