Questions tagged [api]

Questions about the CiviCRM API.

Filter by
Sorted by
Tagged with
1
vote
1answer
151 views

API for update an address

I'm testing the API in order to update some addressee informations (eg. the street_number) using the API Explore page. In any test: CRM.api3('Address', 'replace', { "id": 204, "street_number": ...
6
votes
1answer
243 views

Is it possible to integrate CiviCRM with a hosted VOIP solution?

My company may be moving to a hosted VOIP solution. I've been looking for a solution to integrate a VOIP system with CiviCRM but it appears that this is still under development and no solution is in ...
3
votes
1answer
434 views

Uploading files through the API

I see an older thread on the forum about potential improvements to the API to allow file uploads, but I'm not sure that ever happened. Has anyone ever uploaded files in CiviCRM using the API? I see ...
1
vote
0answers
26 views

API EntityTag-Create, tags not added if one already exists on contact

We are trying to mass updating tags via API. Using API. When trying to add an array of tags Example: ["1","2","3"] to a contact using API : EntityTag-Create. The set of tags are not added whenever ...
1
vote
2answers
109 views

Chained API Call : Membership.contact_id EntityTags

I am looking to get a list of all contacts with active memberships, and their respective tags. I went about this by starting from an api call to give me all current memberships owned by a company. ...
5
votes
2answers
142 views

Does the Civi GoCardless extension use the GoCardless API?

We're a charity running CiviCRM 4.6 on Drupal 7. Last year, we moved all of our direct debits to GoCardless, which is running nicely. However, we're wanting to feed information from GoCardless back ...
1
vote
2answers
36 views

Civicrm Integration: Error while adding api function

I have CiviCRM 4.7 installed on drupal 7.38. I Found it necessary to modify the url in civicrm.settings.php file as suggested here:https://forum.civicrm.org/index.php?topic=33303.0After this ...
2
votes
1answer
35 views

How do I subscribe to a CiviCRM developer email list/group?

I'd like to get more involved with the CiviCRM development process. How can I subscribe to the API or General Development email list/discussion group that I keep hearing about?
5
votes
1answer
196 views

Testing a module which uses CiviCRM php api

I have written a drupal module that uses the CiviCRM api. I want to build tests for my module. Drupal 7 includes the simpletest module in core, so I'm using that. I have created the following test: ...
1
vote
1answer
135 views

How would I view an attachment PDF that is attached to a contact activity, through the REST API?

This is through the REST API, I'm using CiviCRM 4.4.14, REST API v3. I read that there is an attachment API, but the attachment API does not seem to be available through the REST API.
1
vote
0answers
65 views

Overriding civicrm_webform's postprocessing of contributions

I'm using hook_form_alter() to perform calculations on various contributions on a civicrm_webform. I'd like to use the totals of these calculations to update the contribution amount and event amounts ...
3
votes
1answer
99 views

Trouble getting Activity Information with api

