Questions tagged [api]

Questions about the CiviCRM API.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

civi api response limit working in postman but not in javascript

I created a postman test with api4 of civicrm. It adds to the body as x-www-form-urlencoded: key: params value: {"limit": 5} This works fine and returns only 5 results. I tried to do the ...
Gesko's user avatar
  • 11
1 vote
1 answer
77 views

Do strings used in API version 4 need to be escaped?

When running something like this: $result = civicrm_api4('Event', 'get', [ 'select' => ['id'], 'where' => [ ['OR', [ ['title', 'LIKE', $keyword], [...
marcelo2605's user avatar
1 vote
1 answer
43 views

CIVICRM: Custom Field that uses financial type id

I'm new to Civicrm PHP and extension development so I'm sorry if this is a dumb question. ^-^ I'm making an extension that creates a new custom field group, the custom field group is meant to ...
BellaDoll's user avatar
2 votes
1 answer
82 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 ...
Hilary Binder's user avatar
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' === $...
yurg's user avatar
  • 2,005
0 votes
0 answers
61 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&...
sweetwater_media_inc's user avatar
0 votes
1 answer
18 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 ...
cray146's user avatar
  • 153
1 vote
0 answers
15 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,005
1 vote
0 answers
19 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
  • 463
0 votes
1 answer
23 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 ...
MtnPavlas's user avatar
  • 846
2 votes
1 answer
39 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 ...
emma's user avatar
  • 463
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
James's user avatar
  • 11
0 votes
1 answer
33 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 ?
Pierre's user avatar
  • 15
1 vote
1 answer
140 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
15 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
1 answer
63 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 ...
yurg's user avatar
  • 2,005
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 ...
wil_SRQ's user avatar
  • 693
1 vote
1 answer
34 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: ...
ItsMe's user avatar
  • 133
0 votes
1 answer
43 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 ...
emma's user avatar
  • 463
0 votes
1 answer
27 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('...
kenorb's user avatar
  • 129
1 vote
1 answer
69 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 ...
kapn's user avatar
  • 897
0 votes
0 answers
10 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: $...
emma's user avatar
  • 463
1 vote
0 answers
15 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
0 votes
0 answers
20 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/...
damo-dev's user avatar
0 votes
0 answers
55 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', '...
yurg's user avatar
  • 2,005
0 votes
0 answers
24 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 ...
jsherk's user avatar
  • 541
0 votes
0 answers
29 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/...
JonathanBP's user avatar
1 vote
1 answer
34 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 ...
Paul Dufresne's user avatar
0 votes
1 answer
11 views

How to find the number of participants of a past event?

How to find the number of participants happened in the past?
Quiana's user avatar
  • 1
2 votes
1 answer
56 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. ...
Rafa Gomez's user avatar
0 votes
1 answer
28 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 ...
emma's user avatar
  • 463
2 votes
1 answer
85 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 "...
yurg's user avatar
  • 2,005
0 votes
1 answer
61 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 ...
Josh's user avatar
  • 877
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' => "...
MtnPavlas's user avatar
  • 846
2 votes
0 answers
185 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
0 votes
1 answer
38 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/...
Tony Horrocks's user avatar
1 vote
1 answer
126 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....
MikeSteigerwald's user avatar
2 votes
1 answer
72 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 ...
Paul Williams's user avatar
0 votes
1 answer
25 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 ...
jsherk's user avatar
  • 541
0 votes
1 answer
43 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', '...
hazalciplak's user avatar
0 votes
1 answer
76 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 ...
Tobias Krause's user avatar
1 vote
1 answer
71 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 -> ...
Wouter H.'s user avatar
1 vote
1 answer
269 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 ...
jsherk's user avatar
  • 541
0 votes
2 answers
170 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 ...
jsherk's user avatar
  • 541
1 vote
0 answers
42 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
0 votes
0 answers
20 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 ...
lapmir's user avatar
  • 51
1 vote
1 answer
26 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('...
jagjeet's user avatar
  • 101
1 vote
1 answer
29 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" ...
Demerit's user avatar
  • 22.6k
1 vote
1 answer
125 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
1 answer
69 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 ...
Ken Williams's user avatar

1
2 3 4 5
11