20 votes
Accepted

How do I set up an API key for a user?

Hopefully a new release will be made for the API Key extension soon. Here are detailed instructions for creating one manually without needing to get access to your database through phpMyAdmin, mysql ...
Joe Murray's user avatar
  • 6,741
6 votes
Accepted

REST API 'between' parameters

I just figured it out: &received_date[BETWEEN][]=2017-12-01&received_date[BETWEEN][]=2017-12-02
Troy's user avatar
  • 241
5 votes

Get or generate a contact checksum via API?

I needed this exact functionality, so I wrote the extension that provides it, com.megaphonetech.checksums. I used Coleman's comment above as my spec :)
Jon G - Megaphone Tech's user avatar
4 votes
Accepted

CiviCRM REST API Call

As kainuk mentioned, you don't have the right syntax for the json field, i needs to be json= instead of json: http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&...
Xavier's user avatar
  • 10.2k
3 votes

How do I set up an API key for a user?

You need to use the extension which creates an 'API Key' tab on the contact record. https://github.com/cividesk/com.cividesk.apikey/archive/v1.0.zip JMC
Jon-man's user avatar
  • 846
3 votes

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

My previous answer here is now out dated. Now the endpoint is /civicrm/ajax/rest. But first you must enable the AuthX extension (Administer menu » System Settings » Extensions). Then you'll have an ...
Jon G - Megaphone Tech's user avatar
3 votes

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

I just installed a CiviCRM and Drupal 9 instance (5.40.1). These were my steps: I enabled the new authx extension cv ext:enable authx I allowed the authenticate with the api_key in a special header ...
Kainuk - CiviCooP's user avatar
3 votes
Accepted

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

the correct syntax is the one at the top: "first_name": {"LIKE":"hei%"} to work around the encoding issues (that might be tricky indeed), don't try to put all the params ...
Xavier's user avatar
  • 10.2k
2 votes
Accepted

API - Create a contact from an external site

What you are asking is "How do I send a POST request with PHP?". See the following stackoverflow question: https://stackoverflow.com/questions/5647461/how-do-i-send-a-post-request-with-php .
Kainuk - CiviCooP's user avatar
2 votes
Accepted

"API permission check failed" for admin user

You must also make the user an admin in the Users panel of the host CMS (wordpress, in this case). It's not sufficient to choose Administrators as the value for the "group" dropdown in the "New ...
mnieber's user avatar
  • 217
2 votes

How do I set up an API key for a user?

To add an API key to an existing contact in API Explorer v4: navigate to Support > Developer > API Explorer v4. In the "entity" drop-down menu select "contact", in the &...
Toby-fz's user avatar
  • 21
2 votes

AJAX API permissions

I believe there is currently a bug. I have submitted a bug report: https://issues.civicrm.org/jira/browse/CRM-20582 When I ran into my issue, I was told: "If you need a quick fix that doesn't ...
Randy Tobias's user avatar
2 votes

POST format for a chained create

@pfigel in chat.civicrm.org responded that this is possibly a problem with encoding. This works for him: curl -X POST 'http://civicrm.example.com/sites/all/modules/civicrm/extern/rest.php' -H '...
Joe Murray's user avatar
  • 6,741
2 votes

POST format for a chained create

CiviCRM allows you to send api params in POST by encrypting the params in json. Here is an example on how you can build api params used in REST call http://www.domain.org/sites/all/modules/civicrm/...
Pradeep Nayak's user avatar
2 votes

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

I, too, had problems getting the json parameter to work when using the REST URL generated by API Explorer. I kept receiving the following error: { "is_error": 1, "0": "...
Cory Wagner's user avatar
2 votes
Accepted

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

In the end, I was only able to make it work by using array notation. Some examples below. All these worked in the array notation on the right, but not in the object notation on the left: "options": {"...
Jern's user avatar
  • 1,300
2 votes

REST API call & endpoint

CiviCRM provides api for each entity. Each entity has its own parameter. You can use API explorer to find how params are build and need to send through rest api. The API explorer screen provides ...
Pradeep Nayak's user avatar
2 votes

Only in WORDPRESS: REST.php ---> Unable to decode supplied JSON

The correct endpoint for WordPress is wp-json/civicrm/v3/rest. Its documented in the developer manual, see https://docs.civicrm.org/dev/en/latest/api/v3/wp-rest/#endpoints. When you just copy the ...
Kainuk - CiviCooP's user avatar
2 votes
Accepted

APIv3 Rest URL ... Could not load the settings file

Ok, so this is a temporary fix. Would be interested to know a final solution: In the path /bitnami/drupal/modules/contrib/civicrm/../..//default/civicrm.settings.php the '//' is interpreted as '/' so ...
alistair-james's user avatar
2 votes
Accepted

Make API queries - two methods failing

For your cv call either turn off the permission check or specify a user to run with. So either: <?php $result = civicrm_api4('Contact', 'get', [ 'checkPermissions' => FALSE, '...
Aidan's user avatar
  • 13.5k
2 votes

Odd REST API result

Can you try with a LIKE 'CLC' rather than '='? This might help as the contact_sub_types are stored with the weird CRM_Core_DAO::VALUE_SEPARATOR around the values?
ErikH - CiviCooP's user avatar
1 vote
Accepted

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

The iATS extension does not expose any api functions for assigning iATS "payment tokens" to contacts (not to be confused with CiviCRM tokens, a completely different thing). The next version of the ...
Alan Dixon's user avatar
  • 6,841
1 vote
Accepted

CiviCRM 5.12.0 - Case API returning an Analyzer object containing XML and JSON. Only want JSON

Not a direct answer, but following on from the comments here are some more things you can try. If you haven't already, check the civicrm log. Maybe there is something helpful there. For example maybe ...
Demerit's user avatar
  • 22.9k
1 vote

Api doesn't update record vu creates new

The snippet looks correct to me, Can you try using 'contact_id' instead of 'id' as sometimes it did work for me. I am having hard time to recollect the scenario why i had to use 'contact_id' over 'id'....
Pradeep Nayak's user avatar
1 vote

Python Civicrm API Keeps Giving 404 Error

The URL was wrong like, @user4278 suggested. It should have been: sitename.org/sites/all/modules/civicrm/extern/rest.php
Programming_Noob's user avatar
1 vote

Bulk Update Participant Status via REST API

The right place to experiment with possibilities of the API is API Explorer that you can find at Support -> Developer - API Explorer in your local CivCRM instance or on the Demo site. All the ...
Kainuk - CiviCooP's user avatar
1 vote

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

finally I got the issue. It was related to the api URL. In ubuntu we created a link folder so the url worked. In windows the symbolic link was not created and also doesn't work so based on htaccess ...
Vinay Jadhav's user avatar
1 vote
Accepted

How to connect to REST API from remote host?

We tried turning off all plug-ins except for the CiviCRM plug-in. The rest.php endpoint began working perfectly. We were able to turn back on all plug-ins except for "Recent Tweets". I'm surprised ...
Troy's user avatar
  • 241
1 vote

How to connect to REST API from remote host?

To get the rest API working, you need to call an url looking like that (this example to create a contact) http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&...
Xavier's user avatar
  • 10.2k
1 vote

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

The question is old but for anyone searching for that error, see CRM-21203 and PR-11609 released in 5.1
Aidan's user avatar
  • 13.5k

Only top scored, non community-wiki answers of a minimum length are eligible