I'm trying to get Activity information via the API, but have run into two issues: I cannot seem to filter by a date stored in a custom field. I've tried formatting the date multiple ways ('Y-m-d', 'm-...
4
votes
1answer
54 views

How does the API deal with the addition of an existing contact?

If you add a contact via the API is it passed through any of the de-duplication rules? I.e. if I add a contact that matches an existing record will it create a new record or merge with the existing ...
4
votes
1answer
221 views

Can I chain API calls through drush?

API chaining works well in Javascript and PHP. For example, I can retrieve a contact's email addresses using this code generated by the API Explorer: Php $result = civicrm_api3('Contact', 'getsingle'...
5
votes
2answers
360 views

How to get contact id of logged-in user in JS API

Sorry if I'm being thick here, but I've looked and looked. Is there an API call to get the contact id of the logged-in user? What I need to do is check whether an activity has been authored by the ...
4
votes
2answers
333 views

Integrating Civicrm in Laravel Package

I have been learning Civicrm for something now. Now that I am familiar with the whole idea, I would like to integrate Civicrm in Laravel package. I understand its not going to be an easy task, that's ...
1
vote
1answer
144 views

Get the “Smart” group of a user id via REST

We've created so called 'smart' groups in civicrm, and we need to know if a certrain user belongs to this group. I can get the groups of a user with the following code: http://url.com/sites/all/...
2
votes
2answers
324 views

Invalid API Key provided

System Details Versions CiviCRM: 4.7.4 WordPress: 4.4.2 When I attempt to renew an expired membership via the Renew-Credit Card option I am presented with the following error. Payment Error ...
3
votes
0answers
79 views

API with between array

We recevently update to 4.7.2 and this seems to have broken something in the API regarding the BETWEEN operator. This used to work: $result = civicrm_api3('Contribution', 'get', array( 'sequential'...
1
vote
1answer
67 views

CiviCRM Architecture - CiviCRM directory structure

Can anybody help me understand the architecture and directory structure of the civicrm. I found this post written in 2006 which doesn't seems to be valid for newer version.
1
vote
0answers
21 views

Linking Drupal page manager variants to Civicrm groups

I am trying to add a way to create variants on my homepage in Drupal based on a users Civicrm Groups (I have also been looking at tags, but will stick with the former for this point). The purpose of ...
3
votes
1answer
58 views

Civi AJAX API Search by “AND”ing 2 Tags

I would like to search the Civi API for Contacts that have both of two tags. I'm at a loss as to how to do this. Right now if you provide multiple tags, the default is to use an OR operation. For ...
6
votes
2answers
3k views

How do I set up an API key for a user?

The current documentation for creating an API key for user is on the wiki at https://wiki.civicrm.org/confluence/display/CRMDOC/REST+interface#RESTinterface-CreatingAPIkeysforusers. Unfortunately ...
1
vote
3answers
97 views

How to connect to Attentive.ly (Social Media Service)?

I have a Wordpress CiviCRM site and want to try using the Attentive.ly Social Media Service. There is an Extension to connect to this service. I have installed the Civi Extension and all seems good. ...
3
votes
0answers
41 views

Civi Ajax API Search by Multiple Tags

As sort of a followup to this question. I am trying to retrieve all the contacts who have tag:5 AND who have tag:7. I tried the following code: CRM.api3('Contact', 'get', { "sequential": 1, "...
2
votes
1answer
122 views

Extending “get” action with custom WHERE clause

Is it possible to define a new api (v3) endpoint which has a specific WHERE clause but that still leverages the flexibility of the "get" action in terms of defining parameters, options, pagination, ...
2
votes
1answer
114 views

Alias for chained API calls?

I have a query in which I need to chain api.Contact.getsingle twice, given that the entity I'm querying is linked to two different contacts for which I need to fetch the data. The problem is that, ...
4
votes
1answer
147 views

CiviCRM Ajax API - Searching by Tag

I'm working with the CiviCRM API and it's been great--I've been able to make a very useful tool for our team. However, I've encountered a problem. I would like to do a search on contacts based on ...
1
vote
1answer
45 views

Replace default Datatables script to most recent [custom buit] one

How do one properly replace default 3-rd party packages without loosing changes after updates? Namely, in need of Datatable CVS File Export, we've grabbed a custom DataTables built with all bells&...
1
vote
0answers
20 views

4.7.1 API query for contributions in same year returns no results

This worked correctly in 4.6.8, but not in 4.7.0 or 4.7.1. This query returns no results: $result = civicrm_api3('Contribution', 'get', array( 'sequential' => 1, 'receive_date' => array('...
1
vote
0answers
36 views

API get of multiple contact_sub_type returns no results

I have this problem on the Joomla demo site (4.6.0) and my own sites with versions 4.6.8 and 4.7.1. If I use the API explorer or run test php code, with a query checking for multiple contact_sub_type,...
4
votes
2answers
91 views

How do I use the joins feature of the new API

4.7 lists the ability to use joins for API queries, but I can't find anything in the docs or in the API Explorer. Can someone point me to documentation or examples?
2
votes
1answer
121 views

How to link to a stored invoice pdf with civicrm api

I can see that the invoices I have created are in the civicrm/custom map as invoiceID.pdf, but how can I link to them using Civicrm api?
1
vote
1answer
218 views

Unable to add file to event with Attachment api

I am new to CiviCRM and did not find any answer to this. I have a form on a Drupal page, and want to give ability to upload an image file in both Drupal and CiviCRM from within this form. I use the "...
3
votes
2answers
253 views

REST API - how to write new options for a custom field with select type?

Using the contact - getoptions method you can read the list of options for a custom field with select type. /civicrm/civicrm/extern/rest.php?entity=Contact&action=getoptions&api_key=userkey&...
0
votes
2answers
253 views

Send metadata to stripe payment processor

I would like to send the financial type to stripe as a metadata. The API instructions are here: https://stripe.com/blog/adding-context-with-metadata I just don't know where to modify Stripe ...
1
vote
2answers
54 views

Deleted flag missing from activities returned from API when getting by contact id

I would like to fetch activities by contact_id and only return non-deleted activities (or, failing that, return them all but filter them afterwards by is_deleted). But I find that passing is ...
3
votes
0answers
33 views

How can I specify in the spec for a new API that a parameter is an array?

How can I specify in the spec for a new API that a parameter is an array? I looked at the activity api for an example since target contact id is detected as an array in the API explorer. However, my ...
2
votes
1answer
109 views

Which value to use for tag_id to create EntityTag

I am struggling with adding tags trough the CiviCRM API to a newly created contact in an extension (trough API Chaining). The installation is running on Wordpress 4.4.1 with CiviCRM 4.7. The following ...
3
votes
1answer
95 views

CLI Contact Import is not importing address details

I have a local test environment on a mac where the site is installed. I'm trying to do a CLI import via the mac terminal and unfortunately, address details are not being imported. Command Used: php [...
6
votes
4answers
289 views

API: How do I delete a custom value?

I may be blind but I can't see any api call to delete a custom value?! CustomValue entity is missing a delete action. What am I missing?
1
vote
1answer
36 views

Overcome API KEY request at Relationship edit / delete for users of certain Drupal Role

Is it possible to skip api key check at Relationships delete? We'd like to create one-click link for altering Contact, where users of certain Drupal Role should be able to click "Resign" link and all ...
2
votes
1answer
33 views

hook_civicrm_permission in a drupal module

How should custom permissions created by hook_civicrm_permission be properly checked? Have defined custom permission like this: function mymodulename_civicrm_permission(&$permissions) { $...
1
vote
1answer
129 views

entityRef widget seems to not respecting params

Whatever has been tried, this code doesn't restrict entityRef widget output according to desired parameters: $selection = array(132, 168, 169); $sa_custom_props = array( 'api' => array('params' =...
2
votes
1answer
323 views

Chain API call cascade, pass second value as third call argument, “id is not a valid integer”

While making a cascade API call, a roadblock has been hit, here's a code: $result = civicrm_api3('Contact', 'get', array( 'sequential' => 1, 'return' => "id", 'id' => array('IN' => ...
2
votes
3answers
46 views

retrieve amount of male/female participants

I would like to retrieve the amount of male/female participants of an event. So far I am able to retrieve the total amount of registered people. How can I get a number for the amount of male and ...
2
votes
1answer
204 views

Contribution Note Smarty Variable

So I'm super close to getting a smarty variable working to place the contribution note in a thank you letter. I used the API explorer and got this far: {crmAPI var='result' entity='Note' action='...
5
votes
2answers
1k views

Get CSV via REST?

Is there a way to get CSV-formatted output via a REST call? We have a 3rd-party app that can import data periodically from a URL pointing to a CSV file, so the aim is to provide it with a Civi URL (...
2
votes
1answer
30 views

How to get max_amount, min_amount from Contribution Page

Issue: Coding wordpress plugin for civicontribute widget, I need to get some variables in order to build the progress bar. When I use civicrm_api3('contribution_page', 'getfields'); it returns a lot ...
2
votes
2answers
72 views

Drupal's cron job has no access to CiviCRM custom fields (Anon access to custom data?)

We're using a Drupal module (CiviNorth) which hooks into Drupal's cron execution and updates civicrm's records' custom fields. This has been failing due to the API calls not returning those custom ...

1
6
7
8 9 10