<?php $CLIENT_ID = "5372_dc3n7NvbHBApDwhEUEY5vq9fcaMSsYKnmYNMukC2"; $SECRET = "GFZtdbDOzxbA.ouvKX2ZGYoBL1Bi32cawWxalwL6kBDRZk8gPvZwNitAuROTJ9dl"; $nonce = rtrim(base64_encode(openssl_random_pseudo_bytes(rand(12, 30))), '='); $created = gmdate('Y-m-d\TH:i:s\Z'); $message = $nonce . $created . $CLIENT_ID; $signature = base64_encode(hash_hmac('sha256', $message, $SECRET, true)); $auth_header = 'http://api.soaringspot.com/v1/hmac/v1 ' . 'ClientID="' . $CLIENT_ID . '", ' . 'Signature="' . $signature . '", ' . 'Nonce="' . $nonce . '", ' . 'Created="' . $created . '"'; echo "Nonce: " . $nonce . "\n"; echo "Created: " . $created . "\n"; echo "Auth: " . $auth_header . "\n\n"; $ch = curl_init("https://api.soaringspot.com/v1/contests"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: " . $auth_header, "Accept: application/hal+json", ]); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "HTTP Code: " . $http_code . "\n"; echo "Response: " . $response . "\n"; ?>
You have javascript disabled. You will not be able to edit any code.