Jump to content

Urgent Help - HTTP GET And API


chatyak

Recommended Posts

I need to be able to send data via an API (to another server), every time a conversion/sale is made. Here is an example:

 

"Your Server to Server Key is 3adfa886-415f-4e80-8b53-bddedf59c0ec

 

To use the Server to Server Conversion API, make one HTTP GET request for every conversion. Adknowledge prefers to receive conversion data as conversions are processed. This allows Adknowledge's conversion processing and discounting systems to make decisions and store results in real time as soon as data is received.

 

The URL for the API is:

 

http://bidsystem.adknowledge.com/conversion_sts.php?key=3adfa886-415f-4e80-8b53-bddedf59c0ec&click_id=clickid&ip=ip"

 

 

Now on my tracking program's conversion page, I added the following PHP code:

 

<?php

 

$adknowledge = $_GET['http://bidsystem.adknowledge.com/conversion_sts.php?key=3adfa886-415f-4e80-8b53-bddedf59c0ec&click_id=clickid&ip=ip'];

 

?>

 

 

Will this successfully send the data through and count as a conversion? I am so lost it's not even funny.

 

Link to comment
Share on other sites

All that does is set a value. What you need to do is send a request to the URL (same as if a user typed it into their browser). Others may have a better solution, but one easy way to do this is with file_get_contents(). That function will call a page (as defined by the url you provide) and return the results. I would think that their service would return something that would be of value such as a success or failure code. So, if there is a failure you could re-queue the request for later or recheck your data for errors.

 

$key = '3adfa886-415f-4e80-8b53-bddedf59c0ec';
$clickID = 'some value';
$ip = '123.123.123.123'; //Only an example

$result = file_get_contents("http://bidsystem.adknowledge.com/conversion_sts.php?key={$key}&click_id={$clickID}&ip={$ip}");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.