"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.
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).
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Rules ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 2.0.1 | Stable | Apr 20, 2023 |