Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [api]

Questions about the CiviCRM API.

1
vote
0answers
23 views

Chaining Participants creation using REST API

I'm trying to create an event and chain the participants creation using the REST API from python. My attempt goes like this: import requests params = { "key": "key", "api_key": "apikey", "json": ...
1
vote
1answer
17 views

Is there any civicrm api for android?

Please share the link for civicrm android API for android. Any git site. And also send some tutorial regarding to API.
0
votes
1answer
13 views

Use the API to loop through contacts and copy field value

Been playing with the API and see how to query for a result set but not the appropriate way to get a result set and update it batch style(over 4000 contacts in this case). My goal is to gather all ...
1
vote
1answer
21 views

Updating an activity using the API

I'm looking at the API and the options to update an Activity are struck through. Is there a way of updating an activity with the API? COUld someone point me in the right direction? Thanks
3
votes
1answer
24 views

CRM API shows only the first char of the result?

I'm absolutely embarrassed. I try to get value as it in this thread (and sorry for the wrong use of the topic). I try get a custom value via CRM API. With the API Explorer I can create the ...
2
votes
1answer
31 views

How to explore API from command line?

Is there a way to explore the API from the command line instead of going to mycivicrmsite.localhost/civicrm/api in a web browser? I wasn't able to learn much from the cv help. For example, you can ...
0
votes
1answer
26 views

Api doesn't update record vu creates new

I have a civicrm-application that gets updates trough an external rest-api call. But there's something odd happening. Request: ``` api_key=76d9f1d3h4c87c2465a8a305b6fe&key=...
1
vote
1answer
14 views

Error using Drush and Civi API when adding data to a custom field with multi-select data

I have been trying to create contacts data using Drush and the CiviAPI. I get an error when I try to add data to a multi-select field despite using exactly the same syntax that the API explorer gives ...
2
votes
2answers
43 views

Use API3 or API4?

What is the recommended version of API to use at this point in time? I am about to do a major rewrite of an extension to manage small groups and I want to future proof it. Are there any advantages/...
0
votes
0answers
10 views

Problem with Civi for Outlook not recording any information in an email after an ‘&’?

We use the Civi for Ootlook plugin and have come across a problem with recording the message if there is an '&' in the subject line or body text The email is recorded in Civi but if there is an ...
1
vote
1answer
19 views

Activity 'Result' field missing from API

The default field on the Activity API doesn't return 'result' field by default, or even when specified as a return value. I've never added one of these before, if someone could let me know how it's ...
0
votes
0answers
13 views

How to get price set data based on event id… (with solution)

For various reasons I couldn't use the Civi event registration form so I had to cook up my own. To do this I needed to pull price set data, because my form is to be used for any events in Civi. The ...
2
votes
2answers
26 views

Python Civicrm API Keeps Giving 404 Error

I'm trying to use the Python Civicrm API located here: https://github.com/tallus/python-civicrm . I can connect to the site just fine, but anytime I try to query any of the content I get a 404 Error ...
0
votes
0answers
22 views

DB Constraint Violation on Contribution Pages

When editing a contribution page, I get the error below. In this case, I'm trying to add the option for auto-renewal of memberships, but I have seen it at other times as well. Any ideas? CiviCRM 5.1....
1
vote
2answers
41 views

How to use CiviCRM REST API in external PHP code

Been trying to get this to work for hours. Help would be greatly appreciated. userkey and sitekey are replaced with actual keys. I'm trying to run in a php file: $result = curl -X POST "https://www....
1
vote
2answers
66 views

Create an activity when a specific profile is submitted?

I'm sending out a profile to contacts with a checksum - they are not logged in when they submit it. Can i create an activity for that contact when the profile form is submitted? So far i've run into ...
2
votes
2answers
46 views

How to update contact email with JavaScript API?

I'm trying to update a contact and, especially, the email address. As far as I can tell using the API explorer, this is the correct JavaScript code for that: crmApi('Contact', 'create', { ...
1
vote
1answer
30 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
24 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
27 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
19 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
74 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
27 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
57 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
21 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
108 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
28 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
13 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 ...
0
votes
0answers
24 views

Generate CiviDiscount Codes With API

I have one golfer registering for a team of 4. I would to provide the golfer with a Discount Code for CiviDiscount so they can register for free once the first golfer pays for the full foursome. I ...
0
votes
1answer
43 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 ...
0
votes
0answers
55 views

API CSV Import extension not work since 4.7.30 upgrade

I am trying to import Entity=Activity (so can set assignee). I had no problem a few weeks ago before the upgrade (from 4.6.x). The import preview now complains on all rows. When I download the error ...
1
vote
2answers
32 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
55 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
53 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 ...
5
votes
1answer
69 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 ...
0
votes
0answers
11 views

Errors Truncated When Displayed From CV Command

I am trying to diagnose an issue with Smart Group Caching. Part of doing this I am using cv api Job.group_rebuild debug=1. When I run this command the error message that I receive has all the steps ...
1
vote
3answers
41 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 ...
2
votes
1answer
59 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 ...
0
votes
0answers
24 views

Getting appropriate return with API join

I am trying to create an API script using the Join option. I can get my memberships and appropriately filter them. I can join on contact_id to the contact table and return the correct contact_info. ...
1
vote
2answers
62 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
20 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 ...
5
votes
1answer
46 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
49 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
26 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
36 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
19 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
0answers
16 views

Error on using special character (à, ò, …) when creating contact through API

In my extension, I'm importing contact and group data from a csv using API. Some names contain Italian character as à: My call is: $result = civicrm_api3('Contact', 'create', array( '...
0
votes
2answers
25 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
39 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 ...
5
votes
2answers
74 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, ...