The REST link produced by API v3 Explorer gives 'page not found' under Drupal 9
The REST link produced by API v3 Explorer gives 'page not found', i.e. it doesn't work.
- Click on Support -> Developer -> API Explorer v3
- Choose Contact and Get.
- The Curl string returned is this:
curl '<drupal URL>/libraries/civicrm/core/extern/rest.php?entity=Contact&action=get&json=%7B%22sequential%22%3A1%7D&api_key=FIXME_USER_KEY&key=FIXME_SITE_KEY'
- Fix the FIXME values and copy and paste the URL into a browser.
What should happen. JSON list of contacts should appear.
- Browser: MS Edge but probably irrelevant.
- CiviCRM: 5.37.2
- PHP: 7.4 but probably irrelevant.
- CMS: Drupal 9.1.8
- Database: MySQL 8.0.25 but probably irrelevant.
- Web Server: IIS but probably irrelevant.
I know that REST is being deprecated, but there does not seem to be a replacement available.
The reason for the issue is that rest.php lives here:
A solution is to create a symbolic link to the extern folder in the latter folder. Copying the folder might also work, but then it would not be automatically updated when CiviCRM is updated.
There is an issue with rest.php itself, but I shall raise that as a separate issue.