l2topzone.com
l2topzone.com

Author Topic: Problem with API  (Read 1404 times)

0 Members and 1 Guest are viewing this topic.

Offlinemauronob

  • Newbie
  • *
  • Posts: 1
  • L2topzone Votes: 1
  • Servers reviews: 0
  • Country: Argentina.
  • Reputation: +0/-0
  • L2topzone.com
    Problem with API
    « on: June 17, 2015, 12:34:34 PM »
    l2topzone.com
    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/l2-server-support-problems/9/problem-api/23770/

    Offlinexzone

    • Read our rules
    • Administrator
    • Hero Member
    • *****
    • Posts: 616
    • L2topzone Votes: 21
    • Servers reviews: 149
    • Country: Romania.
    • Reputation: +10480/-0
    • Gender: Male
      • l2topzone
    Re: Problem with API
    « Reply #1 on: June 18, 2015, 03: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.

    Read our rules

    Offlinexzone

    • Read our rules
    • Administrator
    • Hero Member
    • *****
    • Posts: 616
    • L2topzone Votes: 21
    • Servers reviews: 149
    • Country: Romania.
    • Reputation: +10480/-0
    • Gender: Male
      • l2topzone
    Re: Problem with API
    « Reply #2 on: June 18, 2015, 03: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
    }


    Share via diggShare via facebookShare via linkedinShare via myspaceShare via redditShare via twitter
     


    Sitemap