Questions tagged [api]
Questions about the CiviCRM API.
70
questions with no upvoted or accepted answers
4
votes
0
answers
90
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
0
answers
82
views
Get list of extensions with upgrades available (from command line)
I would like to know if it is possible to use the command-line to get a list of extensions that have upgrades available. I want to then use that to run cvapi extension.download to install the updates.
...
3
votes
0
answers
72
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
0
answers
29
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?
3
votes
0
answers
133
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
0
answers
25
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
0
answers
80
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
0
answers
46
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
0
answers
35
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
0
answers
71
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
0
answers
167
views
API v4 REST on Wordpress not returning any data
Problem:
I am attempting to use my CiviCRM instance's API v4 REST endpoint to get and post data. I eventually want to script tasks like importing new contacts and event registrations using Python, but ...
2
votes
0
answers
9
views
Api4 does not delete values table when deleting a Custom Group
I'm using Api4 to remove a Custom Group upon uninstalling an extension. The api call looks like
\Civi\Api4\CustomGroup::delete()
->addWhere('id', '=', $idOfCustomGroup)
->execute();
The ...
2
votes
0
answers
60
views
Use Civicrm with Callhub
I would like to use Civicrm in phone banking. I have managed to link Callhub and Civi together so that a phone call is recorded against a user's name. You can also record some of the call information ...
2
votes
0
answers
40
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;
$...
2
votes
0
answers
26
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
0
answers
33
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
0
answers
54
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
2
answers
122
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
0
answers
122
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 ...
2
votes
0
answers
61
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
0
answers
62
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
1
answer
117
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.
2
votes
0
answers
14
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
0
answers
46
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
0
answers
12
views
Batch Memberships Update via Profile - Expiration Date changes not saved due to "Is_override" field not avail in Profile
Thought it is possible to batch update a few membership statuses via profile, wanted to clear Expiration Dates, however changes only partially stick: while Status saves, Expiration Date stays, which ...
1
vote
0
answers
18
views
How can I create a Membership Payment with the Order API?
I have a script that is (among other things) a workaround for a bug in CiviSEPA extension. For this workaround, I need to create a Membership Payment to connect an existing Membership with an existing ...
1
vote
1
answer
79
views
I have the dreaded "[unauthorized: Authorization failed" error on a WordPress dev site
We're testing CiviCRM to determine if it's fit for our purpose. Tests were going well until we hit an unexplained snag for which we can't find a definitive fix. The error is as follows ..
Fatal error: ...
1
vote
0
answers
13
views
API 4 problem while running composer
everybody.
Since the installation of CiviCRM I have problems in composer.
Another installation, on the same VPS, is not causing any problems.
The website is a Drupal based one (9.5.10)
I started it ...
1
vote
0
answers
14
views
Problems with API Key Management (v1.3.5) extension?
When I go to API Key section, it does not provide any controls to add or remove keys, just two narrowish grey lines where key should be.
Is it a bug and how to fix it?
CiviCRM 5.53.0 on Drupal 7.
1
vote
0
answers
38
views
UUID Auto field for Custom field
I want to create something like a UUID field for a custom multi-value fieldset that I will consume from an external API call.
In other words: I have contacts that can have multiple versions of a ...
1
vote
1
answer
115
views
How to compose HTML Body from a Mosaico Template content?
I amb creating a Mailing via API calls. I dynamically create the Moisaico code. But when the Email gets created, it doesn't have any HTML code, so I can not send it. How can I get the HTML code from ...
1
vote
0
answers
35
views
Nested entity and API endpoints for a custom extension
I am working on an extension and I want a particular API endpoint structure. I'm trying to have this structure:
Based on the documentation here, having entities created as direct children to the v3 ...
1
vote
0
answers
17
views
redaction_tool (johnff/redaction_tool) throws error in API explorer
I want to try out redaction_tool in the CiviCRM Api explorer v3, so I can later use the redact API call in a script. So I called the redact method on Contact with a certain Contact ID.
But the API ...
1
vote
0
answers
24
views
Bulk emails created with the APi delivered to 0 recipients
I'm using the API to send a bulk email each week to all our members. This is the code:
$currentTime = new DateTime();
$approval_date = $currentTime->format('Y-m-d H:i:s');
$currentTime->add(new ...
1
vote
0
answers
37
views
Where can I find CRM javascript object?
I want to use CRM.api3('Email', 'create', { ... call in my javascript. But the object CRM doesn't exist on my website. Which js file do I need to load to access that CRM object? I thought I'd load it ...
1
vote
0
answers
6
views
GlobalPayments API
Has anyone successfully integrated GlobalPayments into CiviCRM?
I'm running on WordPress, and there is an API for WP, but I can't find one for CiviCRM.
Thanks
1
vote
0
answers
18
views
Rest API for Reserve and Interview Respondents
Is there a way to Reserve and Interview Respondents using the Rest API? Couldn't find a way to do it using the 'Survey' Entity.
1
vote
0
answers
21
views
API csv import unable to import addresses
I am importing a large dataset using the API csv import extension.
I have imported the custom fields, contacts, email and phone numbers using the different entities.
I have tried to import the address ...
1
vote
0
answers
60
views
CiviCRM API issue
On our multi-site build we have been using the API functionality to send member info to a partner platform so that when a member logs in to our one of our websites and clicks a link their information ...
1
vote
2
answers
950
views
SpamAssassin marking mailings as compromised WordPress site
A few of my constituents have told me that my emails are going to their Spam folder in Gmail. I did some digging with mail-tester.com and found that SpamAssassin is dinging my mailings -1.629 points ...
1
vote
0
answers
22
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
1
answer
201
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
0
answers
71
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
0
answers
71
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
0
answers
40
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
0
answers
43
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
0
answers
132
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
0
answers
132
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
0
answers
28
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
0
answers
69
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 ...