Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [api]

Questions about the CiviCRM API.

69 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
92 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 ...
Jon-man's user avatar
  • 846
3 votes
0 answers
91 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. ...
Sleewok's user avatar
  • 1,146
3 votes
0 answers
78 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 ...
someone's user avatar
  • 31
3 votes
0 answers
30 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?
ErikH - CiviCooP's user avatar
3 votes
0 answers
136 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. ...
yurg's user avatar
  • 2,050
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 ...
ñull's user avatar
  • 1,208
3 votes
0 answers
81 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'...
huulbaek's user avatar
  • 153
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, "...
Brad Xanti's user avatar
3 votes
0 answers
36 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 ...
lolcode's user avatar
  • 435
3 votes
0 answers
73 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(...
Borislav Zlatanov's user avatar
2 votes
0 answers
195 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 ...
SunriseGV's user avatar
2 votes
0 answers
12 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 ...
JDruery's user avatar
  • 21
2 votes
0 answers
62 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 ...
Phillip Money's user avatar
2 votes
0 answers
41 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; $...
Wouter H.'s user avatar
2 votes
0 answers
27 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 ...
Tobias Krause's user avatar
2 votes
0 answers
34 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: ...
lcdservices's user avatar
2 votes
0 answers
55 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 ...
repertor's user avatar
2 votes
2 answers
129 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 '...
Mike Steigerwald's user avatar
2 votes
0 answers
124 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 ...
twowheeler's user avatar
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 ...
Matthew Wire's user avatar
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: $...
yurg's user avatar
  • 2,050
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?
Lesley Evensen's user avatar
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' =&...
joshcanhelp's user avatar
1 vote
0 answers
17 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 ...
yurg's user avatar
  • 2,050
1 vote
0 answers
21 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 ...
emma's user avatar
  • 493
1 vote
1 answer
180 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: ...
Kerry Denten's user avatar
1 vote
0 answers
17 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 ...
Alessandro Bronzo's user avatar
1 vote
0 answers
16 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.
Aivars's user avatar
  • 1,034
1 vote
0 answers
47 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 ...
tanbog's user avatar
  • 317
1 vote
1 answer
132 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 ...
Rucc's user avatar
  • 13
1 vote
0 answers
39 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 ...
Kurt Leadley's user avatar
1 vote
0 answers
18 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 ...
emma's user avatar
  • 493
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 ...
Jack Donohue's user avatar
1 vote
0 answers
38 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 ...
Ozsvar's user avatar
  • 11
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
Gary Smith's user avatar
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.
Gufran Pathan's user avatar
1 vote
0 answers
23 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 ...
Caroline B's user avatar
1 vote
0 answers
71 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 ...
RobbieBMcg's user avatar
1 vote
2 answers
1k 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 ...
Brendan Spaar's user avatar
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 ...
Simon Walden's user avatar
1 vote
1 answer
225 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 ...
Jeff Salleh's user avatar
1 vote
0 answers
75 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": ...
JME's user avatar
  • 11
1 vote
0 answers
72 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 ...
asciimo's user avatar
  • 43
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 ...
Chris Burgess's user avatar
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 ...
user1536854's user avatar
1 vote
0 answers
133 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('...
yurg's user avatar
  • 2,050
1 vote
0 answers
135 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 ...
Norris's user avatar
  • 870
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 ...
Josh's user avatar
  • 11
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 ...
Tenz's user avatar
  • 127
1 vote
0 answers
23 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 ...
Pete's user avatar
  • 11