Documentation: API solution

You are here: Home \ Documentation
Huuray Developer Portal
API Docs

The Huuray platform manages digital gift cards. Huuray provides an API solution, which enables reseller’s third party applications to offer their own end-to-end digital gift card programs with minimal effort.

Huuray API Documentation

Fully featured modern APIs with developer friendly tools

Exemple of an url.

– http://api.[country][AuthToken]

Token Explenation:

  • Country [Mandatory]
    -The ISOAlpha2 – Like dk, no, fi or se
  • AuthToken [Mandatory]
    – The token to get access to the api
  • Product [Optional]
  • – Required if need to send product out, otherwise it will be a all-round coupon if you have access for that too.
  • Fullname [Optional]
    – Only need so we have info about how have order the coupon
  • Buyeremail [Optional]
    – Only need so we have info about how have order the coupon
  • Message [Optional]
    – If there should be added a message to the sms or email.
  • Phone [Optional]
    – If phone is supplied it will send a sms to the given number, the countrycode will be set for the country that api is open for.
    – If both Phone and Email is Supplied DeliveryMethod is Mandatory
  • Email [Optional]
    – If Email is supplied it will send an email to the given email.
    – If both Phone and Email is Supplied DeliveryMethod is Mandatory
  • DeliveryMethod [Optional]
    – It will become Mandatory if both sms and email is supplied, otherwise it will always send the the given parameters
  • DeliveryTime [Optional]
    – The time of the delivery for the coupon
    – Specify yyyy-MM-dd HH:mm / Y-m-d H:i
  • Code [Optional]
    – If you wish to control what code to send out
  • RefID [Optional]
    – Your own reference

After the request is sent

We will Response OK or Fail with the given response text:

  • Your API Access was not found or have been recalled
  • Your IP is not allowed to use this ip.
  • Your API Access is not allowed in this Country
  • You have nothing left on your account
  • You didn’t specified Phone or Email for sending
  • You ditn’t specified Delivery Method
  • There is no template for the given delivery method
  • Delivery Method set to SMS but no phone supplied
  • Delivery Method set to Email but no email supplied
  • No Giftcard left
  • There was no voucher left on the given product
  • Order not created
  • No Coupon found

It should be noted that the URL must NOT under any surcumstanse be visible to the end user, for example. using the pixel, the best practices is Server 2 Server call.

PHP example
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
if($resp == ‘OK’)
{ //Message Sent }
else { 
//Message Failed }

C# example
var uri = new Uri(“);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
Stream dataStream = null;
request.Method = “GET”;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
if(responseFromServer = “OK”) { 
//Message Sent }
else { 
//Message Failed }