zaus / forms-3rdparty-xpost

Converts external submission from [Forms: 3rdparty Integration](http://wordpress.org/plugins/forms-3rdparty-integration/) plugin to XML post; optionally can add custom headers (to allow SOAP submissions).
4 stars 2 forks source link

Passing Data Help! #13

Closed dannyhag closed 7 years ago

dannyhag commented 8 years ago

Hi there!

I am new to passing data via API's and could use some assistance.

I have a number of landing pages which are currently successfully passing data to our call center via the Gravity Forms 3rd Party Integration plugin (over 1,000 records per day).

I am now trying to pass data directly to our local web server which I will use as a backup for all leads, and a repository for all the entries.

I am using the CDBT (Custom Database Tables) plugin for Wordpress on our local web server which enables access to database tables using an API Key.

Data passed must be in this exact format (API Request/URI):

http://[MY SERVERS IP]:8080/?cdbt_api_key=[MY API KEY]&cdbt_table=wp_internetleads&cdbt_api_request=insert_data&data={column1:value1,column2:value2..etc.}

I tried using the JSON format from the dropdown but it would not pass data. How can I make the output match the above format exactly so I can pass data to my server? Please be as detailed as possible, as I am relatively new to this. Thanks! I really appreciate any help!

zaus commented 8 years ago

https://github.com/zaus/forms-3rdparty-integration/blob/master/README.md#how-do-i-make-a-get-request-instead-of-post

At which point you'll probably also need to wrap the $post_args['body'] JSON in an array instead, like

$post_args['response_bypass'] = wp_remote_get($service['url'],

array('data'=>$post_args['body']); return $post_args;

On Thu, Nov 5, 2015, 11:21 dannyhag notifications@github.com wrote:

Hi there!

I am new to passing data via API's and could use some assistance.

I have a number of landing pages which are currently successfully passing data to our call center via the Gravity Forms 3rd Party Integration plugin (over 1,000 records per day).

I am now trying to pass data directly to our local web server which I will use as a backup for all leads, and a repository for all the entries.

I am using the CDBT (Custom Database Tables) plugin for Wordpress on our local web server which enables access to database tables using an API Key.

Data passed must be in this exact format (API Request/URI):

http://[MY SERVERS IP]:8080/?cdbt_api_key=[MY API KEY]&cdbt_table=wp_internetleads&cdbt_api_request=insert_data&data={column1:value1,column2:value2..etc.}

I tried using the JSON format from the dropdown but it would not pass data. How can I make the output match the above format exactly so I can pass data to my server? Please be as detailed as possible, as I am relatively new to this. Thanks! I really appreciate any help!

— Reply to this email directly or view it on GitHub https://github.com/zaus/forms-3rdparty-xpost/issues/13.

--jeremy (mobile)

dannyhag commented 8 years ago

Thanks for your reply! Unfortunately my experience with this is limited. Where would I put such an array? In the plugin? Functions.php? I'm learning! :)

If I enter the following into the "Submission URL" Field I am able to pass the text "input_12" into the "first_name" column successfully... but I need it to pass the actual data and not the text "input_12"

http://12.34.56.789:8080/?cdbt_api_key=FFFF85BB-FFFF9175-FFFF7070-FFFF719F&cdbt_table=wp_internetleads&cdbt_api_request=insert_data&data={first_name:input_12}

Note: I have changed the actual IP address and API key here for security purposes because this posting is public.

Is there a way I can contact you by email?

Again, I appreciate your help and once we get this working I can promise a solid 5 star review wherever you get reviews!! lol

zaus commented 8 years ago

You can contact me directly via my website http://drzaus.com/contact.

You can put custom code in your themes functions.php file if it's easiest. You can also make a custom plugin file and upload it through the wp admin. Never make changes to plugin files, as it will void the warranty. Just kidding (about the warranty). Changes to the plugin itself will be overwritten if the plugin gets updated (either manually or if something does it automatically), so it's not a good idea to do it there.

You'll need the full hook code from the link I posted.