Jump to content


API method Clan Reserves

api clan reserves access token

  • Please log in to reply
10 replies to this topic

EifelDriver #1 Posted 16 July 2018 - 06:12 PM

    Private

  • Player
  • 5985 battles
  • 13
  • [-GT] -GT
  • Member since:
    12-08-2016

Hello,

I want to build an app, that receive also information about my clan reserves via this method:

https://developers.w...d/clanreserves/

 

I have create an access token via Authentification - OpenID login , but the response of the API request is "empty":

{

  • "status": "ok",
  • -
    "meta": {
    • "count": 0
    },
  • "data": [ ]

}


I ask me how can I define the clan (via clan_id) to receive the reserve infos for this one? OR How can I create an access token, for my clan to receive this infos?

 

I'm afraid, that I dont understand the meaning of this API method.

 

Can anybody help or explain me?

 

Greetings
EifelDriver



lgfrbcsgo #2 Posted 16 July 2018 - 06:21 PM

    Warrant Officer

  • Player
  • 29956 battles
  • 990
  • [WJDE] WJDE
  • Member since:
    04-04-2012

https://api.worldoftanks.eu/wot/stronghold/clanreserves/?access_token=<insert_token>&application_id=<insert_id>

 

The access token and application id are simple query string parameters. https://en.wikipedia...ki/Query_string

The user's access token is used to determine the clan, i.e., the user has to be part of the clan.

 

Use the login method to get an access token. https://developers.w.../wot/auth/login


Edited by lgfrbcsgo, 16 July 2018 - 06:38 PM.


EifelDriver #3 Posted 16 July 2018 - 06:55 PM

    Private

  • Player
  • 5985 battles
  • 13
  • [-GT] -GT
  • Member since:
    12-08-2016

Thx for you reply.

But I have do the steps, that you told:

 - /auth/login

- receive access token

- go to Clan reserves and fill in the app_id and access token

- result is still "empty"

- and I am part of my clan

 

I cant understand what's going wrong.



lgfrbcsgo #4 Posted 16 July 2018 - 07:53 PM

    Warrant Officer

  • Player
  • 29956 battles
  • 990
  • [WJDE] WJDE
  • Member since:
    04-04-2012

Here is a very simple web application which will retrieve an access token from the user and the display the stronghold reserves.

 

index.html

 

This page has to be served from a web server, otherwise it will not work. Serving on http://localhost will do.

 

The application redirects the user to the login method with its URL set as the redirect_uri. After the login, the user will be redirected to our application with the access token in the query string. The application then parses the query string and calls the reserves method with the access token.

 

EDIT: Here's a live demo https://lgfrbcsgo.gi...ple-client-app/


Edited by lgfrbcsgo, 16 July 2018 - 09:58 PM.


lgfrbcsgo #5 Posted 16 July 2018 - 08:39 PM

    Warrant Officer

  • Player
  • 29956 battles
  • 990
  • [WJDE] WJDE
  • Member since:
    04-04-2012

View PostEifelDriver, on 16 July 2018 - 06:55 PM, said:

Thx for you reply.

But I have do the steps, that you told:

 - /auth/login

- receive access token

- go to Clan reserves and fill in the app_id and access token

- result is still "empty"

- and I am part of my clan

 

I cant understand what's going wrong.

 

Looking at the data fetched by the simple example, I see what's going wrong. You simply don't have any clan reserves. Count is 0.

EifelDriver #6 Posted 17 July 2018 - 07:33 AM

    Private

  • Player
  • 5985 battles
  • 13
  • [-GT] -GT
  • Member since:
    12-08-2016

Hello lgfrbcsgo,

thanks for your answer and your code example. 

 

It's correct that we have not XP- or Credit-Boosts at the moment, but I thought that I can also query the industry reserves about it. And in this case the response should not be empty.

 

Ok - I wait until we have reserves and then I test it again.

 

additional question: With what method I can request the industry reserves?

 

EifelDriver



lgfrbcsgo #7 Posted 17 July 2018 - 08:22 AM

    Warrant Officer

  • Player
  • 29956 battles
  • 990
  • [WJDE] WJDE
  • Member since:
    04-04-2012

View PostEifelDriver, on 17 July 2018 - 07:33 AM, said:

additional question: With what method I can request the industry reserves?

 

I don't know. The /reserves method only returns the available boosters.

 

response for my clan

 


Edited by lgfrbcsgo, 17 July 2018 - 08:29 AM.


EifelDriver #8 Posted 17 July 2018 - 08:44 AM

    Private

  • Player
  • 5985 battles
  • 13
  • [-GT] -GT
  • Member since:
    12-08-2016

You have a lot of boosts ! :-D

 

I search in the API documentation but dont found any option to request the available IR. Hmmm ...

 

If I found a solution, I will post it here.

 

Greetings
EifelDriver



EifelDriver #9 Posted 19 July 2018 - 08:01 AM

    Private

  • Player
  • 5985 battles
  • 13
  • [-GT] -GT
  • Member since:
    12-08-2016

just4info:

The retrieval of the clan reserves was successful - except the industry reserves.

 

This topic can be closed or marked as "solved".



kaadomin #10 Posted 25 July 2018 - 08:01 AM

    Second Lieutenant

  • Player
  • 30747 battles
  • 1,381
  • [NXD] NXD
  • Member since:
    06-11-2012

View Postlgfrbcsgo, on 16 July 2018 - 07:53 PM, said:

Here is a very simple web application which will retrieve an access token from the user and the display the stronghold reserves.

 

I think, you should remove the App-ID in you listing ... because of reasons

lgfrbcsgo #11 Posted 01 August 2018 - 08:15 PM

    Warrant Officer

  • Player
  • 29956 battles
  • 990
  • [WJDE] WJDE
  • Member since:
    04-04-2012

View Postkaadomin, on 25 July 2018 - 08:01 AM, said:

 

I think, you should remove the App-ID in you listing ... because of reasons

 

Well, it's a client app. Client app keys can be exposed to the public without harm.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users