Questions tagged [api]

Questions about the CiviCRM API.

Filter by
Sorted by
Tagged with
5
votes
3answers
610 views

How to trigger a confirmation email when registering participants via API

We have a custom module that we use to do event registrations (non - paid), however i was wondering is there anyway through the API of being able to trigger CiviCRM sending a confirmation registration ...
4
votes
1answer
85 views

Why doesn't API for Contribution Get work with multiple Financial Type ID values?

I have this problem on my Joomla 4.6.2 system, and can reproduce it on the Joomla sandbox. If I use the API Explorer to build a query like: $result = civicrm_api3('Contribution', 'get', array( '...
7
votes
2answers
351 views

How to get the new record ID, when adding a record to a multi-value custom field using the API?

The API calls I know of that add a record to a multi-value custom field, don't return the ID of the added record (which you can then use to access the value for the specific record in the form ...
1
vote
1answer
80 views

Need to create a SepaMandate for street walkers?

Business logic: Customer sends out street walkers who recruit recurring donors on the streets with forms in their hands (or on their tablets). They need to create SEPA mandate reference numbers in ...
3
votes
1answer
43 views

How to convert/import participants with partial payments

I've tried importing participants in the standard way, then importing contributions for their event deposits (partial payments), then using API CSV import to connect them via a ParticipantPayment ...
0
votes
1answer
68 views

How to create a custom action within context of the current record [duplicate]

My goal is to display a link or button for a given participant record on the Events tab of a contact record (or possibly within the More link in participant search results). On click, it will open a ...
5
votes
2answers
225 views

How to renew membership during event registration?

I've set-up an event with several fee options that include "event fee plus 1 year membership renewal", "event fee plus 2 years membership renewal", etc. How do you suggest implementing the membership ...
1
vote
1answer
100 views

Error "No payment information found for this record" when connecting multiple participants to a single payment via API

I've been working on a camp registration page where an adult registers one or more children for one or more events, with a single Pending contribution to tie it all together (per Xavier's advice here)....
3
votes
1answer
89 views

Why does PHP Contribution API not filter on contact_id in 4.6.2?

We recentely upgrade from 4.5.x to 4.6.2 and after that the following API call from PHP does not filter on contact_id and return all contributions for all contacts. $params = array( 'contact_id' =...
2
votes
2answers
115 views

How to use a CiviCRM generated form in an Android App

I'm programming an Android App for a company, and they use CiviCRM for subscribing to newsletters. The form is available to anyone online, but I have to add the form in an android app. On the android ...
4
votes
2answers
351 views

CiviCRM API with Custom Data mixed with Standard Entities

I'm using CiviCRM 4.6 with the new API editor. I'm attempting to chain a bunch of queries together, which provide cases for a client within a period, along with the linked contact, along with custom ...
5
votes
2answers
101 views

How to clear pseudoconstant cache?

I find that if I create a new tag via the api, and then try to attach it to a contact with the entity_tag api, it will sometimes fail with the message "'##' is not a valid option for field tag_id". ...
6
votes
2answers
141 views

Can I auto update Civi data w/ data from my listserv?

has anyone integrated an email listserv with CiviCRM? It would be nice to have a Civi group of 'advisors' and also a listserv, and when there are changes to subscriptions on the listserv, it is ...
6
votes
2answers
155 views

How do I use the API to access protected custom data in a hook?

I have custom data for events that is not visible to anonymous users (it's for internal use only). I want to access that data from my implementation of hook_civicrm_post(). When I call the API "get" ...
2
votes
1answer
172 views

How do I use CRM_Utils_Request::retrieve when the POSTed field is an array?

In the snippet below, I build api calls by looping through each student, and then each event within that. However, the field data is coming straight from the request with no server-side validation. Is ...
5
votes
2answers
375 views

How do I get a chained restful API call to return xml?

This query string will return a contact record and related phone records for Contact ID 1234 in json format: entity=Contact&action=get&json={"contact_id":"1234","api.Phone.get":{}} How do I ...
2
votes
1answer
126 views

How to debug chained API calls

How can I get back a dump of the full param array when a chained api call fails, so that I can see what values are coming back from the previous call and going into the chained call (and thus better ...
3
votes
1answer
165 views

Can I use multiple values in an api Get call?

For example, can I use a single api call to get all the contributions from contact a and contact b. My actual need is to get contributions from the contact and any related contacts, but I assume I ...
2
votes
2answers
131 views

Why is format returned for multi-select custom field API different for Contact vs. Relationship?

I have contacts with an Alphanumeric/CheckBox custom field on, and I have relationships with an Alphanumeric/CheckBox custom field on. (The former is legacy and is copied into the latter.) These seem ...
1
vote
1answer
719 views

How to use API chaining to create a contact and a relationship

I've read all the docs I could find, the code examples, the 4.6 explorer, but I'm not grasping one piece. Below is code to create a new adult contact (via profile submit, to get some extra validation ...
7
votes
2answers
141 views

How is the restful API secured?

In order to access the API securely what do I need to do? Is it as simple as using https and letting my CMS manage session authentication?
3
votes
1answer
203 views

Example of adding multi-record custom fields to a contact via API

When I attach a multi-record custom field group to a profile for contribution pages, Civi only allows visitors to enter the fields once. I've read through jira a bit and see that the capability isn't ...
4
votes
2answers
574 views

Why am I getting no values when using REST api?

I've mainly used the php apis in the past but I would like to use the REST API. I added an api key to the contact record, and I attempted to use the really simple example in the documentation. Yet I ...
4
votes
2answers
283 views

Is there a CiviCRM hook or other method which can be used to push data updates to other systems?

We are attempting to keep two systems in live sync with each other, one is CiviCRM. There are hooks in civicrm for: Pre database saving of data hook_civicrm_pre($op, $objectName, $objectId, &$...
7
votes
4answers
755 views

What is the correct way to work with custom data in the API?

I always seem to struggle to find a concise way of working with custom data via the API. I know that something like... $updateParams = array('version' => 3, 'contact_id' => $contact_id, '...
7
votes
4answers
396 views

Where is the CiviCRM ERD / data-dictionary?

In a variety of contexts it is useful to have a Entity Relationship Diagram (ERD) / data-dictionary: Using the API (Xavier avert your eyes) querying the database with SQL Developing extensions; and ...
4
votes
3answers
159 views

How do I send mailings to subsets via the API?

This is a big question :-) I'd like to be able to use the API to send mailings to subsets of groups. What is the simplest way to achieve this? Ideally I'd like to be able to define a subgroup using ...
5
votes
4answers
329 views

Are there public repos including WordPress WooCommerce and CiviCRM integration code?

On a WordPress / CiviCRM installation, we need to do a bunch of customization on its payment pages. We want to do it in WordPress since there are WordPress plugins that can help do things like ...
15
votes
6answers
666 views

What's the best way to import memberships and their associated contributions?

I have a load of Memberships to import. Each has a linked Contribution. While I can import Memberships and Contributions separately, I cannot find a way to import the two together - in other words ...

1
6 7 8 9
10