Questions tagged [api]

Questions about the CiviCRM API.

Filter by
Sorted by
Tagged with
3
votes
2answers
27 views

Custom API Action: Access Request Body

I'm developing a custom API v3 action which is intended to handle a webhook request from Zoom (https://marketplace.zoom.us/docs/api-reference/webhook-reference). Zoom follows REST standards by putting ...
3
votes
2answers
41 views

CiviCRM API Implementation

How are API's implemented in the CiviCRM Codebase? I have a idea of basic structue user <-> api <-> BAO <-> DAO <-> mysql but I guess there is more to this than just this structure. Thanks ...
1
vote
1answer
27 views

CiviCRM Membership data to external Database

I'm new to Joomla, CiviCRM and PHP, but looking to help with a small project. I'm looking to grab the members data from CiviCRM and transfer (or update if users already exist) into a different ...
5
votes
2answers
128 views

How do I access the JavaScript API via a WordPress theme template?

I've taken a look at the docs here under "Use on Non-CiviCRM Pages" but I'm coming up empty when trying to access the CRM object via JavaScript. http://wiki.civicrm.org/confluence/display/CRMDOC/...
3
votes
0answers
22 views

Get list of extensions with upgrades available (from command line)

I would like to know if it is possible to use the command-line to get a list of extensions that have upgrades available. I want to then use that to run cvapi extension.download to install the updates. ...
0
votes
3answers
42 views

Activity get API3 does not return case activity

