I am looking to use Formidable API to send data to a website
The website requires an API key and TENANT ID...
I have been reading into documentation and have a very low understanding of PHP/WP and am wondering where this goes to ensure the header data is always passed when connecting to the specific URL
add_filter( 'frm_api_request_args', 'my_custom_frm_api_request_header', 10, 2 );
function my_custom_frm_api_request_header( $arg_array, $args ) {
if ( str_contains($args['url'],'Website.com' )) { // the full url where the request is being sent
$arg_array['headers']['X-API-KEY'] = 'IPKEY';
$arg_array['headers']['X-TENANT-ID'] = 'TENANTID';
}
return $arg_array;
}
Please login or Register to submit your answer