Jump to content


General Discussion of Wargaming Public API


  • Please log in to reply
726 replies to this topic

Merdis #21 Posted 28 December 2013 - 03:36 PM

    Warrant Officer

  • Beta Tester
  • 26268 battles
  • 793
  • Member since:
    09-28-2010

View PostHedeone, on 28 December 2013 - 02:59 PM, said:

2. In encyclopedia methods we are dependent on World of Tanks official portal. When this tanks (Mk. VIC and VK.72.01 (K)) will appear in Tankopedia, we will add them to API.


So what does decide which tanks will appear in tankopedia/API and which won't? Because A-32, M6A2E1 and Pz.Kpfw. V/IV are not still added. And those tanks have been rolling on EU server battlefields since 2011.



Lector #22 Posted 28 December 2013 - 03:58 PM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010
Pz V/IV is, I have it.
For a time there was a problem with the M4A2E4 Sherman, prompt this several times to support and was finally restored.

Edited by Lector, 28 December 2013 - 04:00 PM.


Hedeone #23 Posted 28 December 2013 - 04:50 PM

    Sergeant

  • Developer
  • 1 battle
  • 232
  • Member since:
    09-17-2013

View PostMerdis, on 28 December 2013 - 02:36 PM, said:

So what does decide which tanks will appear in tankopedia and which won't? Because A-32, M6A2E1 and Pz.Kpfw. V/IV are not still added. And those tanks have been rolling on EU server battlefields since 2011.

API returns all information about tanks, which are present in tankopedia. Other questions about tankopedia does not related to Wargaming API.
Pz.Kpfw. V/IV exist in Tankopedia and in API ("tank_id": 51473).



Lector #24 Posted 28 December 2013 - 09:29 PM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010
When will again correct names of Japanese vehicles in the encyclopedia?
http://api.worldoftanks.eu/2.0/encyclopedia/tanks/?application_id=demo&language=pl
Because now I have: "name_i18n":"#japan_vehicles:Ke_Ni_B"
A short time after the addition was correct names.

estXcrew #25 Posted 28 December 2013 - 11:33 PM

    Sergeant

  • Player
  • 16706 battles
  • 229
  • [WRYA] WRYA
  • Member since:
    09-11-2012
I do like it, and look forward to using it in my web applications. Nice move WG!

Hedeone #26 Posted 31 December 2013 - 07:20 AM

    Sergeant

  • Developer
  • 1 battle
  • 232
  • Member since:
    09-17-2013

View PostLector, on 28 December 2013 - 08:29 PM, said:

When will again correct names of Japanese vehicles in the encyclopedia?
http://api.worldoftanks.eu/2.0/encyclopedia/tanks/?application_id=demo&language=pl
Because now I have: "name_i18n":"#japan_vehicles:Ke_Ni_B"
A short time after the addition was correct names.

Thanks for information, we will correct field name_i18n for Japanese tanks in near future.



Unknown0ne #27 Posted 01 January 2014 - 07:38 PM

    Corporal

  • Beta Tester
  • 0 battles
  • 114
  • Member since:
    07-28-2010

View PostMiChAeLoKGB, on 27 December 2013 - 07:08 PM, said:

Download LightOpenID and that will do it for you, so you dont have to write almost any code.

 

Piece of code at login page (Im also requesting their WG name (namePerson/friendly), to save it as Username there):

 

View Posts2k11, on 27 December 2013 - 10:57 PM, said:

You don't have HTML in your example but your comments are telling me, you are mixing it together with PHP. Please, please don't. :sad:

 

But yeah, there are many OpenID libs out there no need to invend a new wheel. I've modified mine, so I'm not sure which lib I'm using. I think it was lightOpenID, too.

 

 Here you got another view. Looks familiar, but there are also some commands for my framework in it. I hope I'm not confusing somebody :D

But remember the EULA, inform the user which data you are collecting ;)

 

View Postblaah, on 27 December 2013 - 11:32 PM, said:

Unknown0ne, like the other people said, the easiest way is to use an existing OpenID library. I also use LightOpenID and it works just fine :)

Btw. are you the Unknown0ne from NA server?

 

Thank you all for your replies, and while it wasn't the answer I thought I was looking for, it got me to the answer I needed.

 

I had already been using an OpenID library in conjunction with the http://(region).wargaming.net/id/ URL to log the user in. The thing was, the best I could tell, that wasn't providing an access token in the response, which I was wanting. Never the less, the lack of the solution I was looking for (in the API documentation, via all of your replies, and my own testing) made me look at if what I was trying to do was correct.

 

