How do I post data from Drupal 9 when a content is created, post data to Drupal 7 hosted in a different server to create node content.

In Drupal7, I have enabled services module and created a resource to create login session, accept json data and creates node content. This is working fine when I test from POSTMAN.

I am new to Drupal 8/9 and not sure how to post json data to D7.  Please could anyone suggest?

Many thanks in advance.

Comments

bitsfs’s picture

Before trying to answer the question I need to say that D7 community support ends in November 2022, so  instead of make new developments in D7, maybe you should evaluate the option of upgrade do D8/D9.

That being said, maybe this can help you: https://www.drupal.org/node/1246470

shablm’s picture

thank you for your suggestion, much appreciated.

Our current D7 app has a lot of custom features used internally within our organisation and externally. We are in the process of migrating the app to D9 prioritising externally accessible features and to keep D7 as legacy system for internal use only. We only need 5 fields in ONE cck in D9 to be stored in real time in D7 to continue using D7.

The 5 fields include integer, date&time and list fields. I have tried to maintain the cck and field machine names SAME in both D7 and D9 sites. The rest of the fields in this cck are very different in both sites.

I have a written a very simple custom module in D7 for webservices to create node in D7 with 5 fields populated and is working fine when I test from POSTMAN, I am stuck posting the data from D9 to D7. Please could you suggest?