/
Example Coupon API Access

Example Coupon API Access

Generate API Keys

To enable API access go to the settings page on the dashboard and scroll to the bottom and selected “Advanced Settings” option

 

You can enable API access on this page by selecting the toggle switch next to “API Access”

 

Once this is enabled you will be presented with a button. Please click the button that says “Open API Config”

You will then be presented with this window here:

When you click the “Generate” button you will be given two generated codes. One is the token and one is the secret.

In this example the token is 7184f2d6-f78c-4341-84b9-048c2b965f49 and the secret is vkC5R2f4F9BqGAsm.

You can use the secret and token to access the API.

 

Access the Coupon API

The example below will be written in PHP and executed on the website OnlinePHP: https://onlinephp.io/

You can do this same process in any language but we are using PHP.

 

<?php $membershipNumber = "CUSTOMER ID NUMBER"; // This is defined by you in the dashboard $cipher_algo = "AES-256-CBC"; $tk = "7184f2d6-f78c-4341-84b9-048c2b965f49"; $key = "7184f2d6f78c434184b9048c2b965f49"; $iv = "vkC5R2f4F9BqGAsm"; $cipher_text = openssl_encrypt($membershipNumber, $cipher_algo, $key, 0, $iv); $base64Encoded = base64_encode($cipher_text); echo ("https://vodapi.ezystream.com/v4/coupon/ext/list?tk=" . $tk . "&mn=" . $base64Encoded);

If this was all set up correctly you should get a response that looks like this:

[ { "couponOrgName": "Company Name", "phoneNumber": "0800 111 111", "website": "https://www.companyname.co.nz", "listImage": "https://admin.ezystream.com/static/images/coupons/list/image-200.jpg", "logoImage": "https://admin.ezystream.com/static/images/coupons/logo/image-600.jpg",= "showBarcode": 1, "categoryName": 3,show name "contactEmail": "email@company.co.nz", "order": 1, "couponCode": "123", "name": "description of the coupon" }, ... // More coupons below ]


Please get in touch with the EzyStream developers if you have any issues.

Struggling to find an answer to your question? Send us an email: help@ezystream.com