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.

Search coupon session from a specific campaign based on your custom validation code, phone number or email.

Allows you to find a coupon session by searching on your own validation code, a phone number or an email address.
Example: you used custom validation codes to display codes and/or barcodes on the coupons. By using this search feature you can find the matching coupon session ID based on your custom validation code.
Base URL
POST: https://api4coupons.com/v3/campaignsession/search
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
4 campaign The unique ID from the campaign Can be found in the list of all campaigns.
Required
5 code Your custom validation code Minimum 5 characters.
Optional
6 phone A phone number Minimum 5 characters.
Optional
7 email An email address Minimum 5 characters.
Optional
<?php
	$ch = curl_init();
	$url = "campaignsession";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		'campaign' => "cam_123456"
	];
	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);
?>

Only one of the search options is required.

Example response
		{
			"status": {
				"status": "OK"
			},
			"results_found": "1",
			"searchresults": [
				{
					"campaign": "cam_12345",
					"session": "rg4u1ka3sncb5hrxyhtiw",
					"single_use_url": "https://digicpn.com/p/v6n7gn/rg4u1ka3sncb5hrxyhtiw",
					"custom_validation_code": "1020402010203040053",
					"customid": "",
					"coupon": {
						"ID": "cam_1010951",
						"code": "v6n7gn",
						"url": "https://digicpn.com/p/v6n7gn",
						"status": "test",
						"coupon_tags": ""
					},
					"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
						},
						"user": {
							"gender": "",
							"first_name": "",
							"last_name": "",
							"address": "",
							"zip": "",
							"city": "",
							"birthday": "0000-00-00",
							"email": "",
							"phone": "0",
							"device": "Windows",
							"profile_picture": ""
						},
						"campaign": {
							"ID": "cam_1010951",
							"code": "v6n7gn",
							"url": "https://digicpn.com/p/v6n7gn",
							"status": "test",
							"coupon_tags": ""
						}
					}
				}
			]
		}
		
Possible errors
  • 200: No filter defined
  • 200: No parameter campaign
  • 300: Search field 'code' must be at least 5 characters
  • 300: Search field 'email' must be at least 5 characters
  • 300: Search field 'phone' must be at least 5 characters
  • 502: campaign not found
  • 512: No results found.

  • Inscrivez-vous pour un compte d'essai de 7 jours

    Commencez à utiliser Coupontools dès aujourd'hui !

C'est bien que vous soyez ici ! Des cookies ? Lisez notre déclaration de confidentialité. J'accepte
x