AnsweredAssumed Answered

cURL records from FileMaker Pro Advanced to Drupal 8

Question asked by esod on Dec 17, 2018
Latest reply on Dec 17, 2018 by esod

I'm trying to cURL records from a FileMaker Pro 17 Advanced system to a Drupal 8 system. I've added a variable after Insert from URL which prints the contents of the Insert from URL step. The named $insertFromUrlString variable contains:

 

Insert from URL [ Select ; With dialog: Off ; $response ; https://www.mysite.org/entity/node?_format=hal_json ; cURL options: --request POST --user name:"password" --header "Content-type: application/hal+json" --header "X-CSRF-Token: $token" --FM-text-encoding utf-8 --dump-header $responseHeaders --trace $trace --insecure --data-binary '{

"_links" :

{

  "type" :

  {

  "href" : "https://www.mysite.org/rest/type/node/bundle"

  }

},

"body" :

[

  {

  "value" : "Content"

  }

],

"field_one" :

[

  {

  "value" : "Content"

  }

],

"field_two" :

[

  {

  "value" : "Content"

  }

],

"field_three" :

[

  {

  "value" : "Content"

  }

],

"type" :

[

  {

  "target_id" : "bundle"

  }

]

}' https://www.mysite.org/entity/node?_format=hal_json]

 

I get $token in a an earlier Insert From Url step.

 

In the above, if I copy everything from --request POST, add curl --include at the beginning, and remove --FM-text-encoding utf-8 --dump-header $responseHeaders --trace $trace (which are FileMaker things), the post to Drupal succeeds. Unfortunately, from Filemaker, the $responseHeaders is 403 Forbidden.

 

And the $response from the Insert from Url step is

 

{"message":"The \u0027restful post entity:node\u0027 permission is required."}

 

Reading through the $trace doesn't offer me any insight.

 

I won't be able to use any plugins or RestFM. Full disclosure, I get the same Body back using Postman. Actually, full disclosure, when I use Body -> Raw in Postman, instead of binary, I get back json and my content is posted.

 

Has anyone here attempted and succeeded in cURLing from FileMaker to Drupal?

Outcomes