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.
-
Subaccount
- Retrieve a list of subaccounts
- Retrieve info of a subaccount
- Create a subaccount
- Update a subaccount
- Create password reset url for subaccount
- Single sign on for subaccounts
-
Campaign
- Retrieve a list of your campaigns
- Retrieve information from a campaign
- Retrieve all usage data from a campaign
- Retrieve all data from one coupon session
- Update data from a coupon session
- Update data from multiple coupon sessions
- Search coupon session
- Search coupon session from a campaign
- Send single push notification
- Send push notification to all
-
Loyalty Card
- Retrieve a list of your loyalty cards
- Retrieve a list of users from a loyalty card
- Update loyalty card user
- Send single push notification
- Send push notification to all
-
Directory
- Retrieve a list of your directories
- Retrieve information from a directory
- Retrieve all campaigns from a directory
- Retrieve registered users from a directory
- Update directory user payment status
- Retrieve a list of categories
- Retrieve a list of 3rd level categories
-
Single Use
- Create a single use access URL
- Create multiple single use access URLs
- Remove a single use access URL
Search coupon session 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/couponsession/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 | code | Your custom validation code | Minimum 5 characters. |
Optional
|
5 | phone | A phone number | Minimum 5 characters. |
Optional
|
6 | 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 = [ 'code' => "ac6s7u" ]; 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.