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) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • civicrm 4.4.3 not returning activity based on source_contact_id using get api
Pages: [1]

Author Topic: civicrm 4.4.3 not returning activity based on source_contact_id using get api  (Read 842 times)

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
civicrm 4.4.3 not returning activity based on source_contact_id using get api
February 17, 2014, 01:03:25 am
Hi,
I am using the get api for activity
Code: [Select]
$params = array(
  'version' => 3,
  'sequential' => 1,
  'source_contact_id' => 1,
);
$result = civicrm_api('Activity', 'get', $params);

but it is not returning result where source_contact_id=1
it is returning all results
I am using civicrm 4.4.3

also i tried on demo site
http://drupal.demo.civicrm.org/civicrm/api/explorer#/civicrm/ajax/rest?entity=Activity&action=get&debug=1&sequential=1&json=1&source_contact_id=1
click on go button.
on demo site also it is returning all results.

Is there anything do i need to change in $params  to get the result where source_contact_id=1

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm 4.4.3 not returning activity based on source_contact_id using get api
February 17, 2014, 12:47:08 pm
It looks like you can pass contact_id but no longer source_contact_id, contact_id doesn't distinguish between source, target or assignee - it returns all.

When the activity contacts were restructured the 'test-contract' was respected - tested functionality was not allowed to break. But, untested calls weren't proactively looked at.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
Re: civicrm 4.4.3 not returning activity based on source_contact_id using get api
February 24, 2014, 08:29:59 pm
Hi Eileen,

Is there a way so that i can get all activities of contact =1 using civicrm api ?
Or I will have to use the DB queries for it.

Thanks,
Shashikant

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm 4.4.3 not returning activity based on source_contact_id using get api
March 29, 2014, 07:24:47 pm
Hi - got the same question as Shashikant

I've looked https://github.com/civicrm/civicrm-core/blob/master/api/v3/examples/Activity/Get.php and https://github.com/civicrm/civicrm-core/blob/master/api/v3/Activity.php

and cant figure it out... am I missing a stash of doco somewhere??

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • civicrm 4.4.3 not returning activity based on source_contact_id using get api

This forum was archived on 2017-11-26.