Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Rules API POST

No security coverage No further development 3 sites

Part of the Rules ecosystem · 10 projects

This module provides a Rules action to send Drupal content to an external REST API in JSON format. It serves as a demonstration and starting point for building integrations between Drupal and other systems.

"Rules API Post" is a working example, with documentation, for replicating Drupal content to external systems. This module adds a Rules action plugin for POSTing content to a REST API, using the hal_json format.

Use this module to explore methods of working with REST. This code can be used as a starting point for building integrations between Drupal and other REST APIs.
(Fresh Service Data API)

Along with a simple Rules action plugin (API POST), two content types and a Rule Configuration are also included.

Our method uses Rest Services on Drupal, setup for the hal_json format. While still available and supported, hal_json has been moved out of Drupal Core.

We are planning to adopt jsonapi for the next (3.x) version of this module.
www.drupal.org/project/jsonap
Jsonapi has been moved into Drupal Core. One selling point is the support for file uploads.

See our module documentation for additional details.


Documentation & Guide

Required & Enabled Modules

Rules: Rules, Rules API Post
Web Services: HAL, HTTP Basic Authentication, REST UI, RESTful Web Services, Serialization

To Do

  • Migrate the module to use /jsonapi with ?_format=api_json
  • Include file attachment support
  • Expand the documentation
  • Add working sample Rule export, rules.reaction.rules_api_post.yml
  • Add a sample date field
  • Set the default value of "Content Author" form field to use the current user's email
  • Capture REST response into API Post Transaction fields.

Open Source Historic Shout Out & Credits:

The base of this module was borrowed from the "Rules HTTP Client" project.
See: https://www.drupal.org/project/rules_http_client

Thanks to all those who have helped along the way.

Rules HTTP Client was originally created by Mitchell Tannenbaum (mitchell) and
co-maintained by Stuart Clark (Deciphered) and Benjamin Melançon
(mlncn). The Drupal 8 porting was done by Ajay Nimbolkar (ajayNimbolkar).

Drupal 9–10 · not 11

Ask your assistant about Rules API POST

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • rules Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.1 Stable 9–10 Apr 20, 2023