Questions tagged [api]

Questions about the CiviCRM API.

51 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
18 views

API4 authorization failure when creating a participant

I am currently trying to create a participant on a Drupal form submit, when i do this I get an error saying Authorization failed. I've tried managing the ACLs in Civi with no success, I've also ...
3
votes
0answers
50 views

Too many tables - MySQL limitation - CiviCRM API errors

On CiviCRM 4.6.31 We have seen CiviCRM errors with SQL LEFT JOINs relating to custom data sets. It appears there is a MySQL limitation on how many tables can be joined. This impacts on a number of ...
3
votes
0answers
78 views

Get date in CiviCRM default date format in custom Drupal module

Preamble I write a Drupal7 module which allows CiviCRM event registration form design alter. While getting a list of events from CiviCRM, the module performs some checks against events properties. ...
3
votes
0answers
24 views

How are API calls logged consistently as a specific user?

I wrote some extensive scripts that are run through drush. I use the --user= switch in the drush command that supposedly runs the script as that user. The chosen user has a CiviCRM contact ID too ...
3
votes
0answers
42 views

Will unsupervised dedupe rules be used in API Contact create?

I want to import an old database using API Contact create. In the de-dupe rule documentation it mentions "They are also used when you Import contacts". I see in the API documentation that there exists ...
3
votes
0answers
76 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'...
3
votes
0answers
39 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, "...
3
votes
0answers
27 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 ...
3
votes
0answers
57 views

How does contribution.repeattransaction set the invoice_id?

