Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type: application/json");
- if (!isset($_GET["key"])) {
- echo '{"access_denied": "No "key" field!"}';
- exit();
- }
- if ($_GET["key"] == "{my key}") {
- if (isset($_GET["tag"])) {
- $access_token = "{my token}";
- $headers = array("Authorization: Bearer " . $access_token);
- // Initiate connection with API
- $ch = curl_init("https://api.clashofclans.com/v1/clans/%23" . $_GET["tag"] . "/members");
- // Set the Authorization header
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- // Execute the request (which also echo's it to the user)
- curl_exec($ch);
- // Close request
- curl_close($ch);
- } else {
- echo '{"error": "No "tag" field!"}';
- }
- } else {
- echo '{"access_denied": "Wrong "key" field!"}';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement