l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com

Author Topic: Problem with API  (Read 3699 times)

0 Members and 1 Guest are viewing this topic.

Offlinemauronob

  • Newbie
  • *
  • Posts: 1
  • L2topzone Votes: 1
  • Servers reviews: 0
  • Reputation: +0/-0
  • L2topzone.com
    Problem with API
    « on: June 17, 2015, 11:34:34 AM »
    I'm using the API, and always returns false.

    In my navigator URL i put this (like in the web)

    http://l2topzone.com/api.php?API_KEY={MyAPI-Key}&SERVER_ID={MyServerID}&IP={REPLACE_WITH_IP_TO_CHECK}

    In this {REPLACE_WITH_IP_TO_CHECK} i put my real ip and the ip of my server but the result of all attempts is "FALSE".

    Anyone can get me some help?

    regards

    Linkback: https://l2topzone.com/forum/index.php?topic=23770.0

    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com

    Onlinexzone

    • Read our rules
    • Hero Member
    • *****
    • Posts: 663
    • L2topzone Votes: 53
    • Servers reviews: 159
    • Reputation: +10480/-0
      • l2topzone
    Re: Problem with API
    « Reply #1 on: June 18, 2015, 02:26:17 AM »
    Hello,
    I have send you a private message how the link must look. If you want to check your users if have vote you must check by IP this mean you change only  IP variable from the link.


    Onlinexzone

    • Read our rules
    • Hero Member
    • *****
    • Posts: 663
    • L2topzone Votes: 53
    • Servers reviews: 159
    • Reputation: +10480/-0
      • l2topzone
    Re: Problem with API
    « Reply #2 on: June 18, 2015, 02:33:20 AM »
    Also here is a simple PHP script that can check and give to the user reward.
    The code below is just an example to make it works,you must change API_KEY with your server  API_KEY also need to change the SERVER_ID with your server id.

    Code: [Select]
    $userIP = $_SERVER['REMOTE_ADDR'];
    $check_for_reward = file_get_contents('http://l2topzone.com/api.php?API_KEY=e04e15b263448fda50815f9f8f5c7b3b&SERVER_ID=11579&IP='.$userIP);

    if($check_for_reward == 'TRUE'){
        //insert reward in user account
    }else{
        // error message
    }

     

    Sitemap