Coupontools Logo

API & Webhooks

Connect the Coupontools platform with your apps or web projects. The Coupontools REST API allows you to query meta-data about your account, campaigns, distribution, validations, and usage data.

Retrieve all data from a coupon session

Returns all available data from one coupon session
Base URL
POST: https://api4coupons.com/v3/couponsession/data
Parameters
# Parameter Input Description
1 client_id API client ID Can be found in your API documentation
Required
2 client_secret API client secret Can be found in your API documentation
Required
3 couponsession The unique session code (example: ac6s7u3g8a25ja7x9qg87) Can be found in the URL or webhooks or API call to retrieve all data from a campaign
Required
<?php
	$ch = curl_init();
	$url = "https://api4coupons.com/v3/couponsession/data";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		'couponsession' => "ac6s7u3g8a25ja7x9qg87"
	];
	curl_setopt($ch, CURLOPT_URL, "$url");
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_VERBOSE, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
		"X-Client-Id: $client_id",
		"X-Client-Secret: $client_secret",
		"Content-Type: application/json",
	]);
	curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
	$response = curl_exec($ch);
?>
Example response
		{
			"status": {
				"status": "OK"
			},
			"campaign": "cam_12345",
			"action": "retrieve_all_session_data",
			"session": "kkfiznr8Yp8630h82es8d,"
			"session_url": "https://digicpn.com/p/v6n7gn/kkfiznr8Yp8630h82es8d",
			"sequenceid": "19878460",
			"customid": "",
			"data": {
				"status": {
					"created_date_utc": "2019-03-25 10:43:50",
					"opened": "0",
					"open_date_utc": "",
					"played": "0",
					"played_date_utc": "",
					"claimed": "1",
					"claim_date_utc": "2019-03-25 10:44:05",
					"claimtype": "",
					"saved_to_passbook": "0",
					"saved_to_passbook_date_utc": "",
					"saved_to_androidpay": "0",
					"saved_to_androidpay_date_utc": "",
					"validated": "0",
					"validation_date_utc": "",
					"own_validation_code": "ding_COdHepKvqNrNC8OU",
					"validation_value": "",
					"redeem_location_ID": "",
					"voided": "0",
					"unvoided_date_utc": "2019-03-25 10:44:05",
					"locked": "0",
					"unlocked_date_utc": "",
					"value": "",
					"customid": "",
					"expiration_date": "2019-03-02 02:00:00",
					"utm_campaign": null,
					"utm_source": null,
					"utm_medium": null,
					"utm_term": null,
					"utm_content": null,
					"redeem_location_company_name": "Show",
					"redeem_location_street": "street",
					"redeem_location_zip": "",
					"redeem_location_city": "Foo",
					"redeem_location_province": "Bar",
					"redeem_location_country": "Baz",
					"redeem_location_phone": "",
					"redeem_location_website": "https://www.coupontools.com",
					"redeem_location_pincode": "aSQbSs"
				},
				"user": {
					"gender": "Male",
					"first_name": "John",
					"last_name": "Johnson",
					"address": "Wallstreet 1",
					"zip": "10000",
					"city": "New York",
					"birthday": "1970-01-01",
					"email": "info@mymailbox.com",
					"phone": "1234567890",
					"answer": "yes",
					"custom1": "A",
					"custom2": "B",
					"custom3": "C",
					"custom4": "D",
					"custom5": "E",
					"custom6": "F",
					"custom7": "G",
					"customid": "1A2B",
					"checkbox1": "1",
					"checkbox2": "0",
					"checkbox3": "1",
					"checkbox4": "0",
					"device": "Windows",
					"profile_picture": "",
					"ip_lat": "",
					"ip_long": ""
				},
				"campaign": {
					"ID": "cam_1010951",
					"code": "v6n7gn",
					"url": "https://digicpn.com/p/v6n7gn",
					"status": "test",
					"coupon_tags": ""
				}
			}
		}
		
Possible errors
  • 200: Missing parameter: couponsession
  • 300: Invalid character in parameter: couponsession.
  • 513: Coupon session not found.

  • Regístrate ahora para una cuenta de prueba por 7 días

    ¡Empieza a usar Coupontools hoy!

¡Genial, estás aquí! ¿Cookies? Lee nuestrasPolíticas de Privacidad. Yo acepto
x