$api_key = '1111-2222-3333-4444'; $url = 'https://mysite.com/wp-json/frm/v2/forms/1/entries/'; // change your url $api_parameters = [ 'form_id' => 1, // entry form id 'name' => 'Bob', 'age' => '42' ];
$response = wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 45, 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( $api_key .':x' ) ), 'body' => json_encode($api_parameters), ) );
Thanks, and I agree that the API route is overkill for what I wanted. I just hadn't found the PHP instructions linked above when asking the question. Since then, having found the PHP public functions, I've written the importer function already and it was indeed simple and fabulous!
Anyone finding this later should definitely consider the PHP guide linked above!
Please login or Register to submit your answer
Ah... I might have found a path to solve this more simply...
https://formidableforms.com/knowledgebase/php-examples/#kb-create-an-entry-with-php
Somehow I couldn't find that article initially, but it does seem to be more like what I need.
Experimentation in progress!