Upon calling the API's contribution.repeattransaction, the original contribution record seems to get copied correctly, with the exception of invoice_id. Here is what I'm doing: $result = civicrm_api3(...
2
votes
0answers
9 views

API: Update a specific multi value field set record

I created a custom field set with three fields, the field set does allow multiple records. The aim of this field set is to collect data about candidacies and mandates of politicians, such as the ...
2
votes
0answers
25 views

Custom API not recognized by explorer/cv

I'm troubleshooting an issue where some custom APIs (v3) via an extension are not recognized by the site, either in the API explorer or when attempting to run them via cv. The situation is puzzling: ...
2
votes
0answers
34 views

API v3 Include Some Tags and Exclude Others

I can do a custom search on Contacts to include those with a list of tags, and exclude those that also have an additional tag. And I get the results I expect. I can't for the life of me figure out ...
2
votes
0answers
19 views

Has anyone done anything integrating Facebook Donations?

We have a potential customer who is interested in using the Facebook Donate API to integrate with CiviCRM. Any work been done on this already?
2
votes
1answer
79 views

Why won't CRM.loadForm render url containing civicrm/a/#?

This call: CRM.loadForm(CRM.url('civicrm/a/#/tournament')); works very well for any url that does NOT contain 'civicrm/a/#'. As soon as I try to open anything from an extension, the popup stays '...
2
votes
1answer
36 views

API call for ACL roles no longer works

I have an API call to get ACL roles that worked before I upgraded to 4.7.29 (I think I was at 4.7.22). Now, this returns no results: $entity_id = $group["id"]; $apiParams = array("entity_id" =...
2
votes
0answers
55 views

Memory leak in bulk actions

I've recently being doing some bulk import/export/delete using the /civicrm/import/contact for import/export /civicrm/contact/search/advanced for delete I've done some timings for the bulk delete ...
2
votes
0answers
51 views

Find contacts with multiple relationships of same type

We try to gather total number of users of same Relationship Type but different number of Relationships (mean, user can be a Member of no / 1 / 2 3 .. etc. Organisations). Here's a code we use: $...
2
votes
0answers
13 views

Should there be a civicrm_api3_membership_log_add/delete'

Membership_add and delete are part of civicrm_api3 API, should they either be updated to write to membership_log file or should there be civicrm_api3_membership_log API calls?
2
votes
0answers
41 views

Participant Get API pulls no records first time, correct number after

I'm using the v3 API to pull a list of participants for an event record. The call I'm making is: $result = civicrm_api3( 'participant', 'get', array( 'event_id' => $event_id, 'options' =&...
1
vote
0answers
22 views

Related membership gets deleted upon updating owner membership via API

I would like to make several people a member, linked to 1 payment person A: membership (+ contribution) person B: membership (related to membership person A) $contact_a = 2; $contact_b = 3; $...
1
vote
0answers
15 views

Create API not updating database in new extension - what have I missed?

Help, built new extension, form displays, accepts input, but never updates the database The returns I get from all functions do not show errors. What the heck am I doing wrong???? It's going to be ...
1
vote
1answer
33 views

Attachment URLs incomplete on remote server only

I'm working locally on my Mac with the latest version of CiviCRM on latest WordPress, served by MAMP. Using the API, I create an attachment to a contact, and those attachments successfully display ...
1
vote
0answers
10 views

How to create an v4 api using civix tool?

I am using civix tool to create an extension. I created an API using civix tool.I want to create API v4. How to create API v4?
1
vote
1answer
39 views

React with CiviCRM APIs

I am trying to use the CiviCRM APIs from my React application. Which API methods would be the one recommended or easy to do with React application ? The easiest would be REST but since my page and ...
1
vote
2answers
38 views

API problem regarding to Word Replacement

I want to replace a word. I was trying to insert using API3 but it is not working properly. Word replacement API3 $result = civicrm_api3('WordReplacement', 'create', [ 'find_word' => "...
1
vote
1answer
48 views

Fetch membership type along with the contact details with civicrm_api

I am trying to create a lists of contact along with the membership type associated with each contact. Below is the code I have: $result = civicrm_api3('Contact', 'get', array( 'sequential' => ...
1
vote
0answers
50 views

Chaining Participants creation using REST API

I'm trying to create an event and chain the participants creation using the REST API from python. My attempt goes like this: import requests params = { "key": "key", "api_key": "apikey", "json": ...
1
vote
0answers
60 views

Wordpress custom contribution and newsletter signup forms

How customizable are the contribution forms? I have created a standard contribution page from the CiviCRM plugin, but I would like to hammer it into a very stylized design. Alternatively, is it ...
1
vote
0answers
27 views

How can I get donation amounts for a Contribute Page or Event via API?

Is it possible to retrieve amounts on a contribution page via API only? I can retrieve the details of a CiviCRM Contribution Page via API. cv api ContributionPage.get id=1 A missing detail I'd like ...
1
vote
0answers
71 views

How to trigger USPS address standardization on API address create?

It looks like addresses created by an API call do not go through the USPS address standardization routine. Is there a way to trigger the standardization through the API? Or what is the BAO function ...
1
vote
0answers
33 views

Creating event with address and fee details with event create API(single request)

Am want to use civicrm event create API to create an event with address and fee information but it's adding event data(to civicrm_event table) only, address and fee data not created. Is it possible ...
1
vote
0answers
92 views

Chain API call multiple parameters issue

We haven't been able to get executed "is_active" parameter here: "api.Relationship.get": "is_active":1,"relationship_type_id":59} while "relationship_type_id" works. Here's a full query: CRM.api3('...
1
vote
0answers
106 views

How to programatically add an email to a newsletter?

I am migrating from MailChimp to CiviCRM with Sparkhost (seemingly a great option for installations on Bluehost or other hosts which don't support VERP.) I have a few places where the MailChimp API ...
1
vote
0answers
23 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
0answers
63 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 ...
1
vote
0answers
20 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 ...
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
33 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,...
1
vote
0answers
109 views

Smart Group create/alter via API

What would be the best way of batch Smart Group creation using Relationships data, where Organisation name, taken from Individual Relationship data, should become a Smart Group title and all ...
1
vote
0answers
57 views

Looking for the best way to re-create the contribution page form using the REST API

I'm pretty new with CiviCRM but not with integrating API's in general. I'm looking to re-create a contribution form using only the REST API. Is this even possible? I had started looking around the ...
1
vote
0answers
101 views

REST API issue with chained call

Having a horrible time trying to get api.Contact.get into the URL. The api explorer always puts into a &json{} array. api.Contact.get is an empty array and that defeats most other ways of ...
1
vote
0answers
33 views

How can I automate printing address labels?

Is there an API call available which could automatically create address labels? This could be very handy with CiviRules, to have an automatic API-action to create address labels overnight.
1
vote
0answers
94 views

Why do I have an error when trying to update relationship using CiviCRM API

Since this morning I'm running into something strange when using the API to update a relationship. Here is my code : CRM.api3('Relationship', 'create', { "sequential": 1, "id": 11, "...
0
votes
0answers
17 views

Help with Custom Function

I want to create a button that i can click that create relationships for the employee if the Employer has a relationship. So if "Employer 1" has a relationship then all Employees of Employer 1 will ...
0
votes
1answer
33 views

Does CiviMobileAPI generate any logs?

I enabled CiviMobileAPI extension and Civi CRM Api Fix plug in (I'm using Wordpress) but can't login in the CiviMobile app (iOS). It keeps showing the Server API Error (Unknown error) message. I ...
0
votes
1answer
22 views

API Contributions and Payments

I'm using the API to create Contacts start Memberships through a signup form. We are offering 1-year memberships at various price points, and I have those set up in CiviMember. My code successfully ...
0
votes
0answers
16 views

Hook to change names of reccuring events

I am going to shut my other question and try and rewrite more clearly here. I have recurring events. I want to change the name of these recurring events to add the date to them, so each one is easily ...
0
votes
0answers
17 views

CIVIX: Booted CiviCRM, but failed to find 'api/class.api.php'

without apparently making any change to the environment, suddenly, the following creation of a job with civix: php civix.phar generate: api --schedule = Daily Give ImportFromGive fails with error: ...
0
votes
0answers
16 views

CiviRules email says it's been delivered, but it hasn't delivered / says it's from “Unknown Sender”

Using: CiviCRM 5.10.4 Drupal 7.65 E-mail API (org.civicoop.emailapi) 1.19 API v4 (org.civicrm.api4) 4.3.0 CiviRules (org.civicoop.civirules) 2.5 I've just input a new CiviRule with the following ...
0
votes
2answers
55 views

condition on count from chained api call

I am trying to use the api to get all contacts without an address with locationtype billing. For this I use the contact get api, and do a chained address get call. Is there a way to put a condition on ...