Im using API3 to get activities My code is function hook_any_activity_get($cid,$type) { $params = [ 'contact_id' => $cid, 'activity_type_id' => $type, 'sequential' => 1, '...
1
vote
1answer
59 views

Fetch membership type along with the contact details with civicrm_api

I am trying to create a lists of contact along with the membership type associated with each contact. Below is the code I have: $result = civicrm_api3('Contact', 'get', array( 'sequential' => ...
1
vote
1answer
16 views

outgoing sms activity link to provider when using multiple providers?

I'm testing out multiple sms providers, and I'm using the api to do reads for reporting on the back end, but I can't seem to figure out how the system knows which sms provider sent a particular sms. ...
0
votes
1answer
34 views

How to repair DB tables after faulty past upgrade?

System: WordPress 5.2.5, CiviCRM 5.21.1, PHP 7.2.18 Background: At some point in a previous upgrade - I suspect from 5.19.x - my database tables haven't updated properly. This resulted in my ...
4
votes
2answers
109 views

How can I 'or' 2 conditions using the api?

If I want to find all contacts without a birth date, I can do this with the api: $result = civicrm_api3('Contact', 'get', array( 'sequential' => 1, 'birth_date' => array('IS NULL' => 1), ...
3
votes
2answers
48 views

Documentation for new sms provider?

I use NowSMS for my SMS provider instead of Twilio and Clickatell. NowSMS goes through a cell phone, which is flat rate pricing instead of per text. I've found documentation for twilio or clickatell, ...
1
vote
2answers
302 views

API permission check failed: CiviEvents Fails after update to 4.7.19 and 4.7.20

After updating to 4.7.20, when the Event Info Page is accessed, it generates the following error, "API permission check failed for Event/get call; insufficient permission: require access CiviCRM and ...
0
votes
1answer
16 views

Is there a specific Exception for the API4 like CiviCRM_API3_Exception?

There is a specific Exception for the CiviCRM API3 called CiviCRM_API3_Exception. Is there a similar specific Exception for API4 or do I just catch the standard Exception?
3
votes
3answers
442 views

How to set a default value for a custom field

EDIT: this is done automatically by CiviCRM from 5.18+ I have a custom fieldset on Contributions that uses an option list. The option list has a default value set, but when contributions are created ...
0
votes
0answers
20 views

Issue programatically creating multiple Custom Groups(CustomGroup) with the api

When is created programmatically with API multiple entities CustomGroup, after created someones in the same process finish with the next error(the param "name" is filled), CiviCRM 5.16 [is_error] =&...
2
votes
1answer
82 views

Why won't CRM.loadForm render url containing civicrm/a/#?

This call: CRM.loadForm(CRM.url('civicrm/a/#/tournament')); works very well for any url that does NOT contain 'civicrm/a/#'. As soon as I try to open anything from an extension, the popup stays '...
1
vote
1answer
54 views

React with CiviCRM APIs

I am trying to use the CiviCRM APIs from my React application. Which API methods would be the one recommended or easy to do with React application ? The easiest would be REST but since my page and ...
1
vote
2answers
41 views

API problem regarding to Word Replacement

I want to replace a word. I was trying to insert using API3 but it is not working properly. Word replacement API3 $result = civicrm_api3('WordReplacement', 'create', [ 'find_word' => "...
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" =...
0
votes
1answer
47 views

Does CiviMobileAPI generate any logs?

I enabled CiviMobileAPI extension and Civi CRM Api Fix plug in (I'm using Wordpress) but can't login in the CiviMobile app (iOS). It keeps showing the Server API Error (Unknown error) message. I ...
0
votes
1answer
26 views

Can I update the id of an existing OptionValue?

I'm trying to update the ID of an existing OptionValue using API v4. I get "Cannot update the id of an existing OptionValue" error. Is there another way to do that?
1
vote
1answer
34 views

Attachment URLs incomplete on remote server only

I'm working locally on my Mac with the latest version of CiviCRM on latest WordPress, served by MAMP. Using the API, I create an attachment to a contact, and those attachments successfully display ...
1
vote
0answers
24 views

Mandatory key(s) missing from params array: entity_id

Using a fairly generic CiviCRM contribution page with membership (CiviCRM 5.19.4 + Drupal 7) and CiviDiscount (3.7). When a 100% discount code is used, instead of completing, the above error is ...
0
votes
2answers
67 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 ...
0
votes
2answers
57 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
1answer
132 views

Is there a problem with the REST interface on CiviCRM API?

I have the CiviCRM API REST interface working fine for retrieving Case information for individual cases. But I'd like to use the options features options.limit and options.offset so I can retrieve ...
0
votes
1answer
26 views

API Contributions and Payments

I'm using the API to create Contacts start Memberships through a signup form. We are offering 1-year memberships at various price points, and I have those set up in CiviMember. My code successfully ...
1
vote
0answers
27 views

Related membership gets deleted upon updating owner membership via API

I would like to make several people a member, linked to 1 payment person A: membership (+ contribution) person B: membership (related to membership person A) $contact_a = 2; $contact_b = 3; $...
1
vote
0answers
19 views

Create API not updating database in new extension - what have I missed?

Help, built new extension, form displays, accepts input, but never updates the database The returns I get from all functions do not show errors. What the heck am I doing wrong???? It's going to be ...
1
vote
1answer
23 views

Using CIVICRM API can I get both mobile and phone number?

I am trying to work out how to call both a phone number and a mobile number using the API. I am in civicrm/api and can get one or the other but not both. Can anyone suggest a solution!? Thanks ...
2
votes
1answer
28 views

Retrieve Contacts with Tags in API4

I am creating some custom directory screens to display a table of contacts with associated email addresses and any tags (just a simplified directory for non-admin staff to view/sort basic CRM data). ...
2
votes
2answers
54 views

How to get data via relationships with APIv4?

Wilma has relationship: is campaigner at organisation System Change Not Charity. How can I get a list of individuals like Wilma and the organisations that they are campaigners for? I've read the ...
1
vote
1answer
18 views

API Explorer 4 under Joomla and Windows/IIS gives fields like {{ ts('CiviCRM API v4') }}

I am running a development system under Joomla and IIS with CiviCRM 5.19.1 (5.19.0 had the same issue). When using API Explorer 4 I get windows like this. Under LAMP, the window makes sense. Any ...
2
votes
0answers
9 views

API: Update a specific multi value field set record

I created a custom field set with three fields, the field set does allow multiple records. The aim of this field set is to collect data about candidacies and mandates of politicians, such as the ...
1
vote
1answer
26 views

Unable to list groups with CiviCRM API

When I run the API command (via CiviCRM API Explorer) to list all the "Mailing Lists" i.e. $result = civicrm_api3('Group', 'get', ['group_type' => "Mailing List"]); I get the full list of mailing ...
1
vote
1answer
25 views

Does the CiviCRM API comply with the OpenAPI Specification?

Does the CiviCRM API comply with the OpenAPI Specification?
3
votes
0answers
25 views

API4 authorization failure when creating a participant

I am currently trying to create a participant on a Drupal form submit, when i do this I get an error saying Authorization failed. I've tried managing the ACLs in Civi with no success, I've also ...
0
votes
2answers
47 views

CiviCRM 5.13.1 API v3 Merge not working

The merge API was worked on 5.0 version but after upgrade to 5.13.1 the merge is Stopped working. Any help is very appreciate.
2
votes
3answers
61 views

REST API, iATS: How do I create a membership through the API without using CiviCRM's forms?

I'm building a software system that uses CiviCRM as a membership database and a billing engine for recurring dues. Our members do not have direct access to CiviCRM or the server on which it runs, and ...
1
vote
1answer
34 views

Guidance Needed on using CiviCRM API + PayPal to Complete Membership Contribution Payment

I'm at a total loss on how to make this work. I am using the CiviCRM API to create a contact, create a membership for that contact, and even create a contribution if that person selects check, ...
0
votes
1answer
38 views

DB Error when using dupe_check in rest API

On version 5.6.0, using api v3. Not sure if something recently changed in our environment, but as of a couple of days ago, running the contact create api (via rest or the explorer) causes a "DB Error: ...
4
votes
1answer
38 views

Smarty only generating nulls from API calls

Using the Explorer, I built up the smarty code I need for a template to pull in address information on a contact for use in an email: {crmAPI var='result' entity='Address' action='get' contact_id=203}...
1
vote
1answer
34 views

Get a field label instead of value using the api

I would like to retrieve both the value as well as the label from a custom field using the api, but it only seems possible to retrieve the value. I wonder if this is possible, would surely help me a ...
0
votes
1answer
32 views

Relative date filter possible in api?

I was wondering if it is possible to use (custom) relative date filters with the api? For instance to find all participants of events in the current or last fiscal year. Would save me a lot of ...
2
votes
2answers
80 views

Add dupe check parameter to an API call - Contact Form 7 plugin

I've installed the Contact Form 7 CiviCRM integration plugin, and it works fine. I'm just wondering how to add a dupe_check parameter. If I try something like: contact_type=Individual&source=...
1
vote
1answer
13 views

How do I create default custom data when changing contact subtypes via the API?

If I use the API to give someone a new contact subtype it doesn't create a row in any relevant custom data tables and populate the default values. Does anyone have a good way to handle this? I have ...
1
vote
2answers
28 views

How do i properly include civicrm.settings.php to use api calls?

Quite a long time ago I wrote an external script that does this at the top: require_once '/path/to/joomla/install/com_civicrm/civicrm.settings.php'; require_once '/path/to/joomla/install/civicrm/CRM/...
2
votes
3answers
186 views

post hook edit entity

We have a post hook that sends some data to an external api when a participant is created or edited. function kavo_civicrm_post($op, $objectName, $objectId, &$objectRef) { if (($op == 'create' |...
6
votes
2answers
170 views

Get URL of custom image field

I would like to display pictures which are defined as custom "File" fields within an event. I currently to this by generating URLs having the following format: MY_URL?q=civicrm/file&reset=1&...
2
votes
0answers
25 views

Custom API not recognized by explorer/cv

I'm troubleshooting an issue where some custom APIs (v3) via an extension are not recognized by the site, either in the API explorer or when attempting to run them via cv. The situation is puzzling: ...

1
2 3 4 5
9