- This topic has 1 reply, 2 voices, and was last updated 9 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate Tweaks › Pass the affiliate ID using Fast Secure Form
Tagged: api, WP Affiliate
Hello, I would like to use API with Fast Secure Form.
[http://example.com/wp-content/plugins/wp-affiliate-platform/api/post.php]
I am using “Silent Remote Sending Settings” in FS Form to pass the API variable. There is no issue with secret and sale_amt which I can get it from user input and secret is fixed value.
I put the following parameter under the “Silent send key value pairs to add”
secret=fixed value
sale_amt=sales amount field
ap_id=?? – i have no idea
But, I have no idea how to retrieve the “ap_id” variable. There are hidden field options but I am not sure how to retrieve the affiliate id from cookies.
I tried to use $_COOKIE as a default value for hidden field. But that didn’t work.
Kindly advise.
The referrer ID (if any) will be stored in the following cookie value so you have definitely have the right idea:
$_COOKIE
Before doing the API call, make sure to echo the value of the cookie to see if you are reading it correctly. Its PHP code, so you also need to make sure that the code you are writing is executing PHP code.
You can add the following example code somewhere on your site to verify that the cookie value is being read correctly:
<?php
$referrer_id = $_COOKIE['ap_id'];
echo "<br />Referrer ID: ".$referrer_id;
?>