Part One: Post to Drupal 9 from Dataverse Data using PowerAutomate and PostMan - Building the API

First we need to build the API so PowerAutomate can talk to Drupal.

I am developing this for a School Distrct HR Power Platform.  This piece is for the Job Board where HR can get a staffing request from a supervisor.  From there they can create a job posting from with in the Power Platform. That posting will go public on a Drupal 9 site.

I choose to use Drupal instead of Power Portal cause it's cheaper. laugh

 

I will be using the module Rest UI and Postman to set up the API.

1. Get your URL to the content type you would like to "POST" create.

Example: https://yourDomain.com/jsonapi/node/article  (For the article content type)

 

2. Change to "Post"

3. Add your Authorization

 

  • Change to "Basic Auth"
  • Add your Drupal Username and Password

NOTE: You cannot use USER 1 for this part, create a user for the API with admin permissions.

4. Add your headers:(Ignore all my pink stuff)

  • Key: Accept    Value: application/vnd.api+json
  • Key: Content-Type    Value: application/vnd.api+json

 

5.  Add your Body with the field you want to pass over:

In Raw format enter below: (Tweak with your own fields)
{
  "data": {
    "type": "node--article",
    "attributes": {
      "title": "My custom title",
      "body": {
        "value": "Custom value",
        "format": "plain_text"
      }
    }
  }
}
 

Press Send and your results should be a 201! 

 

 

**** Something I ran into re-creating this was... Make sure there are no cookies. Cookies cause a 403 error message.