Questions tagged [api]

Questions about the CiviCRM API.

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

Memory leak in API create Contact

I am trying to use PHP on the Command Line to import 90,000 contacts to Civi 5.0. It seem like there is a memory like when calling: civicrm_api3('Contact', 'create', $usrArray); Does anyone know ...
0
votes
1answer
36 views

Get the ID for the default organization through API

Is there any way to get the "default organization" contact id through the API?
1
vote
2answers
37 views

How to connect your household address to its members in civicrm api v3?

$result = civicrm_api3('Address', 'create', array( 'sequential' => 1, 'contact_id' => $householdContact['id'], 'location_type_id' => "Home", 'is_primary' => 1, 'street_address' =&...
0
votes
1answer
37 views

How to add email while trying to create a Household contact using civicrm api v3?

I want to add email address to create a contact of type Household , how I can achieve it as while checking in API explorer I don't see it. $result = civicrm_api3('Contact', 'create', [ '...
2
votes
1answer
344 views

Where should I convert the birth_date string to a Date object?

My angular module resolve object: resolve: { myContact: function(crmApi) { return crmApi('Contact', 'getsingle', { //id: 'user_contact_id', ...
0
votes
2answers
73 views

Adding a job as API

As far as I can understand, the way to add a job is to set it up in your extension as an API. So I have created the default code using civix generate:api --schedule=Daily Contact myendpoint ...
4
votes
2answers
84 views

How to send a confirmation email when adding a contact to group via API?

I'm using the REST API to create contacts and add them to an existing mailing group. I want to add them as pending and trigger the confirmation email but I can't find a way to do it via the API. The ...
1
vote
5answers
41 views

Is it possible to Contact.get where civicrm_id = external_identifier, using API?

I want to get all contacts who have "CiviCRM Id = External Id" This API call doesn't work because, id is expecting a numeric value $result = civicrm_api3('Contact', 'get', array( 'sequential' =>...
0
votes
1answer
222 views

How to setup Cron in Civicrm- local server

-job.execute works, cron runs when i click Execute Now -individual and group test mail works properly -curl is running -joomla 3.8.7 -apache 24 -php 7.2.4 -civicrm 5.0.1 Here's the problem: -I could ...
2
votes
2answers
46 views

Unable to do “replace” in API Explorer

CiviCRM 4.7.29, Wordpress 4.9.5 I am unable to do a replace in the API explorer. I can do a "get" however. The situation is that a parent registered for an event, but forgot to change the number of ...
0
votes
1answer
28 views

Laravel package to access CiviCRM API3

How do you integrate CiviCRM API3 with Laravel? I put this question here to link the package I created for this as I wished I would have found more info on the API while searching here. See my ...
1
vote
1answer
104 views

CiviCRM_API3_Exception: Expected one CustomField but found 0 in civicrm_api3() (line 45 of sites/all/modules/civicrm/api/api.php)

I was cleaning up some extra custom fields in our DB. ONe of these , though it was disabled did not stop displaying in the contact profile. So I clicked to delete it. I then got this error when I ...
1
vote
2answers
46 views

How to programmatically open the option modal and listen to changes?

I would like to open such a modal programmatically and then listen to events related to this modal (such as "option created", "option updated", "modal closed" etc). I tried to look at the CiviCRM ...
0
votes
1answer
140 views

“API permission check failed” for admin user

(I'm using version 4.7 based on Wordpress) When making a REST api call to retrieve a ContributionPage instance, the response tells me that I "require administer CiviCRM". However, the API key is ...
0
votes
2answers
143 views

“Failed to authenticate key” when posting to REST api

I used the API explorer to create a target url, but I cannot send a GET request with curl. The error is: "Failed to authenticate key". Here are the steps I am following: Create an url in the API ...
4
votes
1answer
175 views

Upload a contact image via the API

Can someone give me a simple example of how to upload a Contact image via the API? I am guessing it will involve a call to the File API as well but not sure. I have the original image as a URL but ...
1
vote
3answers
75 views

Where is IPN information stored in Civi?

We are using Civi 4.7.29 on Wordpress 4.9.4 Recently we moved our civi install of the root directory oursite.com to a subdomain subdomain.oursite.com. While we were on the root directory, we were ...
4
votes
1answer
192 views

Using Profiles to allow member to view/edit own details only

I am trying to work out how to use a profile to allow a registered member of an organisation/registered user of a Wordpress site, to access/view their own information and edit certain fields. In ...
1
vote
2answers
102 views

Bulk delete of events - is such a thing possible?

We've had a bit of a mix up and imported the same set of events twice. Most if not all of the duplicates have no participants (but I'm not 100% certain of that) Is there a way to bulk delete these ...
1
vote
1answer
24 views

How do I contribute to API development?

I am a CiviCRM user. I am the informal technical support behind a CiviCRM member and the reason that they are a member (Florida Native Plant Society). I seem to have a continual battle with ...
4
votes
1answer
85 views

what kind of sanitization needs to be done when doing civicrm_api3('Contact', 'create') inside custom drupal modules?

How does creating contacts via civicrm_api3() fit into these areas https://docs.civicrm.org/dev/en/latest/security/#strategy https://docs.civicrm.org/dev/en/latest/security/inputs ? If I'm using this ...
1
vote
1answer
62 views

Cannot access Group admin - missing API key

CMS: Drupal 7.56 (shared hosting at Siteground; cpanel/phpmyadmin access) Civicrm version: 4.6.34 (followng problem follows recent update) I (admin 1 - all civicrm persmissions) cannot access ...
2
votes
1answer
37 views

API call for ACL roles no longer works

I have an API call to get ACL roles that worked before I upgraded to 4.7.29 (I think I was at 4.7.22). Now, this returns no results: $entity_id = $group["id"]; $apiParams = array("entity_id" =...
2
votes
1answer
57 views

How do I search for the exact string match using CiviCRM API

How do I perform Contact GET for the contact with the exact display name which will return only contacts with that exact display name? Say I create two users xyz and xyzA $result = civicrm_api3('...
0
votes
1answer
34 views

API creation: my action is not found (only on Linux server)

Using civix I create an extension containing a new API (WD2.importdata). As result I obtained the file: ..ext\org.civicrmitalia.washdog\api\v3\WD2\ImportData.php containing the following 2 functions:...
0
votes
2answers
56 views

condition on count from chained api call

I am trying to use the api to get all contacts without an address with locationtype billing. For this I use the contact get api, and do a chained address get call. Is there a way to put a condition on ...
2
votes
2answers
43 views

Adding contributions doesn't work for certain currencies

I noticed importing or adding contributions in Serbian dinars (RSD) doesn't work. I tried using API Explorer to create a contribution that way but I get the same error I get when I try to import ...
4
votes
2answers
122 views

Attach pdf file civicrm_api3

i need help, i'm trying to attach through civicrm_api3('Attach', 'create'..) a pdf file, passed with a rest call as simply text: %PDF-1.3 1 0 obj << /Type /Catalog ... ecc . The attach works, ...
0
votes
2answers
158 views

Using Civicrm_api3 in onAjax[Name] plugin function

I created a plugin which provides custom validation for civicrm forms. Part of the jQuery validation on the plugin makes an AJAX call to the plugin. The plugin calls its onAjax[Name] method. In the ...
1
vote
1answer
101 views

CiviCRM AJAX api Permissions

Background I am working on a React app for event participation management using the CiviCRM ajax API. There is a little more to this that isn't relevant. Each user has access to their own API key, ...
5
votes
2answers
423 views

CiviCRM integration with Eventbrite

I would like to create/update events in CiviEvent by using Eventbrite webhooks. One of the requirements is having an endpoint page that will receive data sent by Eventbrite API. How can I create that ...
3
votes
1answer
71 views

REST API 'between' parameters

I'm trying to make an external REST API call to rest.php. I was getting "Unable to decode supplied JSON", but then I figured out I could take the values I was stuffing into json (from the API ...
1
vote
1answer
115 views

Create address via API no longer working with Webform CiviCRM?

Since upgrading to Civi 4.7.28, webform submissions via the Drupal 7 module "Webform CiviCRM" have not been able to create a new address in a new CiviCRM contact. In the error log, I have these errors:...
1
vote
1answer
546 views

Rest api's Give a 302 found and redirects to Login Page

http://crmqa.org/sites/crmqa.org/modules/civicrm/extern/rest.php?json=1&entity=pax&action=fetchAddressDetails&api_key=apikeyofcontact&key=sitekey When I call this through ajax and ...
3
votes
3answers
446 views

How to connect to REST API from remote host?

I'm trying to connect to the rest api from a remote server, and the only response I ever get back is: var jsondata = {"currencySymbol":"$","is_error":true}; I'm able to make api calls from the site'...
0
votes
2answers
270 views

CiviCRM REST API Call

I'm new to CiviCRM and REST API Calls. I'm attempting to create a new contact using POST via Postman. I'm submitting the following: http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/...
0
votes
1answer
61 views

via api created only first particpant gets a line: “Contribution Amount: 1”

I register participants and payments via the API. Step 1: create a contribution for the buyer Step 2: create participants Step 3 create participant_payments linking the above. The weird thing is ...
0
votes
1answer
23 views

dupe_check parameter only works for contacts?

I would like to disable the dupe check on relationships. Is it true that the API parameter parameter 'dupe_check' works only for contacts or can it be also used in relationship api calls? Here under 4....
0
votes
2answers
33 views

How can I use the Omnipay processor to audit missing payments?

I was told that I could use the Omnipay processor to detect missing payments. I've determined that I need the API action PaymentProcessor.getmissing, and I can call this with: wp cv api ...
0
votes
1answer
20 views

How to api access relationship notes?

I tried this in the 4.7.25 demo but the same is valid for 4.6.33. Using the web GUI I added a test description and test note to an existing relationship With API browser I listed relationships with ...
3
votes
2answers
13 views

How to load the definition of a case type with the CaseType API

I am trying to use the CaseType API to create a case_type but I can not find any documentation on how to set the definition parameter. Any hints or should I just dive into the code?
2
votes
1answer
61 views

API Contact>DuplicateCheck Not Working?

Can someone please verify that the API for contact>duplicatecheck is actually working? In my case the UI will return 8 dupes, but the API will not return any. It seems to be broken as of late. ...
0
votes
1answer
78 views

Accessing Event details not possible anymore (Frontend)

Joomla 3.8.2 and CiviCRM 4.7.27 I got recently some user reply's that the event details con not be accessed anymore, thus no event regi, stration is possible.The event list is visible in the frontend,...
1
vote
1answer
227 views

Wrong return URLs in PayPal Standard

I'm using the api to process contributions from some custom pages I have created, specifically the call to civicrm_api3('Contribution', 'transact', $params). When I use PayPal Standard as my payment ...
1
vote
1answer
49 views

How to create a mailing based on a template with API

I'm trying to create a mailing based on a template through the CiviCRM API. Here's my code: $params = array( 'name' => $subject, 'msg_template_id'=> 87, 'created_id' => 1, '...
0
votes
1answer
40 views

Scheduled Job send_reminder failing with “No such field”

We're running Civi 4.6.16 and Drupal 7. Our schedule reminders are not sending when the job triggers, or manually through an API call. The backtrace isn't seeming that helpful, to me, but maybe it'll ...
0
votes
2answers
63 views

How to get contacts in children of a parent group using the API

I have a child groups C and B, each with 20 different contacts in them. Both child groups are in parent group A. I need to find all contacts in all children of A since C and B might be removed later ...
3
votes
0answers
50 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 ...
2
votes
1answer
48 views

Create programmatically a ACL logic

I have a need to create programmatically (from a csv) a complete ACL structure. In detail for each csv line i need to create the CMS user (Joomla) with a specific role the connected contact the ...
3
votes
1answer
142 views

Trying REST but get PHP Fatal error: Class 'JObject' not found in

I need make a query on civicrm project in joomla from REST. However, when I try: http://localhost/joomla/administrator/components/com_civicrm/civicrm/extern/rest.php?entity=Contact&action=get&...