Questions tagged [api]
Questions about the CiviCRM API.
525
questions
0
votes
1
answer
18
views
Fetch Bounces Failure, Error message: Unknown api version
For some reason, the fetch bounce api method is unrecognized (Fetch Bounces Finished execution of Fetch Bounces with result: Failure, Error message: Unknown api version).
not sure if related to ...
0
votes
1
answer
28
views
civicrm_api3('Contact', 'create', in hook_civicrm_pre?
Getting a loop and consequently out of memory while executing the code:
function hook_civicrm_pre($op, $objectName, $id, &$params){
if ('Individual' === $objectName && 'edit' === $...
0
votes
0
answers
32
views
System status page not working and other loading errors after upgrade
After upgrading to latest CiviCRM (5.66.0) on WordPress. We have been getting errors loading the system status page, and sometime getting the default "The is an issue with your Wordpress site&...
0
votes
1
answer
17
views
How to delete all financial contributions via the API?
I want to create an extension to delete all financial contributions from the database. The database only contains simple contributions that are not tied to memberships or events.
The developers guide ...
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 ...
0
votes
1
answer
22
views
Can't store is_confirmation_enabled via API
I can't for the life of me store the value of is_confirmation_enabled for creating a new event via API. This is in a PHP file that creates new events on the front end of Joomla based on input ...
2
votes
1
answer
32
views
Use Order API or use APIv4?
I am using a script that creates a MembershipPayment to connect an existing Membership to an existing Contribution (bugfix for CiviSepa). This script produces the following error:
Deprecated: Not ...
1
vote
1
answer
22
views
Api get all option within sub entity
get all options from a sub entity named payment_instrument within a entity called OptionGroup
0
votes
1
answer
26
views
Permanently delete more than 100k trashed records
Is there a proper way to permanently delete more than 100k records already in trash ? For instance, Is there anyway to do this using the API ?
1
vote
1
answer
73
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
1
answer
55
views
Invalid field 'contact_id.is_deceased' Apiv4
CiviCRM 5.61.2., wordpress.
Hovering over icons on search results page brings "where was an error processing your request.." message and Invalid field 'contact_id.is_deceased' message
...
0
votes
2
answers
36
views
Activities created by API not emailing assignee
Creating an activity with either API (api3, api4) does not trigger an email to the assignee. Is this by design or is there a problem with my instance of CiviCRM? Activities generated via the GUI and ...
1
vote
1
answer
32
views
Error: Class "CRM_Dkbrapi_APIWrapper_Attachment" not found in dkbrapi_civicrm_apiWrappers()
This is my first module in CiviCRM and I have the example from the documentation but I can't get it to work. Every time I try to run in CiviCRM API Explorer v3 for attachments I get the following:
...
0
votes
1
answer
37
views
Where does the QR Code Extension store the value "enable qr code token for this event" in Database?
I installed the "QR Code Checkin" Extension in CiviCRM 5.58.1 with Drupal. When I create a new event, I can activate "enable qr code token for this event".
Now, I want to update my ...
0
votes
1
answer
24
views
How to list records from the given custom group via API?
I've custom data stored in custom fields. I've submitted few records as part of the same Contact.
I can use the following API to fetch information about custom group by:
$result = civicrm_api3('...
1
vote
1
answer
50
views
Nagios script returns 403 error when querying CiviCRM via Ajax API
I've recently started using the check_civicrm script from https://github.com/MegaphoneJon/check_civicrm
It works great and my monitoring is greatly improved. However, on some sites I get a 403 error ...
0
votes
0
answers
6
views
Updating a Payment via API Explorer v3
I want to update a Payment via the CiviCRM API Explorer v3. As the update command is deprecated, I tried to use create with the Payment ID.
I entered the Payment's data so the resulting PHP Call was:
$...
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.
0
votes
0
answers
19
views
Fatal error after restoring the Site from Backup
Catchable fatal error: Argument 1 passed to CiviCRM_WP_REST\Autoloader::add_source() must be an instance of CiviCRM_WP_REST\string, string given, called in /var/www/sites/public_html/wp-content/...
0
votes
0
answers
40
views
CiviCRM: access AJAX API not respected in Wordpress
CiviCRM 5.58.1, vanilla WordPress 6.1.1 with the default theme.
Both CiviCRM: access AJAX API and CiviCRM: access CiviCRM backend and API are checked. Still, executing
CRM.api4('Contact', '...
0
votes
0
answers
22
views
api pull custom field value based on id not label
Using API 4 (php), how do I retreive a custom field value for a specific contact, using the custom field id instead of the custom field name.
This works (for contact with id=1234), but requires the ...
0
votes
0
answers
26
views
Error message of "Found more than one Organisation with same Name"
Getting the following error whenever a user tries to create a new account on the system: CRM_Core_Exception: Found more than one Organisation with same Name. in civicrm_api3() (line 135 of /storage/...
1
vote
1
answer
31
views
Access event type details with query from wordpress
I'm writing a WordPress plugin to display a list of CiviCRM Events, but I'm having a difficult time figuring out how to obtain the label for the event type. I can retrieve the list of events, and the ...
0
votes
1
answer
10
views
How to find the number of participants of a past event?
How to find the number of participants happened in the past?
2
votes
1
answer
50
views
APIv4 Base URL for external applications
I am trying to write an external app with python, that should make a call to the CiviCRM's APIv4 to get a list of contacts & relationships.
I am using CiviCRM's with Wordpress and debian 11.
...
0
votes
1
answer
19
views
API Explorer DB error: Field 'entity_table' doesn't have a default value
I am using the CiviCRM API Explorer v3 and try to create a LineItem.
The following fields appear as obligatory fields for that:
'entity_id',
'qty',
'unit_price',
'line_total'
But when I try to create ...
2
votes
1
answer
77
views
API error: 'afform_type' is not a valid option for field option_group_id on OptionValue.create( entity name form)"
Getting this error out of sudden: apparently the only thing changed was "CRM/Core/Payment.php" file moved to the custom php directory and a "City" field attribute changed to "...
0
votes
1
answer
55
views
Database Connection Only Works Some of the Time
I have a CiviCRM instance that has its database hosted in RDS Aurora. This has worked well for several years. Recently I needed to restore from a copy of the Aurora cluster and I changed the name of ...
0
votes
0
answers
21
views
How to access entity newly created via API
How can one access, e.g., the newly created contact ID and relationship ID?
Code example:
$result = civicrm_api3('Contact', 'create', array(
'sequential' => 1,
'contact_type' => "...
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 ...
0
votes
1
answer
34
views
Getting fatal error when doing things with extension
Whenever Im doing anything with extensions Im getting this error
CiviCRM_API3_Exception: "API error: on OptionValue.getsingle"
#0 /home/lgsecrmo/hub.littlegate.org.uk/sites/all/modules/...
1
vote
1
answer
108
views
How can I call api directly from external http?
According to https://docs.civicrm.org/dev/en/latest/api/v3/rest :
"As of v5.47+, there should be no reason to use extern/rest.php -
other end-points should be more compatible and more featureful....
2
votes
1
answer
67
views
API3 Error Custom Fields
Deleted Custom Field set called Area and added a new custom field set called Regions and I get the below. I cannot access any Contacts now.
CiviCRM_API3_Exception: "'group_areas' is not a valid ...
0
votes
1
answer
23
views
PHP Fatal Error trying to create contribution with duplicate Transaction ID causes script to crash (using api4 on WordPress)
If I use the API Explorer V4, and I try to create a new contribution with a Transaction ID that already exists, then the response I get back is as follows:
status: 500, statusText: Internal Server ...
0
votes
1
answer
41
views
How to get Unique Opens with CiviCRM API?
I am getting summary report of email by using CiviCRM API but not able to get the field Unique Opens I can see on the report page.
Currently I am using this query:
$result = civicrm_api3('Mailing', '...
0
votes
1
answer
63
views
How can I write custom entites/ actions for api v3 - usage of api v4 for scheduled jobs
I want to define some scheduled jobs so that old data is deleted from time to time. For example contacts in trash, mailings older than X year, drafted mailings never sent... For scheduled jobs I need ...
1
vote
1
answer
64
views
Is the use of API4 already recommended?
I am currently working on a custom module for CiviCRM (5.48) and Drupal 9 (9.3.9)
I opted to use API4 but I notice that some things are missing compared to API3:
Contribution -> ...
1
vote
1
answer
217
views
API4 PHP Fatal error Uncaught API_Exception Authorization failed
So I was happily programming and testing away, and everything was working and then suddenly I started getting this error:
PHP Fatal error: Uncaught API_Exception: [0]: Authorization failed
thrown ...
0
votes
2
answers
124
views
Using API4 to get contact based on email match
The API Explorer is excellent for testing proper queries, but I can not figure out how to get a contact based on matching email address.
For example, I can get a contact based on a partial match of ...
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 ...
0
votes
0
answers
19
views
Creating UFField using API - error with field_name
I'm trying to migrate data using the API and I'm having issues with UFField. Some entries are inserted correctly while others give me the following error:
Fatal error: Uncaught API_Exception: [0]: The ...
1
vote
1
answer
24
views
Is there any way to apply two "NOT Like" conditions in Civicrm API?
Hi I am using Civicrm api v3. I am trying NOT Like condition with single condition it is working. But i need to apply two conditions with string1 and string2.
$contribution = civicrm_api3('...
1
vote
1
answer
28
views
api3 and contact.is_deleted when using "return", and discrepancy between api explorer and php code?
Scenario:
Contact id 2, is_deleted is set to 1. Permissions not an issue since running as admin and no acl's present.
Results:
api3 explorer: Ask for return value "contact is in trash" ...
1
vote
1
answer
114
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
1
answer
59
views
Make API queries - two methods failing
I'm trying to query my data for records with a given firstname/lastname pair (see Map firstname-lastname pairs to IDs for some previous context) using a couple different methods, and failing.
API4
The ...
1
vote
1
answer
29
views
Map firstname-lastname pairs to IDs
I have a long list of donations that I want to import. My first step was to ensure that all the contacts in the list exist in CiviCRM - that's done, and I spent a while deduplicating the records. ...
0
votes
1
answer
29
views
Missing attribute payment_processor_id of entity Contribution in API Explorer v3?
I created a PHP 7 script that uses an API Call to get some information about a specific Contribution with a $contributionID that has been defined before.
The code (below) works and correctly returns ...
2
votes
1
answer
56
views
Custom Fields and new version of csvimporter aka API csv Importer
I installed CiviCRM 5.41.0 and csvimporter 1.7. My overall goal is to import data from csv files. I created some custom fields, imported the standard fields using the standard importer and then ...