Questions tagged [apiv4]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 views

Php Standalone Skript doesnt Query Database, APIv4 Simple Example

I tried to write a Standalone PHP-Skript for CiviCRM and looked after the Simple Example, but unfortunately it doesnt return something. <?php require_once '/var/www/html/wp-content/plugins/civicrm/...
user avatar
  • 11
1 vote
0 answers
18 views

Class 'Civi\Api4\Event\Subscriber\SearchKitSubscriber' not found

I've been finding recently that our cron is often failing. Our host doesn't keep output from the cron processes in the logs, so it's hard to establish the differences between the times that it works ...
user avatar
0 votes
1 answer
15 views

Odd REST API result

I am using civicrm on drupal 7. I have configured my Civi instance to accept external REST API calls with authentication. I want to get all the values from a set of custom fields associated with an ...
user avatar
  • 325
2 votes
0 answers
32 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 ...
user avatar
1 vote
1 answer
14 views

How to get Price Sets related to a Contribution Page using API 4

I am trying to use the API 4 to get all the related Price Sets for a given Contribution Page. I am having a hard time with this, being new to the API and the join function. Any help? In API 3, Price ...
user avatar
  • 11
0 votes
1 answer
32 views

How to remove APIv4 extension

Sorry if this has been asked before, but I couldn't find it if so. How can I remove the obsolete APIv4 extension cleanly? There's no disable or uninstall uption on the Extensions page. Thanks.
user avatar
  • 1,222
1 vote
1 answer
43 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 -> ...
user avatar
0 votes
1 answer
35 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 ...
user avatar
  • 409
0 votes
2 answers
27 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 ...
user avatar
  • 409
1 vote
1 answer
18 views

Is acl entity role available in Api4 explorer?

I'm pretty sure the acl_entity_role entity is supported by CiviCRM APIv4. Why doesn't it appear in the entity list on civicrm%2Fapi4#/explorer/ ?
user avatar
1 vote
0 answers
13 views

API4 GroupContact does not update Subscription History?

When I use the API4 GroupContact update I do not have the option to change the date of the change (which is kept in civicrm_subscription_history). Also, when I use the update to set the status to ...
user avatar
1 vote
1 answer
30 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 ...
user avatar
0 votes
1 answer
49 views

Group of unsolvable API and core errors

I really would appreciate any advice to dig deeper into the debugging of some errors. The reason may lay in our installation which is grown since late 2015 (I think it was version 4.2) and widely ...
user avatar
  • 1,272
3 votes
3 answers
62 views

How to see the SQL generated by Api4 calls?

When trying to express SQL joins with API4 I feel the need to check the SQL that's being created, as there's some 'magic' that might or might not be happening. It wasn't clear to me how to do this.
user avatar
  • 3,688
2 votes
1 answer
40 views

Best (api4) way to chain save a contact so that the email updates, without creating a new one?

Using civicrm api4, what's the best way to chain save a contact so that the email updates, without creating a new one? For example, I want to update this existing contact: entity: Contact, action: get,...
user avatar
0 votes
1 answer
40 views

API V4 - Uncaught Exception: Authorization failed

With this code I created contact, but only when I'm authorized. civicrm_api4('Contact', 'create', [ 'values' => [ 'contact_type' => 'Individual', ...
user avatar
  • 39
0 votes
2 answers
50 views

How to get Target Contacts from Api4 Activity.get call?

I have an Api4 call that gets a particular set of activities. I'd like the call to return the names of the "target"/"with" contacts. I've tried: Joining the Contact directly "...
user avatar
  • 3,688
0 votes
1 answer
48 views

Searchkit Buttons not working

Using beta version of SearchKit. Buttons for Add, Compose Search and AND,OR,Not options are not working/unresponsive.
user avatar
  • 1,139
3 votes
1 answer
29 views

api4: get(FALSE) vs get()->setCheckPermissions(FALSE): which is preferred?

In ap4, there are apparently two different ways to specify skipping permissions: In the api4 browser at /civicrm/api4, when you un-check the "CheckPermissions" checkbox, the action method is ...
user avatar
  • 1,672
1 vote
1 answer
33 views

Validating options in API4?

Is there a way to make APIv4 validate options when creating/updating? For example, using the demo data I can run: $ cv api4 Contact.update '{"where":[["id","=",202]],&...
user avatar
  • 11.2k
0 votes
2 answers
142 views

Use complete address and full county name in mailings

Working on a mailing that includes contacts full address details. And I'm encountering an issue for UK addresses where the county is abbreviated in the same way US states are. I've never seen such 3-...
user avatar
4 votes
1 answer
52 views

Finding contacts without relationships (API)

How can I find contacts using the APIv4 that don't have any relationships of a specific type? I want the first n contacts ordered by a date field meeting various conditions excluding those with a ...
user avatar
  • 11.2k
0 votes
0 answers
39 views

apiv4 no longer sees custom fields that allow for multiple entry

I just noticed an error on a site I maintain. Some custom code uses apiv4 to return a value from a set of custom fields (on individual contacts) and that function now throws an error: API_Exception: ...
user avatar
  • 590