What I've come to realize is that there's a reason OpenID isn't returning the access token; it simply shouldn't. OpenID is about authentication; having access to a user's access token goes far beyond authentication because it grants access to information which isn't public, and simply isn't needed to authenticate the user.

 

Thus, I've decided to continue to use an OpenID library and provide an option to attach an access token to the user's account so that those additional statistic would be available for those who wanted them, as it isn't critical to functionality to have access to that restricted information. Though I do plan on using the method I described in my original post to validate that the returned access token is valid and does belong to the correct user (unless I can figure out how to get the access token through OpenID).

 

So once again, thank you for your replies, I really do appreciate it.

 

Also, yes, I am from the NA server; best I could tell there wasn't a section in the NA forums for the API.

 

 

 

In an unrelated note, there's a glitch with the Confirm Action page in that, if you click the Back link on the page, rather than taking you back, it instead just confirms the action and redirects you as if you had correctly entered your password into the prompt. This happens with both the API Explorer and my test application.



blaah #28 Posted 01 January 2014 - 11:01 PM

    Private

  • Clan Diplomat
  • 24930 battles
  • 38
  • Member since:
    01-28-2012

Okay, I will share my code then:

            $openid = new LightOpenID('LOCALHOST');
            if (!$openid->mode) {
                    $openid->identity = 'http://eu.wargaming.net/id/';
                    header('Location: '. $openid->authUrl());
            } elseif ($openid->mode == 'cancel') {
                // USER CANCELED THE AUTHENTICATION
            } else {
                # Looks like everything was fine, we can now login or register the user:

                preg_match('/^(.*)\/([0-9]+)\-([a-zA-Z0-9_]+)\//', $openid->identity, $matches); // <- identity contains somekind of link with info about which player just logged in, I'm parsing it using preg_match to get the user ID
                $PlayerId = $matches[2];
                
                // We have the playerId, let's look if he's in our DB:
                // $data = DB_SELECT_ROW_CODE
                
                // We have to register the user first:
                if (empty($data)) {
                    $Table = new Users;
                    $Table->playerId = $PlayerId;
                    $Table->insert();
                }

 

                // CODE_TO_LOG_THE_USER_IN
                
                header('Location: index.php'); // or something...

}

 

Now how it works:

I have this code in a file (let's call it...) login.php, when user is requesting it, he gets redirected to WG page automatically (I don't use any buttons).

When he enters all data correct, he gets redirected back to login.php with his ID stored in $openid->identity - we assume that he was authenticated.

If you enter wrong data, WG won't redirect it back, it will say 'invalid data' and stay on login page.

If you enter correct data and press 'cancel' when accepting to share his data with your website, he gets redirected to login.php with $openid->mode equal to 'cancel'.

Basicly all kind of events should be processed fine by above code.

Btw. I have my own session system, so I don't ask WG every time someone make request if he's logged in or not.

 

Unknown0ne:

This is funny, but the day you posted your message I've watched a video with you on Smiggetti's channel :smile:

I enjoyed your mates WZ gameplay. You made me want WZ. :P


Edited by blaah, 01 January 2014 - 11:03 PM.


Lector #29 Posted 02 January 2014 - 09:50 AM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010
The API is missing yet max_frags account.
Max_frags is for each vehicle, but it is disabled.


Lector #30 Posted 03 January 2014 - 11:02 AM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010

Hedeone

 

I know you were the holidays and probably no one to kick the dirty work of adding these few premium tanks is an encyclopedia.
On the other hand, I'm very curious how much you / them to take.

You may be able to help me in a different way, I need quite urgently tank_id Tank Mk. VIC. Are you able to without his presence in
encyclopedia and API to give me his tank_id?


Edited by Lector, 03 January 2014 - 11:12 AM.


StormimOn #31 Posted 03 January 2014 - 03:17 PM

    Staff Sergeant

  • Beta Tester
  • 18760 battles
  • 460
  • Member since:
    10-04-2010

Since RU Tankopedia is up to date, you can use RU API to get the info (each cluster has is own URL to access API) : RU cluster vehicles list

The tank_id is 54865.

 

