request_lookup

Updated on December 22nd, 2013

This method returns information regarding the status of a single automated purchase request.

Information returned includes, when the request was created, the app purchased, the API method used, where the download link was sent to, whether or not it was redeemed, when it was reedemed, etc.

Resource URL

https://api.given.to/rests/request_lookup

Parameters

request_id required

The numeric ID of the request this purchase is associated with. This value is included in the JSON response returned after every "successful" or "pending" app purchase request.

Example Value: 123456

Example

POST

https://api.given.to/rests/request_lookup

POST Data

request_id=123456

Sample Request: Get information about a previous app purchase request using PHP & cURL

<?php

        $url = 'https://api.given.to/rests/request_lookup'; 
        
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);

        $json_hold['request_id'] = 123456;
        $json = json_encode($json_hold);

        $data = array(
            'auth_key' => "YOUR_KEY", 
            'auth_secret' => "YOUR_SECRET", 
            'data' => $json
        );

        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $response = curl_exec($ch);
        curl_close($ch);
	
	echo "<pre>";
	print_r($response);
	echo "</pre>";

?>
				

Sample Response

{
	"request_id":123456,
	"status":"SUCCESS",
	"date_received":"2013-01-01T04:59:58+0000",
	"campaign_id":"8910",
	"campaign_name":"Test Campaign",
	"api_method":"single_buy",
	"option":"send",
	"sent_format":"number",
	"sent_to":"5555555555",
	"app_id":"999921725",
	"app_name":"Test App",
	"redeem_link":"http://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/freeProductCodeWizard?code=XXXXXX&mt=8",
	"redeem_redirect":"http://api.given.to/a/xxxxxx",
	"sent":true,
	"date_sent":"2013-01-01T04:59:59+0000",
	"redeemed":true,
	"date_redeemed":"2013-01-01T05:03:03+0000"
}