Plugin Author
zaus
(@zaus)
Similar to this question about substituting a GET request for a POST — https://wordpress.org/support/topic/not-able-substitute-parameters-into-jsp-call?replies=2#post-7945391
But you need a “mixed” request…
add_filter('Forms3rdPartyIntegration_service_filter_args', 'my_3rdparty_mixed_override', 10, 3);
function my_3rdparty_mixed_override($post_args, $service, $form) {
// list of parameters to "switch" -- should correspond to mapping key
$mix = array( 'sections', 'key' );
// add post values to get
$get = array();
foreach($mix as $k) {
$get[$k] = $post_args['body'][$k];
unset($post_args['body'][$k]); // remove if necessary
}
$url = add_query_arg($get, $service['url']);
// send the request as normal
$post_args['response_bypass'] = wp_remote_post($url, $post_args);
return $post_args;
}
Plugin Author
zaus
(@zaus)
Ok first off in Forms (using ninja) navigate to 3rd party services.
Then input my email give the service a name & add the base of the api url. Attach to a form.
Then input
add_query_arg( array(
‘key1’ => ‘value1’,
‘key2’ => ‘value2’,
), ‘http://example.com’ );
for them to have a drop-down & text input?
such as
add_query_arg( array(
‘user’ => ‘Your Profile’,
‘company’ => ‘Your Company’,
), ‘http://example.com’ );
That makes sense as creating http://api.example.com/%5Bquery selection above]
but it reaaly need 2 drop downs & one text input so the api url looks like
http://api.example.com/%5Bquery select 1]/:ID?selections=:[query select options 2]&[text input
oi vey that is just to figure out which url to call for service geesh!
Yeah I just can’t under stand (I have all the forms: 3rd party installed 3rd party integration, dynamic fields, and xpost & still using ninja forms).
In order for any of them to work I have to be able to know the api url.
I have the always base http://api.example.com
which has 4 values appended to it to show the right information
api key (of the submitter)
Section
Selection
ID
And I’m trying to look at the code and figure out what I would actually enter into the settings. Step 1 is always settings right?
🙁