NA cluster is almost up to date (3 tanks missing), and EU is really obsolete (7-8 tanks missing and T-50-2 in it when it's been a long time since it has been removed from the game).

Can't understand why only EU is obsolete but that's another story.



Lector #32 Posted 03 January 2014 - 11:13 PM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010

THX

 

Also I am surprised why the European server on which (I guess) plays the most players is always something to back.
Maybe it is for a small amount of people dedicated to this server, because even the results of the competitions appear almost a month later than the other servers.



StormimOn #33 Posted 04 January 2014 - 06:46 PM

    Staff Sergeant

  • Beta Tester
  • 18760 battles
  • 460
  • Member since:
    10-04-2010

Hedeone,

 

I was wondering if data about player clans history was saved by wargaming ?

So we could have a method to retrieve clan history of a player (clan id, tag, name, date of entry and exit).

 

And about player search method, could we also have clan tag and name in the result (and not only clan id) ?

So we could display the data in a list without the need to call the clan details method. It would be usefull I think.


Edited by StormimOn, 05 January 2014 - 11:44 AM.


MassiveHyperion #34 Posted 07 January 2014 - 06:12 AM

    Private

  • Player
  • 0 battles
  • 10
  • Member since:
    01-07-2013

What would be REALLY handy is an API that retrieves any upcoming scheduled Tournament or Clan War battles for a specified player.

 

What I'd really like to be able to build is a view of an account that shows any known upcoming battles.  I like to participate in a lot of tournaments and there's no convenient way of knowing when you have scheduled battles.  With an API that shows any known scheduled battles I could create an iCalendar item to remind me to be online to play.

 

 



blaah #35 Posted 07 January 2014 - 12:05 PM

    Private

  • Clan Diplomat
  • 24930 battles
  • 38
  • Member since:
    01-28-2012

There should be no problem with CW battles. If you want to do it by a player name / ID you can use API to find the player, get his clan ID and look for upcoming battles for that clan ID.

There are some Windows Gadgets showing upcoming battles for your clan that (I suppose) use this method.

 

Tournaments are different story. There's no way to get info about them using API.



Lector #36 Posted 08 January 2014 - 10:28 AM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010
Is something going to add a "new" premium vehicles to the API?
December 3 was added KV-220, December 25 was added Mk. VIC and are probably a few other vehicles that are missing.
It's been a month since the introduction of certain vehicles, which still does not have the API would understand if they were new vehicles (like the Japanese, but they have added in a few hours after giving us an update!), But these are the vehicles that already exist are on other servers.
I do not understand what a huge problem to do the updating in Tankopedia so that these vehicles were in the API.
If this continues it will again appear in other vehicles - newly added to the trees or entire new trees and the premium tanks will not.


blaah #37 Posted 08 January 2014 - 10:41 PM

    Private

  • Clan Diplomat
  • 24930 battles
  • 38
  • Member since:
    01-28-2012

From what Hedeone said I understand that tankopedia is something different from WoT API and they have no influence on it. They don't know when people who maintain the tankopedia will do it. You would have to ask them.

 

Anyway that would not be a real issue, because you can always get the tanks list from other APIs (RU or NA for example). The problem is that vehicles missing from EU tankopedia are not listed in player's tanks even though they are displayed ingame.



Lector #38 Posted 08 January 2014 - 11:42 PM

    Second Lieutenant

  • Beta Tester
  • 3728 battles
  • 1,022
  • [22KT] 22KT
  • Member since:
    12-18-2010

List your vehicle, but what about the statistics of the vehicle?
I'm on your side writes the daily data and generates charts and for vehicles that are not in the api I can not - I do not get to their data.

I know the API is dependent on tankopedia, but what's the problem tankopedia duplicate of another server and give to the EU? So that vehicles from the game are available in the API.
If anyone but the staff are probably the best contact with each other and that they should inform each other what to do.

I created this program before, I wrote to the slide why there is (and was) a premium M4A2E4 Sherman tank, unless it added three game updates. Although each update have been added premium vehicles or normal with trees. Appeared only as there was a new "Hall of Fame", although prompt much earlier and often.

 

My vehicles: http://lector.wot-stat.tk/vehicles.php

 

And as you can see there is no Mk. VIC which played a few battles.
You will be just as it will in the API, because the site generates a list of API.
Willingly or not, I can not play it, no data on it will not save me, not because I have no where to download them manually I do not want every time to edit.



Scrambled #39 Posted 09 January 2014 - 03:47 PM

    Warrant Officer

  • Beta Tester
  • 3380 battles
  • 691
  • Member since:
    09-29-2010

The API call for player vehicles has a lot of fields that say "Warning, field will be disabled" - and unfortunately that's the exact fields I need to be using for a few things. Now the question is, will they be removed, or is that warning more a case of "this stuff isn't implemented yet so they won't contain useful data"? 



MetalRaven56 #40 Posted 09 January 2014 - 04:56 PM

    Private

  • Player
  • 0 battles
  • 21
  • Member since:
    12-28-2013
Agreed.  A clearer message seems to be in order, at least for some fields.  Something like: "Warning: pending implementation".  The "will be" in the current message implies it works now but will be turned off or removed in the future.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users