Questions tagged [api]

Questions about the CiviCRM API.

Filter by
Sorted by
Tagged with
2 votes
0 answers
17 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
0 votes
1 answer
23 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/...
user avatar
0 votes
1 answer
34 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....
user avatar
1 vote
1 answer
21 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 ...
user avatar
0 votes
1 answer
11 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 ...
user avatar
  • 343
0 votes
1 answer
25 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', '...
user avatar
0 votes
1 answer
22 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 ...
user avatar
1 vote
1 answer
40 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
25 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
  • 343
0 votes
2 answers
26 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
  • 343
1 vote
0 answers
14 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 ...
user avatar
  • 323
0 votes
0 answers
17 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 ...
user avatar
  • 11
0 votes
0 answers
18 views

Creating contributions using the SFirm software from Sparkasse

We collect membership fees via SEPA debit using a software from the german bank Sparkasse called SFirm. Has someone experience how to call the CiviCRM Api when a debit was collected in order to create ...
user avatar
  • 113
1 vote
1 answer
20 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('...
user avatar
  • 91
1 vote
1 answer
17 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" ...
user avatar
  • 17.9k
1 vote
1 answer
51 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 ...
user avatar
  • 13
1 vote
1 answer
28 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
1 vote
1 answer
27 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. ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
  • 431
2 votes
1 answer
31 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 ...
user avatar
  • 21
1 vote
0 answers
26 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 ...
user avatar
1 vote
1 answer
31 views

Assigning existing activity to case via api fails silently - is deprecated activity revisions necessary?

Gurus, it seems that api3 civicrm_api3('Activity', 'create', [ 'id' => 1234, 'case_id' => 12, ]); does not assign the activity to the case. From my reading of funtion ...
user avatar
  • 1,272
0 votes
1 answer
42 views

Create Contact from PHP

Whats wrong with this code? After submitting my form, I want to create a new contact in CRM via PHP, but it returned 500 $result = civicrm_api4('Contact', 'Create', [ 'where' => [ ['...
user avatar
  • 39
0 votes
1 answer
19 views

Get an API key for civi update and mailings

My developer has asked me to provide an api key so that they can upgrade our version of civiCRM and set up cron and mailing system. I have no idea how to do this....
user avatar
0 votes
0 answers
35 views

Issue with WP Rest API

I've a CiviCRM 5.37 installed with a WP 5.72 in a Linux server. As a permalink WP setting I defined the "article name" syntax. Well, my problem is the follow: When I create a new mail and I ...
user avatar
1 vote
0 answers
16 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 ...
user avatar
  • 431
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 ...
user avatar
0 votes
1 answer
122 views

Has anyone got a recent example of a REST client under Drupal 9, possibly using AJAX?

I am trying to work out a way of presenting contact information from CiviCRM to another server, but am struggling to work out how one would code it. Has anyone got an example of something that works ...
user avatar
0 votes
1 answer
30 views

What does 'Number of Items to Process For Each Queue Item' mean when using the API Importer extension?

I'm using Civi 5.35 and Drupal 7. We've installed the API CSV Import extension. At ~/civicrm/index.php?q=civicrm/csvimporter/import , I see a place to enter "Number Of Items To Process For Each ...
user avatar
1 vote
1 answer
41 views

Using the LIKE operator with a wildcard using API v3's REST interface

I am trying to do a simple GET request using a LIKE operator with a wildcard. It's easy to set up the explorer and works as expected. I'm using a demo civi environment using the example data included ...
user avatar
1 vote
2 answers
59 views

What's the right syntax for the API3 "replace" action for the "WordReplacement" entity?

I'm trying to call the WordReplacement API v3 with the replace action. The APIv3 Explorer tells me the right PHP syntax is as show below. (I previously called WordReplacement get to get the correct id ...
user avatar
  • 319
0 votes
1 answer
12 views

Specified return fields in contact get do not get returned

If I do a api3 contact 'get' with no return fields specified, it obvs returns all the fields including address fields. What I want to do is only retrieve certain fields for my needs, just to reduce ...
user avatar
0 votes
2 answers
37 views

Register new account via REST application

I'm trying to register a new user account to my CiviCRM site and also to create a contact in the CiviCRM system for him. I want to do that via the REST API call application that I'm writing in python. ...
user avatar
0 votes
1 answer
39 views

Export CSV of an smart group's contacts via REST API?

How can I make a REST API call to Civi that creates a CSV file with all the Contacts details (name, email, telephone...) from an specified Smart Group? Thanks.
user avatar
  • 13
2 votes
1 answer
99 views

CiviMobileAPI Extension vs APIv3 for mobile app integration

We are building a react-native mobile app for our members and want to include some CiviCRM data and functionality in the app. Starting with some rudimentary data display eg: How long you've been a ...
user avatar
  • 455
1 vote
0 answers
18 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 ...
user avatar
  • 11
1 vote
1 answer
36 views

Extrnal API access. Status_code 414

I am progressing deeper and deeper into CivCRM intricacies, and work with External (https://) access of the database via API's. When performing a python requests.get(....,entity=Contact,action=get) it ...
user avatar
2 votes
1 answer
52 views

API csv Import GUI with Formprocessor fails with smarty errors

I created a rather complicated form processor which works (through api), but when I tried to clone it (rename it to create so csv api picks it up) and tried to do the csv import. I get the following ...
user avatar
  • 867
2 votes
1 answer
580 views

Call to undefined function user_load() using Drupal 9 and api3?

Full error message: Error: Call to undefined function user_load() in CRM_Utils_System_DrupalBase->getUserObject() (line 558 of /var/www/drupal/vendor/civicrm/civicrm-core/CRM/Utils/System/...
user avatar
  • 5,994
0 votes
1 answer
23 views

Rest API contribution get doesn't return display_name

in my Civicrm 5.31 on Wordpress 5.5 I'm trying to retrieve contribution data via Rest API, using the apiExplorer I get the code: wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contribution&...
user avatar
  • 121
0 votes
1 answer
54 views

How Can I send mailing with AWS SES API instead of SMTP?

I want to send mailing with the help of AWS SES API instead of SMTP. I am using CiviCRM 5.32.2 and drupal 7.
user avatar
  • 91
0 votes
2 answers
56 views

Mass deletion of contacts

I woudl like to mass delete contacts in my civicrm. I could search and delete using the GUI but it woudl take ages as there are so many. I feel like I might be able to do this via the api? Also ...
user avatar
2 votes
2 answers
37 views

How to get all active states & provinces from one api call?

I would like to get all active (i.e., in countryLimit) states & provinces available in my site for use in HTML tag. Can I query for that with a single JavaScript call to CRM.api3? I've tried: CRM....
user avatar
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
user avatar
2 votes
1 answer
29 views

CREATE action for profile missing (v3)?

I want to create a profile but I don't see that in the action dropdown. Have attached an image Please help.
user avatar
  • 133
0 votes
1 answer
19 views

Field 'Type' in Contacts -> GetFields API

What does the 'type' refer to in the results of 'getfields' action of the Contact Entity. It has a numeric value (1,2, 16 etc). Below are a few sample results. "id": { "...
user avatar
1 vote
1 answer
24 views

How to import/create multiple events from .csv?

how do one import/create multiple events from an existing .csv file? I checked the "API csv Import"-Extension (https://civicrm.org/extensions/api-csv-import-gui). But this only updates ...
user avatar
  • 33
1 vote
0 answers
17 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.
user avatar
1 vote
1 answer
28 views

Getting Groups Associated with Campaigns using REST API

CiviCampaign allows you to 'include group(s)' as a part of a Campaign. Is there a way to 'get' which groups have been associated for a given campaign ID using the REST API? The GET API for Campaign ...
user avatar
4 votes
2 answers
323 views

What is the correct REST URL in Drupal 8 (or 9)?

I know there's been a lot of work to deprecate the extern endpoints in CiviCRM, and the extern endpoints don't work in Drupal 8 without a lot of finagling. The documentation isn't updated to reflect ...
user avatar

1
2 3 4 5
10